I'm still new to Gradle and I'm struggling to understand how task configurations for plugin tasks work. Consider the Jar
task from the Java plugin: if I overwrite the doFirst
and doLast
methods why does the plugin's original set of actions still occur but if I change the description
of the Jar
task then my new description is used? The contents of my build script are:
plugins{
id 'java'
}
jar {
description "The new description"
doFirst {
println "this happened first"
}
doLast {
println "This happened last"
}
}
I ask this more to solidify my understanding of how gradle works and not necessarily because I would like to do this yet.