Hi

maybe this is something I missed in the documentation but I haven't found
any documentation on this.

I have a plugin extending the java plugin but I want to print out some basic
information on it when running.
The problem with just adding print in apply() is that it gets printed
multiple times when I use it in a multiproject.

The solution I use now is something like:

apply(Project target){
...
if (!target.rootProject.hasProperty("versionStamp")) {
... //set the versionStamp property
target.rootProject.task("printNexusPluginVersion", {println "Nexus build
plugin version $project.versionStamp"});
target.rootProject.getGradle().addBuildListener(
             new BuildAdapter() {
                void projectsEvaluated(Gradle gradle) {
                    gradle.rootProject.printNexusPluginVersion.execute();
                }
              })
...
}

Can anyone here suggest a more elegant solution for doing the same?

thanks
Gretar

Reply via email to