Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arve0/gradle-configuration-cache
https://github.com/arve0/gradle-configuration-cache
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/arve0/gradle-configuration-cache
- Owner: arve0
- Created: 2024-09-30T05:31:13.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-05T09:17:55.000Z (15 days ago)
- Last Synced: 2024-11-05T10:27:18.816Z (15 days ago)
- Language: Kotlin
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minimal, reproducible example configuration cache caches all environment variables
Gradle configuration cache caches _all_ environment variables, not just the ones that are used in the build.
The behavior is unexpected.This example uses two environment variables:
- ENVIRONMENT which is [set to 'local' when running with gradle](app/build.gradle.kts#L46-50)
- SOME_ENV which is used by gradle## Reproducing the issue
```shell
export SOME_ENV=foo
./gradlew run
# Calculating task graph as no cached configuration is available for tasks: run
# I'm running in local environment
# SOME_ENV is 'foo'export SOME_ENV=bar
./gradlew run
# Reusing configuration cache.
# I'm running in local environment
# SOME_ENV is 'foo' <--- expected 'bar'# changing ENVIRONMENT bustes the configuration cache
# could also use --no-configuration-cache to get updated SOME_ENV
export ENVIRONMENT=prod
./gradlew run
# Calculating task graph as configuration cache cannot be reused because environment variable 'ENVIRONMENT' has changed.
# I'm running in prod environment
# SOME_ENV is 'bar' <--- ok after cache bust
```