This message was deleted.
# community-support
s
This message was deleted.
z
the reason I ask is the following issue Provide access to Gradle.StartParameter property value in a configuration cache compliant way Identifying every
Task
that is affected by this kind of property would not be feasible
v
I don't think so, but you can probably create a
ValueSource
instead to access the start parameters configuration cache safe. (If "not configuration cache compliant" meant that the value of the cache is used, no matter what the value would be now.)
Hm, no, you shouldn't even need that. If the Gradle properties given on the commandline changes, the configuration cache is always invalidated anyway.
In which way is the example from your issue not configuration cache safe?
Works like a charm here
You should probably also add that information to the ticket
z
my bad. Correct me if I’m wrong - but you’re saying that this code is working as intended. Modifying the start parameter invalidates the config cache causing a re-configuration, which results in correct builds. My issue is actually that I would want configuration to be skipped in this scenario and Gradle to just understand that the value of
Provider<T>
has changed at task execution time, and re-run any affected tasks if needed
v
my bad. Correct me if I’m wrong - but you’re saying that this code is working as intended. Modifying the start parameter invalidates the config cache causing a re-configuration, which results in correct builds.
Correct
My issue is actually that I would want configuration to be skipped in this scenario and Gradle to just understand that the value of
Provider<T>
has changed at task execution time, and re-run any affected tasks if needed
Still not sure what you mean. Any change in
-P
commandline arguments will invalidate the configuration cache entry. And if the value of that provider is a task input the task will rerun.
z
actually I’m seeing the config cache being re-used on a change the the CLI argument now
on
7.4.2
v
Not sure what you mean:
Copy code
$ gw --configuration-cache help
Configuration cache is an incubating feature.
Calculating task graph as no configuration cache is available for tasks: help
Welcome to Gradle 7.4.2.
Configuration cache entry stored.

$ gw --configuration-cache help
Configuration cache is an incubating feature.
Reusing configuration cache.
Welcome to Gradle 7.4.2.
Configuration cache entry reused.

$ gw --configuration-cache help -P foo=bar
Configuration cache is an incubating feature.
Calculating task graph as configuration cache cannot be reused because the set of Gradle properties has changed.
Welcome to Gradle 7.4.2.
Configuration cache entry stored.
z
if you check out https://gist.github.com/ZakTaccardi/a4e1b62b31a7e1069c309a2a169b1058#file-localpropertysupporttest-kt-L30 that was failing on an older version of gradle (don’t remember which one), but works with
7.4.2
v
Too long to read it now. But as you can see from my trivial example, the configuration cache is invalidated whenever Gradle properties change, which you said it does not for you.
👍 1