Javi
09/11/2025, 8:59 AMVampire
09/11/2025, 9:14 AMJavi
09/11/2025, 9:18 AMVampire
09/11/2025, 9:20 AMgradle.startParameter.projectProperties or if not there manually from gradle.properties file or if not there only then through providers.gradleProperty.Vampire
09/11/2025, 9:22 AMgradle.properties access probably is tracked already but makes the whole file a configuration cache input.Vampire
09/11/2025, 9:23 AMValueSource, because there only the result will be relevant for invalidating CC entries.Vampire
09/11/2025, 9:24 AMMikhail Lopatkin
09/11/2025, 9:27 AMJavi
09/11/2025, 9:31 AMStartParameterMikhail Lopatkin
09/11/2025, 9:32 AMVampire
09/11/2025, 9:35 AMFrom top of my head, I think I am doing exactly thatYou do, I looked at your code before writing π
Vampire
09/11/2025, 9:36 AMWhy do you need to reimplement the property lookup?He considers
gradle.properties files in project directories between startparameter and the gradleProperty providerVampire
09/11/2025, 9:37 AMgradleProperty does not deliver Gradle Propertys but Project Propertys and only those that are in the gradle.properites file of the root project (and startparameters, env variables, system properties), but not the ones from the project directories.Vampire
09/11/2025, 9:38 AMJavi
09/11/2025, 9:40 AMgradle.properties file if it was not in the root project or in parent projects or in the project itself. Additionally I added support to load local.properties
I would like a standard method with good defaults to fetch a property from:
β’ terminal
β’ environment variables
β’ .env files
β’ local.properties files
β’ gradle.properties files
Chaining those sources if the property is missing with good default priorities.Vampire
09/11/2025, 9:43 AMJavi
09/11/2025, 9:47 AMStartParameters be fixed before the final 9.1 release?Mikhail Lopatkin
09/11/2025, 10:14 AMwill StartParameters be fixed before the final 9.1 release?Can't promise that right now, but we'll make the decision later today. I'll keep you posted.
Mikhail Lopatkin
09/11/2025, 10:56 AMabstract class MyValueSource implements ValueSource<String, Params> {
interface Params extends ValueSourceParameters {
@Inject
StartParameter getStartParameter()
}
String obtain() {
parameters.startParameter.projectProperties["foo.bar"]
}
}
tasks.register("foo") {
def p = providers.of(MyValueSource) {}
doLast {
println(p.getOrNull())
}
}Rodrigo Oliveira
09/11/2025, 2:04 PMRodrigo Oliveira
09/11/2025, 2:05 PMJavi
09/11/2025, 2:07 PMJavi
09/11/2025, 3:59 PMWe all want, just Gradle refuses to do so. πIs there an open issue about that, or they have been closed?
Vampire
09/11/2025, 4:03 PMVampire
09/11/2025, 4:04 PMJavi
09/11/2025, 4:24 PM