Skip to content

Commit

Permalink
Fix to support gradle 6
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeiwp committed Nov 21, 2019
1 parent 9ad8d1d commit b335da3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: "com.gradle.plugin-publish"
Expand All @@ -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
Expand Down Expand Up @@ -68,4 +69,4 @@ test {
// showStandardStreams = true
exceptionFormat = 'full'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b335da3

Please sign in to comment.