5 # zips are not generally deterministic without some tweaking, which we do here.
7 echo "Checking that required release native libraries are present..."
8 ls src/main/resources/liblightningjni_Linux-amd64.nativelib
9 ls src/main/resources/liblightningjni_MacOSX-x86_64.nativelib
10 ls src/main/resources/liblightningjni_MacOSX-aarch64.nativelib
14 # We need to fetch dependencies first as faketime will break PKI cert checks!
15 mvn -DskipTests=true -Dorg.lightningdevkit.skipdocs=false package
17 faketime 2021-01-01 mvn -DskipTests=true -Dorg.lightningdevkit.skipdocs=false package
21 unzip ../target/ldk-java-*-sources.jar | grep inflating | awk '{ print $2 }' | sort > ../sources-zip-files.txt
22 sed -i 's/#Fri Jan 01 00:.* UTC 2021/#Fri Jan 01 00:00:00 UTC 2021/' META-INF/maven/org.lightningdevkit/ldk-java/pom.properties
23 touch -d "2021-01-01 00:00 UTC" $(cat ../sources-zip-files.txt)
24 cat ../sources-zip-files.txt | grep -v nativelib | zip -X@ ../ldk-java-sources.jar
25 rm ../target/ldk-java-*-sources.jar
31 unzip ../target/ldk-java-*-javadoc.jar | grep inflating | awk '{ print $2 }' | sort > ../javadoc-zip-files.txt
32 find . | grep '.html$' | xargs -L1 sed -i 's/Generated by javadoc \(.*\) on Fri Jan 01 .* UTC 2021/Generated by javadoc \1 on Fri Jan 01 00:00:00 UTC 2021/g'
36 unzip ../$ZIP | grep inflating | awk '{ print $2 }' | sort > ../../javadoc-zip-zip-files.txt
38 touch -d "2021-01-01 00:00 UTC" $(cat ../../javadoc-zip-zip-files.txt)
39 cat ../../javadoc-zip-zip-files.txt | zip -X@ ../$ZIP
43 touch -d "2021-01-01 00:00 UTC" $(cat ../javadoc-zip-files.txt)
44 cat ../javadoc-zip-files.txt | grep -v nativelib | zip -X@ ../ldk-java-javadoc.jar
45 rm ../target/ldk-java-*-javadoc.jar
51 unzip ../target/ldk-java-*.jar | grep inflating | awk '{ print $2 }' | sort > ../classes-zip-files.txt
52 sed -i 's/#Fri Jan 01 00:.* UTC 2021/#Fri Jan 01 00:00:00 UTC 2021/' META-INF/maven/org.lightningdevkit/ldk-java/pom.properties
53 sed -i 's/Built-By: .*/Built-By: ldk-deterministic-builds/' META-INF/MANIFEST.MF
54 touch -d "2021-01-01 00:00 UTC" $(cat ../classes-zip-files.txt)
55 cat ../classes-zip-files.txt | zip -X@ ../ldk-java.jar
56 cat ../classes-zip-files.txt | grep -v nativelib | zip -X@ ../ldk-java-classes.jar