Concepts#
Notations#
The notation always represents a term or works as a pronoun,
such as latest
, localProperties
, latestRelease
.
On The Fly#
It indicates this task will be registered after project evaluation, so you can't access it in your build.gradle[.kts] normally.
You have to access it in this way:
tasks.whenTaskAdded { it ->
if (it.name == 'jar') {
// do something
}
}
tasks.whenTaskAdded {
if (name == "jar" && this is org.gradle.jvm.tasks.Jar) {
// do something
}
}