Skip to content

Commit fc58943

Browse files
committed
Fix reproducible build script to properly build source & javadoc jars for grails-gradle projects
1 parent e601223 commit fc58943

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

etc/bin/test-reproducible-builds.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ set -e
2121

2222
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
2323

24+
CWD=$(pwd)
2425
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
2526
cd "${SCRIPT_DIR}/../.."
2627

@@ -29,19 +30,24 @@ mkdir -p "${SCRIPT_DIR}/results"
2930

3031
git clean -xdf --exclude='etc/bin'
3132
killall -e java || true
33+
cd grails-gradle
34+
./gradlew build --rerun-tasks -PskipTests --no-build-cache
35+
cd ..
3236
./gradlew build --rerun-tasks -PskipTests --no-build-cache
3337
"${SCRIPT_DIR}/generate-build-artifact-hashes.groovy" > "${SCRIPT_DIR}/results/first.txt"
3438
mkdir -p "${SCRIPT_DIR}/results/first"
3539
find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -print0 | xargs -0 cp --parents -t "${SCRIPT_DIR}/results/first/"
3640

3741
git clean -xdf --exclude='etc/bin'
3842
killall -e java || true
43+
cd grails-gradle
44+
./gradlew build --rerun-tasks -PskipTests --no-build-cache
45+
cd ..
3946
./gradlew build --rerun-tasks -PskipTests --no-build-cache
4047
"${SCRIPT_DIR}/generate-build-artifact-hashes.groovy" > "${SCRIPT_DIR}/results/second.txt"
4148
mkdir -p "${SCRIPT_DIR}/results/second"
4249
find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -print0 | xargs -0 cp --parents -t "${SCRIPT_DIR}/results/second/"
4350

44-
cd -
4551
cd "${SCRIPT_DIR}/results"
4652

4753
# diff -u first.txt second.txt
@@ -61,4 +67,4 @@ find second -type f -name '*.jar' -print | sed 's|^second/||' | grep -F -x -v -f
6167
done
6268
rm toPurge.txt
6369
find . -type d -empty -delete
64-
cd -
70+
cd "$CWD"

0 commit comments

Comments
 (0)