Skip to content

Add support for Gradle configuration cache#495

Merged
LouisCAD merged 2 commits into
mainfrom
support-gradle-configuration-cache
Jan 23, 2022
Merged

Add support for Gradle configuration cache#495
LouisCAD merged 2 commits into
mainfrom
support-gradle-configuration-cache

Conversation

@LouisCAD

Copy link
Copy Markdown
Member

🚀 Description

This PR replaces calls to gradle.buildFinished with an AutoCloseable BuildService,
and marks the versions.properties file as used at configuration time,
so configuration is invalidated if its content changes, letting dependency updates
be applied if any.

However, this PR doesn't make refreshVersions own tasks compatible with
Gradle configuration cache, because it's almost impossible to do so.
Thankfully, this is not a big deal since that doesn't prevent the tasks from
completing, and having configuration cache enabled for the main refreshVersions
task wouldn't be helpful anyway since it modifies the versions.properties file,
which invalidates the configuration cache anyway.

📄 Motivation and Context

Allow host projects to use configuration cache.

Closes #228

🧪 How Has This Been Tested?

Tested extensively in sample-kotlin and sample-multi-modules locally.

Also, the check-build GitHub Action will now run the check task with the --configuration-cache option.

This commit replaces calls to gradle.buildFinished with an AutoCloseable BuildService,
and marks the versions.properties file as used at configuration time,
so configuration is invalidated if its content changes, letting dependency updates
be applied if any.

However, this commit doesn't make refreshVersions own tasks compatible with
Gradle configuration cache, because it's almost impossible to do so.
Thankfully, this is not a big deal since that doesn't prevent the tasks from
completing, and having configuration cache enabled for the main refreshVersions
task wouldn't be helpful anyway since it modifies the versions.properties file,
which invalidates the configuration cache anyway.
@LouisCAD LouisCAD added this to the v1.0.0 milestone Jan 23, 2022
@LouisCAD LouisCAD self-assigned this Jan 23, 2022
@LouisCAD
LouisCAD merged commit 8e62839 into main Jan 23, 2022
@LouisCAD
LouisCAD deleted the support-gradle-configuration-cache branch January 23, 2022 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Gradle configuration cache

1 participant