The following code is implemented in a Gradle plugin:
// from the plugin
void apply(Project project) {
// apply the Gradle extension plugin
applyExtension(project)
project.afterEvaluate {
// I do some stuff in here, excluded as irrelevant
}
// add the custom Task Listener that streams Task records
project.gradle.taskGraph.addTaskExecutionListener new TaskListener()
}
do you probably apply this plugin on multiple projects within a multiproject build? the taskgraph is build - global, I mean one taskgraph per build, but projects are not.
That appears to be it. I have the root project, and two subprojects in the sample I’m using. I just turned off one of the subprojects, and I got two records instead of three.
Is there a solution to this? I’m only executing a task for a single subproject… directly specifying it with -p… which makes me think I’m calling a single task. Can you think of a way to boil this down to a single call?
I figured it out Rene… Just removing the Plugin application from the “allprojects” section and putting it into “subprojects” solved this… I’m not sure why I was initially applying it there… but this has been corrected.