Hey community. What's the best plugin(s) that prin...
# community-support
j
Hey community. What's the best plugin(s) that print the task graph for a given Gradle invocation? I am thinking of something like
dependencies --configuration=someClasspath
but for task dependencies. Should ideally print to the console. I know that there are several plugins out there – some of them unmaintained. Has anyone researched this recently or successfully uses an existing plugin?
s
Whenever in need, I was using https://gitlab.com/barfuin/gradle-taskinfo and was happy with it so far.
👍 1
v
In the ideal case it should output mermaid diagram ready to insert into the plugin documentation :-)
🧜‍♀️ 1
j
Thank you @Sebastian Schuberth. I tried that one last year or so when I was already starting to look into the topic. I think it is quite neat. The output looks very good. I think the issue I had was that it is just plainly failing when you use included builds. I do not require special support for includedBuilds, but I would like it to not-fail, if I have an included plugins build. Wonder if the developer would still take contributions. If anyone knows about other alternatives, please share.
a
cc @Vladislav Chesnokov
👀 1
n
@Jendrik Johannes https://gitlab.com/barfuin/gradle-taskinfo#limitations The plugin mentions a flag to make it not fail. Does that help?
j
Thanks @Niels Doucet. Now I also remember that I found that last year. I think I got demotivated by the fact that it is a property and there is thus there is no way to configure it via a convention plugin. But it should still be good enough. Of course the plugin is also not ready for Configuration Cache. But on the upside there is an issue for that already and the maintainer is actively answering issues. So I guess the only thing to do would be to do a PR to fix CC and maybe make the includeBuild flag configurable in other ways 🙂 https://gitlab.com/barfuin/gradle-taskinfo/-/issues/23
...and ideally migrate things to Provider/Property. With which the CC-support could be solved along the way. I think the idea of how the plugin implements this is good. Although it is kind of a hack: You call the plugin task together with the task you want a report on. The plugin is then deactivating the execution of the task and its dependencies after the graph was computed. If this can be fully made CC compatible, I don't know.... The code is also very clean and clear, but could use a "Gradle modernization" treatment.
v
If this can be fully made CC compatible, I don't know....
It probably "just" needs to register an
onlyIf
action on all tasks?