build: upgrade to Gradle 9.4.0 and optimize build performance#382
Closed
timothyfroehlich wants to merge 1 commit intomainfrom
Closed
build: upgrade to Gradle 9.4.0 and optimize build performance#382timothyfroehlich wants to merge 1 commit intomainfrom
timothyfroehlich wants to merge 1 commit intomainfrom
Conversation
This commit modernizes the oss-licenses-plugin for Gradle 9.4 compatibility and enables full support for the Gradle Build Cache. Key issues resolved: - Implicit Dependency Failures: Gradle 9.x enforces strict task graph validation. The redundant LicensesCleanUpTask was removed because it conflicted with generation tasks over the build directory. Standard 'clean' now handles this idiomatically. - Plugin Validation Errors: Modernized tasks to pass 'validatePlugins' by opting into @CacheableTask and implementing property normalization with @PathSensitive. - Technical Debt: Refactored artifact resolution to use the Lazy Provider API, addressing feedback from PR #365 and improving configuration phase performance. - Test Matrix: Modernized E2E tests to include AGP 9.0/9.1/9.2 and enabled strict configuration cache validation across the matrix. Closes #356, #300, #299, #246.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modernizes the
oss-licenses-pluginfor Gradle 9.4 compatibility and enables full support for the Gradle Build Cache.Key Technical Improvements:
Resolved Implicit Dependency Failures:
Gradle 9.x promotes 'Implicit Dependencies' to a hard failure. We identified a conflict where the custom
LicensesCleanUpTaskand the generation tasks were fighting over the build directory. Since the generated files reside within thebuild/directory, the standard Gradlecleantask (which deletes the entire folder) already handles this idiomatically. This PR removes the redundant cleanup logic, resolving the validation error (fixing oss-licenses-plugin fails clean build #356, Plugin com.google.android.gms.oss-licenses-plugin is not compatible with Gradle's configuration cache #300, and OSS Licences Plugin fails with Gradle 8.8 #299).Full Build Cache Support:
Formally opted-in to
@CacheableTaskforDependencyTaskandLicensesTask. We implemented strict property normalization using@PathSensitive(PathSensitivity.NONE)and@Nestedannotations to ensure the tasks are pure, relocatable functions (completing Support for Configuration cache #246).Refactored for Laziness:
Refactored artifact resolution to use the Gradle Provider API. This moves away from eager configuration and addresses technical debt identified in previous reviews, improving configuration phase performance.
Modernized E2E Test Matrix:
Expanded the test suite to include AGP 9.0 (Stable), 9.1 (RC), and 9.2 (Alpha). Enabled strict configuration cache validation (
problems=fail) across the entire 88-test matrix to ensure long-term stability.Closes #356, #300, #299, #246.