admin管理员组文章数量:1125051
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.
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.
Share Improve this question edited 2 days ago jonrsharpe 122k30 gold badges264 silver badges472 bronze badges asked 2 days ago pixelpixel 26.4k39 gold badges166 silver badges283 bronze badges1 Answer
Reset to default 0I would reccommend the following solution:
- Have a standard version of that plugin defined in
gradle.properties
file (some.version=1.0.0). - Read it in the
pluginManagement
block
// kotlin
pluginManagement {
val someVersion = extra["some.version"] as String
println("========================================")
println("some version is: $someVersion.")
println("========================================")
}
- When necessary, you can change the property version by passing a value to the command line e.g.
./gradlew assemble -Psome.version=2.0.0
本文标签: How to temporarily override plugin version through command line in GradleStack Overflow
版权声明:本文标题:How to temporarily override plugin version through command line in Gradle? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736651934a1946160.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论