Skip to content

feat(build): Add support for remote Gradle build cache#4357

Merged
jamesarich merged 9 commits into
mainfrom
chore/hosted-buildcache
Jan 29, 2026
Merged

feat(build): Add support for remote Gradle build cache#4357
jamesarich merged 9 commits into
mainfrom
chore/hosted-buildcache

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

This commit introduces support for a remote Gradle build cache to accelerate build times.

A new helper function, getMeshProperty, has been added to settings.gradle.kts to read configuration values from environment variables, local.properties, or a new config.properties file, in that order of precedence.

The remote cache is configured using the following properties:

  • GRADLE_CACHE_URL
  • GRADLE_CACHE_USERNAME
  • GRADLE_CACHE_PASSWORD

If GRADLE_CACHE_URL is not set, the remote cache will be disabled. Builds will be pushed to the cache if it is enabled. The config.properties file has been updated with placeholders for these new settings.

This commit introduces support for a remote Gradle build cache to accelerate build times.

A new helper function, `getMeshProperty`, has been added to `settings.gradle.kts` to read configuration values from environment variables, `local.properties`, or a new `config.properties` file, in that order of precedence.

The remote cache is configured using the following properties:
- `GRADLE_CACHE_URL`
- `GRADLE_CACHE_USERNAME`
- `GRADLE_CACHE_PASSWORD`

If `GRADLE_CACHE_URL` is not set, the remote cache will be disabled. Builds will be pushed to the cache if it is enabled. The `config.properties` file has been updated with placeholders for these new settings.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@codecov

codecov Bot commented Jan 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (e46cb27) to head (40d2577).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4357   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          3       3           
  Lines         28      28           
  Branches       8       8           
=====================================
  Misses        28      28           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich marked this pull request as ready for review January 29, 2026 15:53
# Conflicts:
#	settings.gradle.kts
This commit introduces support for a remote Gradle build cache across all relevant GitHub Actions workflows to speed up build and test times.

### Key Changes:
- **Workflow Inputs:** Added optional `GRADLE_CACHE_URL`, `GRADLE_CACHE_USERNAME`, and `GRADLE_CACHE_PASSWORD` inputs to `release.yml`, `reusable-android-build.yml`, and `reusable-android-test.yml` to configure the remote cache.
- **Environment Variables:** These inputs are passed as environment variables to the build and test jobs, allowing Gradle to connect to the remote cache.
- **Secret Inheritance:** The `pull-request.yml` workflow was simplified by using `secrets: inherit` to pass necessary secrets to the reusable test workflow, improving maintainability.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit updates the remote build cache configuration in `settings.gradle.kts`.

If a remote cache URL is provided but credentials (username and password) are missing, the remote cache will now be explicitly disabled. This prevents the build from failing with 403 (Forbidden) errors when attempting to access the cache without proper authentication. A message is now printed to the console to inform the user about the missing credentials and the resulting deactivation of the remote cache.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich jamesarich added this pull request to the merge queue Jan 29, 2026
@jamesarich jamesarich removed this pull request from the merge queue due to a manual request Jan 29, 2026
This commit improves the remote build cache configuration in `settings.gradle.kts`.

The `GRADLE_CACHE_URL`, `GRADLE_CACHE_USERNAME`, and `GRADLE_CACHE_PASSWORD` properties are now trimmed of leading/trailing whitespace to prevent connection issues.

Additionally, the logging for the cache status has been refined to be more explicit about whether remote cache writing is enabled or disabled based on the presence of the URL and credentials.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich jamesarich merged commit fd3ad80 into main Jan 29, 2026
7 checks passed
@jamesarich jamesarich deleted the chore/hosted-buildcache branch January 29, 2026 19:43
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.

1 participant