Reputation: 26441
I want to override a plugin version to test if it behaves correctly with the new version. Is there a way to pass it through the command line?
My settings.gradle.kts
:
pluginManagement {
val myPluginVersion = "0.1.2"
plugins {
id("com.example.myplugin") version myPluginVersion
}
}
It also should be possible for Dependabot to change this version permanently afterward.
Upvotes: 0
Views: 24
Reputation: 26441
I end up with the following solution:
settings.gradle.kts
:
var myPluginVersion = "0.1.2"
sbVersion = providers.gradleProperty("myPluginVersion").getOrElse(myPluginVersion)
plugins {
id("com.example.myplugin") version myPluginVersion
The key is to divide simple version assignment and conditional logic into two separate lines.
Then, Dependabot can parse the dependency version and bump it.
Upvotes: 0
Reputation: 374
I would reccommend the following solution:
gradle.properties
file (some.version=1.0.0).pluginManagement
block// kotlin
pluginManagement {
val someVersion = extra["some.version"] as String
println("========================================")
println("some version is: $someVersion.")
println("========================================")
}
./gradlew assemble -Psome.version=2.0.0
Upvotes: 0