Improve caching on Travis
Often changing files are removed to do not re-upload cache tarball
when no dependencies are changed.
Took after me other projects where it seems to work fine:
# More details on how to configure the Travis build
# https://docs.travis-ci.com/user/customizing-the-build/
-# Speed up build with travis caches
-cache:
- directories:
- - $HOME/.gradle/caches/
- - $HOME/.gradle/wrapper/
-
language: java
matrix:
@@ -27,3 +21,16 @@ install:
script:
- ./gradlew build testDownstream -PcheckJava6Compatibility --daemon -s -i && ./gradlew ciPerformRelease
+# Remove often changing files to prevent cache re-upload on no changes in dependencies
+before_cache:
+ - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
+ - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
+ - rm -fr $HOME/.gradle/caches/*/scripts/
+ - rm -fr $HOME/.gradle/caches/*/scripts-remapped/
+ - rm -fr $HOME/.gradle/caches/*/fileHashes/
+ - rm -fr $HOME/.gradle/caches/transforms-1/transforms-1.lock
+cache:
+ directories:
+ - $HOME/.gradle/caches/
+ - $HOME/.gradle/wrapper/
+
