From faf5c681de106f751ed9645d66c636cf68d04456 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Sat, 28 Oct 2017 15:13:40 +0200 Subject: [PATCH] Add script for online-cache building --- gradle/reprod/prepareCache.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 gradle/reprod/prepareCache.sh diff --git a/gradle/reprod/prepareCache.sh b/gradle/reprod/prepareCache.sh new file mode 100755 index 00000000..849692d0 --- /dev/null +++ b/gradle/reprod/prepareCache.sh @@ -0,0 +1,21 @@ +# Collects build artifacts that aren't present in the online cache +# into a subfolder that can be merged with the online cache +# This script isn't expected to function on OSX. + +set -e +set -x + +# Step one: copy all artifacts into subfolder under new name +rm -rf artifactCache +mkdir artifactCache +cd artifactCache +for f in $(find ../deps/repo -type f); do + cp $f $(sha256sum $f | cut -d' ' -f1) +done + +# Step two: remove all files that are already in the cache +for f in *; do + if wget -q --spider "https://www.johni0702.de/replaymod/artifact/$f"; then + rm $f + fi +done