dorongold / gradle-task-tree

Gradle plugin that adds a 'taskTree' task that prints task dependency tree
Apache License 2.0
857 stars 56 forks source link

Plugin do not work on gradle 2.8 #9

Closed tux-mind closed 7 years ago

tux-mind commented 8 years ago

I have another plugin that works only with gradle <= 2.8, forcing me to use gradle version 2.8.

You plugin uses the internal class org.gradle.internal.logging.text.StyledTextOutput which is not present in that version, causing the following error:

> Failed to apply plugin [id 'com.dorongold.task-tree']
   > Could not generate a proxy class for class com.dorongold.gradle.tasktree.TaskTreeTask.

A quick workaround is to require a certain gradle version to ensure that your plugin can work. A more robust fix is to disable colored/styled output if that class cannot be found.

I hope this helps, best regards :)

dorongold commented 8 years ago

The newest version of the taskTree plugin works with gradle versions 2.14 and up. See: https://github.com/dorongold/gradle-task-tree#version-compatibility

tux-mind commented 7 years ago

Ok, I made this issue just to let you known.

Closing.

dorongold commented 7 years ago

I now solved this in a more elegant way:

The new version of the plugin (1.3) works on all Gradle versions greater than 2.3.

Instead of having an import statement with org.gradle.internal.logging.text.StyledTextOutput, I take advantage of Groovy's dynamic nature and define StyledTextOutput as a dynamic variable. This way it can work in different gradle versions which have this class under different FQNs.

d7cbef5013eb9402be75d3c899177a091a5d36e5 ae2c2fce3f98ef8a0f122dcf63cc4efedc987584

tux-mind commented 7 years ago

Thank you mate :) Great job :)