I have a gradle plugin that uses the project.version
variable.
How ever, the version in the plugin does not update when I change the version in the build.gradle
file.
To illustrate:
plugin
// my-plugin
void apply(Project project) {
project.tasks.create(name: 'printVersionFromPlugin') {
println project.version
}
}
build.gradle
version '1.0.1' // used to be 1.0.0
task printVersion {
println project.version
}
apply plugin: 'my-plugin'
Result
> gradle printVersion
1.0.1
> gradle printVersionFromPlugin
1.0.0