From: Matt Corallo Date: Wed, 25 Aug 2021 00:23:17 +0000 (+0000) Subject: Update pom.xml to comply with Maven Central requirements X-Git-Tag: v0.0.100.2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=0d5f55c8e63442f3f6ea379b390847123ac92a3d;p=ldk-java Update pom.xml to comply with Maven Central requirements --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 807a5fff..6ce2ef61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,19 +96,21 @@ jobs: 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 @@ -309,7 +311,9 @@ jobs: - 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 @@ -331,7 +335,8 @@ jobs: 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 diff --git a/build-release-jar.sh b/build-release-jar.sh index a1e405ad..de3bf629 100755 --- a/build-release-jar.sh +++ b/build-release-jar.sh @@ -16,17 +16,38 @@ faketime 2021-01-01 mvn -DskipTests=true package 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 diff --git a/genbindings.sh b/genbindings.sh index c7a06d5e..7e5588fa 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -49,13 +49,19 @@ set -e 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>/ ${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>/ ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}<\/version>/g" pom.xml fi echo "Creating Java bindings..." diff --git a/javatester/pom.xml b/javatester/pom.xml index 17ea0e1e..a5501a94 100644 --- a/javatester/pom.xml +++ b/javatester/pom.xml @@ -27,7 +27,7 @@ compile - org.ldk + org.lightningdevkit ldk-java 1.0-SNAPSHOT compile diff --git a/pom.xml b/pom.xml index f26ae43c..3972186a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,9 +4,38 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.ldk + org.lightningdevkit ldk-java - 1.0-SNAPSHOT + 0.0.100.1 + + LDK Java Bindings and Binaries + LDK Java Bindings and Release Binaries + https://lightningdevkit.org + + + + MIT License + http://www.opensource.org/licenses/MIT + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + Lightning Dev Kit Developers + LDK + https://github.com/lightningdevkit + + + + + scm:git:https://github.com/lightningdevkit/ldk-garbagecollected.git + https://github.com/lightningdevkit/ldk-garbagecollected + + org.junit.jupiter @@ -36,7 +65,6 @@ 1.8 1.8 - 3.2.1 @@ -44,7 +72,6 @@ org.apache.maven.plugins maven-source-plugin - ${maven-source-plugin.version} attach-sources @@ -54,6 +81,18 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + +