cp ldk-java-sources.jar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"
cp ldk-java.jar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"
cp ldk-java-classes.jar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"
+ cp ldk-java-javadoc.jar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"
cd ldk-java-bins
if ! git diff --exit-code; then
mv "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"* ./
git checkout "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"
apt-get -y install diffoscope
diffoscope ldk-java-sources.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-sources.jar"
+ diffoscope ldk-java-javadoc.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-javadoc.jar"
diffoscope ldk-java-classes.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-classes.jar"
diffoscope ldk-java.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java.jar"
exit 1
fi
- name: Run Java Tests against built release jar
run: |
- mvn install:install-file -Dfile=ldk-java.jar -DgroupId=org.ldk -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
+ mvn install:install-file -Dfile=ldk-java.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
cd javatester
mvn package
java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
- name: Run Java Tests against built jar
run: |
mvn -DskipTests=true package
- mvn install:install-file -Dfile=target/ldk-java-1.0-SNAPSHOT.jar -DgroupId=org.ldk -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
+ mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
cd javatester
mvn package
java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-{x86_64,aarch64}.nativelib src/main/resources/
mvn clean
mvn -DskipTests=true package
- mvn install:install-file -Dfile=target/ldk-java-1.0-SNAPSHOT.jar -DgroupId=org.ldk -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
+ JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
+ mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
cd javatester
mvn package
java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
mkdir ziptmp
cd ziptmp
-unzip ../target/ldk-java-1.0-SNAPSHOT-sources.jar | grep inflating | awk '{ print $2 }' | sort > ../sources-zip-files.txt
-sed -i 's/#Fri Jan 01 00:.* UTC 2021/#Fri Jan 01 00:00:00 UTC 2021/' META-INF/maven/org.ldk/ldk-java/pom.properties
+unzip ../target/ldk-java-*-sources.jar | grep inflating | awk '{ print $2 }' | sort > ../sources-zip-files.txt
+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
touch -d "2021-01-01 00:00 UTC" $(cat ../sources-zip-files.txt)
-cat ../sources-zip-files.txt | zip -X@ ../ldk-java-sources.jar
+cat ../sources-zip-files.txt | grep -v nativelib | zip -X@ ../ldk-java-sources.jar
+rm ../target/ldk-java-*-sources.jar
cd ..
rm -r ziptmp
mkdir ziptmp
cd ziptmp
-unzip ../target/ldk-java-1.0-SNAPSHOT.jar | grep inflating | awk '{ print $2 }' | sort > ../classes-zip-files.txt
-sed -i 's/#Fri Jan 01 00:.* UTC 2021/#Fri Jan 01 00:00:00 UTC 2021/' META-INF/maven/org.ldk/ldk-java/pom.properties
+unzip ../target/ldk-java-*-javadoc.jar | grep inflating | awk '{ print $2 }' | sort > ../javadoc-zip-files.txt
+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'
+for ZIP in *.zip; do
+ mkdir ziptmptmp
+ cd ziptmptmp
+ unzip ../$ZIP | grep inflating | awk '{ print $2 }' | sort > ../../javadoc-zip-zip-files.txt
+ rm ../$ZIP
+ touch -d "2021-01-01 00:00 UTC" $(cat ../../javadoc-zip-zip-files.txt)
+ cat ../../javadoc-zip-zip-files.txt | zip -X@ ../$ZIP
+ cd ..
+ rm -r ziptmptmp
+done
+touch -d "2021-01-01 00:00 UTC" $(cat ../javadoc-zip-files.txt)
+cat ../javadoc-zip-files.txt | grep -v nativelib | zip -X@ ../ldk-java-javadoc.jar
+rm ../target/ldk-java-*-javadoc.jar
+cd ..
+rm -r ziptmp
+
+mkdir ziptmp
+cd ziptmp
+unzip ../target/ldk-java-*.jar | grep inflating | awk '{ print $2 }' | sort > ../classes-zip-files.txt
+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
sed -i 's/Built-By: .*/Built-By: ldk-deterministic-builds/' META-INF/MANIFEST.MF
touch -d "2021-01-01 00:00 UTC" $(cat ../classes-zip-files.txt)
cat ../classes-zip-files.txt | zip -X@ ../ldk-java.jar
if [ "$LDK_GARBAGECOLLECTED_GIT_OVERRIDE" = "" ]; then
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE=$(git describe --tag --dirty)
fi
+if [ "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:0:1}" != "v" ]; then
+ echo "Version tag should start with a v" > /dev/stderr
+ exit 1
+fi
cp "$1/lightning-c-bindings/include/lightning.h" ./
if [ "$(rustc --version --verbose | grep "host:")" = "host: x86_64-apple-darwin" ]; then
# OSX sed is for some reason not compatible with GNU sed
sed -i '' "s/TransactionOutputs/C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ/g" ./lightning.h
+ sed -i '' "s/^ <version>.*<\/version>/ <version>${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}<\/version>/g" pom.xml
else
sed -i "s/TransactionOutputs/C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ/g" ./lightning.h
+ sed -i "s/^ <version>.*<\/version>/ <version>${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}<\/version>/g" pom.xml
fi
echo "Creating Java bindings..."
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>org.ldk</groupId>
+ <groupId>org.lightningdevkit</groupId>
<artifactId>ldk-java</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.ldk</groupId>
+ <groupId>org.lightningdevkit</groupId>
<artifactId>ldk-java</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>0.0.100.1</version>
+
+ <name>LDK Java Bindings and Binaries</name>
+ <description>LDK Java Bindings and Release Binaries</description>
+ <url>https://lightningdevkit.org</url>
+
+ <licenses>
+ <license>
+ <name>MIT License</name>
+ <url>http://www.opensource.org/licenses/MIT</url>
+ </license>
+ <license>
+ <name>The Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <name>Lightning Dev Kit Developers</name>
+ <organization>LDK</organization>
+ <organizationUrl>https://github.com/lightningdevkit</organizationUrl>
+ </developer>
+ </developers>
+
+ <scm>
+ <connection>scm:git:https://github.com/lightningdevkit/ldk-garbagecollected.git</connection>
+ <url>https://github.com/lightningdevkit/ldk-garbagecollected</url>
+ </scm>
+
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
- <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
</properties>
<build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>