Skip to content

Project properties not used at configuration time can still invalidate configuration cache #20969

@mathjeff

Description

@mathjeff

Expected Behavior

It would be helpful if changes to unused Gradle properties didn't invalidate the configuration cache

Current Behavior

In AndroidX we're finding that changes to Gradle properties that aren't used at configuration time can still invalidate the configuration cache.

Also interesting, we're finding that Gradle properties that aren't used at all can still invalidate the configuration cache ( repro at https://github.com/mathjeff/gradle-samples/tree/master/configuration-cache-unused-property )

Context

We have a feature ( #13753 ) that changes some properties of some Gradle tasks, and we'd like it to be possible to avoid reconfiguring all projects and instead to just reread the new property value during task execution.

This issue looks closely related to #20873 ; if there were a convenient way to exempt a specific Gradle property from invalidating the configuration cache, that would work too.

In the meanwhile we might end up switching from a gradle property to an environment variable, which appears to not invalidate the configuration cache, see https://android-review.googlesource.com/c/platform/frameworks/support/+/2120272

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions