Skip to content

Commit

Permalink
accessing start parameters in Gradle w/ CC not possible
Browse files Browse the repository at this point in the history
  • Loading branch information
wzieba committed Mar 1, 2024
1 parent 1aff0cf commit fa50895
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Gradle/accessing-some-properties-is-not-possible-with-cc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Accessing start parameters in Gradle plugin is impossible when using configuration cache

- Gradle forum conversation: https://discuss.gradle.org/t/is-there-a-way-to-get-up-to-date-gradle-start-parameters-with-configuration-cache/47806
- MCVE: https://github.com/wzieba/GetGradleConfigurationInPluginRepro

Currently, it's not possible to get up to date `org.gradle.StartParameter` in a Gradle plugin that uses configuration cache. The reason is that changing starting parameters, like `max-workers` or `configure-on-demand` is not **invalidating configuration cache**, so the parameters won't be updated in the runtime of the plugin.

The exception is `taskNames` as configuration cache is generated per requested tasks, so calling a diffrent set of tasks will either invalidate cache or cause Gradle to use configuration cache for these task (and return expected `taskNames`).

For this reason I've removed some parameters from Automattic's measure-builds plugin in https://github.com/Automattic/measure-builds-gradle-plugin/pull/35. It's better for us to reduce build times, than to measure not crucial parameters.

This problem exsists in other repositories as well, e.g. https://github.com/cdsap/Talaiot/issues/390
2 changes: 1 addition & 1 deletion Kotlin/ksp-migration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Migrating to KSP
# Migrating annotation processor to KSP

## How kapt and ksp differ?

Expand Down

0 comments on commit fa50895

Please sign in to comment.