]> git.bitcoin.ninja Git - ldk-java/commitdiff
Update pom.xml to comply with Maven Central requirements
authorMatt Corallo <git@bluematt.me>
Wed, 25 Aug 2021 00:23:17 +0000 (00:23 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 25 Aug 2021 19:42:29 +0000 (19:42 +0000)
.github/workflows/build.yml
build-release-jar.sh
genbindings.sh
javatester/pom.xml
pom.xml

index 807a5fff987ef25cedf9d989c7e84f740a17726f..6ce2ef61808ea68f682fff6a1c94f83aebd7d6cd 100644 (file)
@@ -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
index a1e405ad400de503321778af70d3e680916ce6dd..de3bf6294c44b3a1e8758e707c4d39f8103771e8 100755 (executable)
@@ -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
index c7a06d5e18a53554e3b2e166525ed05ef7d2ea44..7e5588fa21058f891cc245b46863000e4b272e2f 100755 (executable)
@@ -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>.*<\/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..."
index 17ea0e1ead282d836596af3efc96de5d898ed64e..a5501a949f1c3dff9f4a9f9602789d050bbe6a04 100644 (file)
@@ -27,7 +27,7 @@
             <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>
diff --git a/pom.xml b/pom.xml
index f26ae43c7a7f0587a97c7efa9c518066c6feb777..3972186a6a04753f6a7f61bc9b2b9944c93c6563 100644 (file)
--- 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">
     <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>
@@ -36,7 +65,6 @@
     <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>
@@ -44,7 +72,6 @@
             <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>