Bernhard Posselt
08/19/2024, 10:43 AMabstract class ChangeModuleVersion : DefaultTask() {
@Input
val moduleVersion: Provider<String> = project.objects.property<String>()
and registered like this:
tasks.register<ChangeModuleVersion>("changeModuleVersion")
how do I pass I pass the parameter to the task, because ./gradlew changeModuleVersion -PmoduleVersion=0.0.1 gives me a property 'moduleVersion' doesn't have a configured value.Jendrik Johannes
08/19/2024, 10:47 AM-P (it's like a global parameter for the build)
In your example, you probably want to connect theses two:
tasks.register<ChangeModuleVersion>("changeModuleVersion") {
moduleVersion = providers.gradleProperty("moduleVersion")
}Bernhard Posselt
08/19/2024, 10:49 AMJendrik Johannes
08/19/2024, 10:51 AMmoduleVersion to be something you configure via command line -PmoduleVersion=... is the right way to do it. And then link that to some task as in the snippet I posted.
What does the changeModuleVersion task do?Bernhard Posselt
08/19/2024, 10:52 AMJendrik Johannes
08/19/2024, 10:54 AMmodule.json file a source file in Git?Bernhard Posselt
08/19/2024, 10:54 AMBernhard Posselt
08/19/2024, 10:55 AMBernhard Posselt
08/19/2024, 10:57 AMJendrik Johannes
08/19/2024, 11:00 AM@Internal
val moduleVersion: Property<String>
...and not @Input
(but it makes no difference as long as there is no @Output... defined)Bernhard Posselt
08/19/2024, 11:00 AM