That changed worked. I am just using the println as a bit of information before the publication tasks are called. Right now, I am rely on both the dependsOn statement to execute the two publishing statements. Unfortunately, because I am using the dependsOn to call the two publishing tasks, the informational message is posted after the publishing is down instead of before it.
I have two further questions.
-
Is there a framework in Gradle to post the informational message without calling the system out?
-
Is there another way to execute the two tasks after I post the informational message?
tasks.register("allMyPublishing") {
dependsOn tasks.publishToMavenLocal
dependsOn tasks.publishReleasePublicationToCloudsmithRepository
doFirst {
System.out.println("Publishing to MavanLocal and Cloudsmith repositories.")
}
}