Slackbot
08/21/2023, 5:05 PMMiles Peele
08/21/2023, 5:07 PMtasks.register<JavaExec>("encryptKey") {
onlyIf {
project.hasProperty("key")
}
args(project.property("key"))
}
onlyIf
is only executed in the execution phase, but the configuration of the task happens during a IDE sync. If the key
property doesn't exist, the Project.property
throws.
Is there a Provider
specifically for project properties? Or should I create a generic one like:
project.provider { project.property("key") }
My understanding is that Provider.get()
will be called during execution timeEric Haag
08/21/2023, 5:11 PMproviders.gradleProperty(...)
to get a Provider
whose value is the property value.Miles Peele
08/21/2023, 5:49 PMgradleProperty
look at properties passed by -P
? The docs seem to suggest it's a gradle property from like gradle.properties
Eric Haag
08/21/2023, 6:40 PM-P
as well.Miles Peele
08/23/2023, 6:26 PMEric Haag
08/23/2023, 6:29 PM