Last active
April 14, 2024 14:13
-
-
Save bigdaz/17bfe7dcdca71c0d70c880db1c535ac9 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
homeDir=build/HOME | |
# Initialize empty Gradle User Home with settings to run build, including Develocity access keys | |
echo "Initializing Gradle User Home directory at $homeDir" | |
mkdir -p $homeDir | |
cp ~/.gradle/gradle.properties $homeDir | |
cp -r ~/.gradle/develocity $homeDir | |
cp -r ~/.gradle/enterprise $homeDir | |
# Prime the build and HOME directory | |
./gradlew -g $homeDir --no-configuration-cache -Ddevelocity.deprecation.muteWarnings=true -Dscan.uploadInBackground=false help | |
caches='transforms groovy-dsl kotlin-dsl' | |
for cache in $caches | |
do | |
for buildCache in 'build-cache' 'no-build-cache' | |
do | |
echo "------------------------------------------------------------" | |
echo "Test caches/*/$cache removal with --$buildCache" | |
echo "------------------------------------------------------------" | |
killall -9 java | |
# git clean -dfx -e HOME -e cleanup-help.sh | |
echo "Removing $cache from $homeDir/caches" | |
rm -rf $homeDir/caches/*/$cache | |
rm -rf $homeDir/caches/$cache-* # Also remove the transforms for Gradle 8.7 | |
# Always remove the local build cache, since we are testing connection with remote build cache | |
rm -rf $homeDir/caches/build-cache-1 | |
./gradlew -Dscan.tag.remote-cache-experiment-$cache-$buildCache -g $homeDir --$buildCache --no-configuration-cache -Ddevelocity.deprecation.muteWarnings=true -Dscan.uploadInBackground=false help | |
echo "" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment