nebula-release-plugin
nebula-release-plugin copied to clipboard
Incompatibility with the Gradle Scala plugin ?
I'm trying to use the Nebula release plugin with a Scala plugin and I noticed something that I can't explain.
I created a very simple Gradle (6.6) build with the following build script:
plugins {
id 'base'
id 'nebula.release' version '15.3.0'
}
defaultTasks 'printVersion'
release {
defaultVersionStrategy = versionStrategies.find { it.name == 'snapshot' }
}
task printVersion() {
doLast {
println "Project version: ${project.version}"
}
}
Run the build and you'll get something similar to the following:
$ ./gradlew
> Task :printVersion
Inferred project: test-nebula, version: 0.1.0-SNAPSHOT
Project version: 0.1.0-SNAPSHOT
Now, apply the plugin "scala" to the build and you'll see the problem:
plugins {
id 'base'
id 'scala' // <---- Apply the Scala plugin
id 'nebula.release' version '15.3.0'
}
defaultTasks 'printVersion'
release {
defaultVersionStrategy = versionStrategies.find { it.name == 'snapshot' }
}
task printVersion() {
doLast {
println "Project version: ${project.version}"
}
}
Output:
$ ./gradlew
> Configure project :
Inferred project: test-nebula, version: 0.1.0-dev.67.uncommitted+b52ad2f
> Task :printVersion
Project version: 0.1.0-dev.67.uncommitted+b52ad2f
This time the project version is no longer a SNAPSHOT version (as expected), the plugin uses the default versioning strategy.
Has this issue been notified before ? What am I doing wrong ?
Thanks for your insights.