[build] Cache Gradle downloads between CI runs#10986
Draft
jonathanpeppers wants to merge 3 commits intomainfrom
Draft
[build] Cache Gradle downloads between CI runs#10986jonathanpeppers wants to merge 3 commits intomainfrom
jonathanpeppers wants to merge 3 commits intomainfrom
Conversation
Add a shared `cache-gradle.yaml` template using the Cache@2 task to persist `~/.gradle/caches` between pipeline runs. This prevents transient DNS/network failures from breaking builds when resolving Maven Central dependencies (e.g. javaparser for java-source-utils). The cache key includes `Agent.OS`, `gradle-wrapper.properties`, and all `build.gradle` files, so it auto-invalidates on Gradle version or dependency changes. Used by all three build step templates (macOS, Linux, Windows) which covers Xamarin.Android, Xamarin.Android-PR, and dnceng-public pipelines. Context: https://learn.microsoft.com/azure/devops/pipelines/release/caching Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The external/Java.Interop submodule is not checked out when the cache step runs (submodules are initialized later during make jenkins). Use only the main repo gradle-wrapper.properties and build.gradle files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Write the submodule commit hash to a temp file before the cache step so the cache invalidates when Java.Interop is bumped (which may change its build.gradle dependencies). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Add a shared
cache-gradle.yamltemplate using the Cache@2 task to persist~/.gradle/cachesbetween pipeline runs. This prevents transient DNS/network failures from breaking builds when resolving Maven Central dependencies (e.g. javaparser for java-source-utils).The cache key includes
Agent.OS,gradle-wrapper.properties, and allbuild.gradlefiles, so it auto-invalidates on Gradle version or dependency changes.Used by all three build step templates (macOS, Linux, Windows) which covers Xamarin.Android, Xamarin.Android-PR, and dnceng-public pipelines.
Context: https://learn.microsoft.com/azure/devops/pipelines/release/caching