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

Could usefully prune already-emitted tasks to avoid cycles. #3

Closed sleekweasel closed 8 years ago

sleekweasel commented 9 years ago

I left this running during dinner and my poor computer was churning out an infinite tree when I returned!

Can I suggest that it marks a task as 'explored' as soon as its starts printing its dependencies, and doesn't descend into it if it's already marked as such?

Cheers!

dorongold commented 9 years ago

You are correct about the redundancy of visiting the children of the same node more than once. I merged your fix.

However, I cannot reproduce a situation with an infinite recursion. Can you please give me an example for a build.gradle that causes such infinite recursion?

dorongold commented 8 years ago

Version 1.2.1 introduces the optional command-line parameter --no-repeat which can be added to taskTree to prevent printing the same sub-tree more than once.

Since gradle does not allow circular task dependencies, and since I don't see how this issue can be reproduced, I decided to leave printing all dependencies (including repetitions) as the default behavior. As far as I can tell, and I would appreciate being proven wrong, this should never cause an infinite recursion.