feat[oss-licenses]: Add full Gradle Configuration Cache support#365
Merged
timothyfroehlich merged 12 commits intogoogle:mainfrom Mar 3, 2026
Merged
feat[oss-licenses]: Add full Gradle Configuration Cache support#365timothyfroehlich merged 12 commits intogoogle:mainfrom
timothyfroehlich merged 12 commits intogoogle:mainfrom
Conversation
* Update Android Gradle Plugin to 9.0.1 * Update Gradle Wrapper to 9.3.1 * Update Kotlin plugin to 2.3.10 * Update Protobuf, Guava, Truth, and Gson * Bump version to 0.10.11-SNAPSHOT
* Remove `markNotCompatibleWithConfigurationCache` from `OssLicensesPlugin` * Add `testConfigurationCache` to `EndToEndTest` to verify cache reuse * Suppress Protobuf security warnings in `gradle.properties` caused by AGP dependencies
* Refactor `DependencyUtil` to resolve artifacts using `ArtifactView` and `ArtifactResolutionQuery` instead of accessing `ResolvedConfiguration` directly. * Pass resolved artifacts as inputs to `LicensesTask` via a new `artifactFiles` property to avoid project access during execution. * Add `ArtifactFiles` data class to hold resolved POM and library files. * Update `OssLicensesPlugin` to provide lazy artifact resolution. * Update `EndToEndTest` to verify configuration cache compatibility.
xyarco
previously approved these changes
Mar 3, 2026
rlazo
previously approved these changes
Mar 3, 2026
...enses-plugin/src/main/groovy/com/google/android/gms/oss/licenses/plugin/ArtifactFiles.groovy
Outdated
Show resolved
Hide resolved
...lugin/src/test/java/com/google/android/gms/oss/licenses/plugin/DependencyResolutionTest.java
Outdated
Show resolved
Hide resolved
This commit updates the copyright headers for all modified Google-owned source files to include the 2026 year range, as per Google's open-source policy. For files missing headers, the original publication year was retrieved from Git history and used as the start of the range.
1aff4c7 to
3404aa1
Compare
xyarco
approved these changes
Mar 3, 2026
Closed
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.
Description
This PR introduces full support for Gradle's Configuration Cache to the
oss-licenses-plugin, allowing for significant build speed improvements in subsequent runs.Key Architectural Changes
Unified Lazy Dependency Resolution:
DependencyUtil.groovyto perform artifact resolution during the configuration phase instead of the execution phase.ArtifactViewandArtifactResolutionQueryagainst the variant'sruntimeConfiguration.Provider.LicensesTaskvia a new@Inputproperty (MapProperty<String, ArtifactFiles> artifactFiles), ensuring the task remains a pure, cacheable function.Test Infrastructure & Parallelization:
EndToEndTest.ktto remove the previous@Parameterizedsetup. The tests are now "unrolled" into concrete subclasses, allowing Gradle to execute them in parallel, significantly reducing CI time.build.gradle.ktswhere thetesttask'sdoFirstclosure was capturing the Gradle script object, which blocked configuration caching.DependencyResolutionTest.javato programmatically verify that the resolution engine correctly handles version conflicts, transitives, and scoped dependencies.testAbsentDependencyReportto verify correct fallback behavior on debug variants where the AGP dependency report is absent.Version & Tooling:
0.11.0for release.9.0.1and Gradle Wrapper to9.3.1.Related Changes
ArtifactFiles.groovydata class.