diff --git a/build.gradle b/build.gradle index 0e98861..42b558b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,4 @@ + apply plugin: 'groovy' apply plugin: 'maven' apply plugin: "com.gradle.plugin-publish" @@ -20,7 +21,7 @@ repositories { } group = 'com.dorongold.plugins' -version = '1.4' +version = '1.5' description = "Gradle plugin that adds a 'taskTree' task that prints task dependency tree" //Building a text file that contains the classpath of the plugin code. needed for testing on gradle versions prior to 2.5 @@ -68,4 +69,4 @@ test { // showStandardStreams = true exceptionFormat = 'full' } -} \ No newline at end of file +} diff --git a/src/main/groovy/com/dorongold/gradle/tasktree/TaskTreeTask.groovy b/src/main/groovy/com/dorongold/gradle/tasktree/TaskTreeTask.groovy index fd6037d..ba5c2d5 100644 --- a/src/main/groovy/com/dorongold/gradle/tasktree/TaskTreeTask.groovy +++ b/src/main/groovy/com/dorongold/gradle/tasktree/TaskTreeTask.groovy @@ -41,7 +41,13 @@ abstract class TaskTreeTask extends AbstractReportTask { executionPlan = executionGraph.executionPlan } // Getting a private field is possible thanks to groovy not honoring the private modifier - Set entryTasks = executionPlan.entryTasks + Set entryTasks + // Gradle 6+ + if (executionPlan.hasProperty('entryNodes')) { + entryTasks = executionPlan.entryNodes + } else { + entryTasks = executionPlan.entryTasks + } Set tasksOfCurrentProject = entryTasks.findAll { it.getTask().getProject() == project } // take advantage of gradle's dynamic nature and get the Style enum (which has different FQNs in different gradle versions)