Make Maven build compatible withe new BND build.
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 13 Nov 2021 07:16:16 +0000 (08:16 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 13 Nov 2021 07:16:16 +0000 (08:16 +0100)
15 files changed:
cnf/argeo.bnd
cnf/build.bnd
cnf/maven.bnd [new file with mode: 0644]
cnf/unstable.bnd
dep/cnf/build.bnd [deleted file]
dep/cnf/maven.bnd [new file with mode: 0644]
dep/pom.xml
dist/pom.xml
pom.xml
sdk/a2/.project [new file with mode: 0644]
sdk/a2/argeo-commons-upstream.target [new file with mode: 0644]
sdk/a2/build/.gitignore [new file with mode: 0644]
sdk/a2/upstream/.gitignore [new file with mode: 0644]
sdk/build.sh
sdk/configure.sh [new file with mode: 0644]

index 25ade707ec5bb5a3aa73cd529dddc77cf31943f8..f221de0c2f35d3692b3d1ad539cf3f6466719e51 100644 (file)
@@ -1,6 +1,5 @@
 # Common
 qualifier=.next
--include: -${workspace}/cnf/release.bnd
 
 Bundle-Version: ${version.released}${qualifier}
 Private-Package: *.internal.*
@@ -11,3 +10,5 @@ Export-Package: !*.internal.*; *
 -source true
 -removeheaders = Bnd-LastModified,Build-Jdk,Built-By,Tool,Created-By
 Automatic-Module-Name: ${bsn}
+SLC-Category=${category}
+-groupid=${category}
index dd0a48c27b467556edbb9ef701cecca5fffd4b9f..af9c91be7d16ae6c7acaec7b6fc6bf73060d539f 100644 (file)
@@ -1,6 +1,4 @@
 -include: \
 ${workspace}/cnf/unstable.bnd, \
-${workspace}/cnf/argeo.bnd
-
-SLC-Category: org.argeo.commons
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+${workspace}/cnf/argeo.bnd, \
+-${workspace}/cnf/release.bnd
diff --git a/cnf/maven.bnd b/cnf/maven.bnd
new file mode 100644 (file)
index 0000000..bbd72ad
--- /dev/null
@@ -0,0 +1,3 @@
+-include: \
+../cnf/unstable.bnd, \
+../cnf/argeo.bnd
index 0719f545ef2dbe75da611ff88c6cd252377f3a0a..db4fe1b0881ee46f31003949d338090df817869c 100644 (file)
@@ -1 +1,4 @@
-version.released=2.3.1
\ No newline at end of file
+category=org.argeo.commons
+version.released=2.3.1
+Bundle-RequiredExecutionEnvironment=JavaSE-11
+argeo.rpm.stagingRepository=/srv/rpmfactory/unstable/argeo-osgi-2/argeo
diff --git a/dep/cnf/build.bnd b/dep/cnf/build.bnd
deleted file mode 100644 (file)
index dcbfac9..0000000
+++ /dev/null
@@ -1 +0,0 @@
--include: ../../cnf/build.bnd
\ No newline at end of file
diff --git a/dep/cnf/maven.bnd b/dep/cnf/maven.bnd
new file mode 100644 (file)
index 0000000..4bd5c0c
--- /dev/null
@@ -0,0 +1 @@
+-include: ../../cnf/maven.bnd
\ No newline at end of file
index 0f0a97c46cbaf66c09ef602078d0e1c055b92794..3b991a5f1c273dc3cb53e8c6142011aaf8cad999 100644 (file)
        </modules>
        <build>
                <plugins>
+                       <plugin>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>properties-maven-plugin</artifactId>
+                               <configuration>
+                                       <quiet>true</quiet>
+                                       <files>
+                                               <file>../../cnf/unstable.bnd</file>
+                                       </files>
+                               </configuration>
+                       </plugin>
                        <plugin>
                                <groupId>org.apache.felix</groupId>
                                <artifactId>maven-bundle-plugin</artifactId>
index 898c8aa42a727853a866890173276453e7309e47..f1d24eee0996e0c9d2f50ec43829d55f999ea3ba 100644 (file)
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>org.argeo.commons</groupId>
                <module>argeo-node</module>
                <module>containers</module>
        </modules>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>properties-maven-plugin</artifactId>
+                               <configuration>
+                                       <quiet>true</quiet>
+                                       <files>
+                                               <file>../../cnf/unstable.bnd</file>
+                                       </files>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
 </project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 9b835da331a43da5e3eaa9f86264ef89b1bec779..42b0e1fa94843e5582c9a06febee25bb909d468d 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,6 @@
        <properties>
                <version.argeo-tp>2.1.27</version.argeo-tp>
                <!-- RPM -->
-               <argeo.rpm.stagingRepository>/srv/rpmfactory/unstable/argeo-osgi-2/argeo</argeo.rpm.stagingRepository>
                <project.scm.id>code.argeo.org</project.scm.id>
        </properties>
        <modules>
diff --git a/sdk/a2/.project b/sdk/a2/.project
new file mode 100644 (file)
index 0000000..f6bf2aa
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>argeo-commons-a2</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+       </buildSpec>
+       <natures>
+       </natures>
+</projectDescription>
diff --git a/sdk/a2/argeo-commons-upstream.target b/sdk/a2/argeo-commons-upstream.target
new file mode 100644 (file)
index 0000000..5539eee
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?>
+<target name="argeo-commons-upstream">
+       <locations>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.apache" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.apache.commons" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.apache.felix" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.apache.jackrabbit" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.bouncycastle" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.equinox" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.jackson" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.javax" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.jetty" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.misc" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.rap.e4" type="Directory"/>
+               <location path="${project_loc:argeo-commons-unstable}/sdk/a2/upstream/org.argeo.tp.sdk" type="Directory"/>
+       </locations>
+</target>
\ No newline at end of file
diff --git a/sdk/a2/build/.gitignore b/sdk/a2/build/.gitignore
new file mode 100644 (file)
index 0000000..f09a089
--- /dev/null
@@ -0,0 +1,2 @@
+*.*/
+index.xml
\ No newline at end of file
diff --git a/sdk/a2/upstream/.gitignore b/sdk/a2/upstream/.gitignore
new file mode 100644 (file)
index 0000000..f09a089
--- /dev/null
@@ -0,0 +1,2 @@
+*.*/
+index.xml
\ No newline at end of file
index 7a482932b084ce8679f686d664661c4a8da87a4c..4cfd55d276bd6bb10487b8e55e5cdfe4c56ea12d 100644 (file)
@@ -1,13 +1,22 @@
 #!/bin/bash
 
+# TODO source files and allow to override
+A2_CATEGORY=org.argeo.commons
+
 # Works on Fedora 34
 JVM=/usr/lib/jvm/jre-11/bin/java
 ECJ_JAR=/usr/share/java/ecj/ecj.jar
 OSGI_JAR=/usr/share/java/eclipse/osgi.jar
 
+SDK_DIR="$(cd "$(dirname "$0")"; pwd -P)"
+echo SDK: $SDK_DIR
+BUNDLES_BASEDIR="$(cd "$SDK_DIR/.."; pwd -P)"
+A2_UPSTREAM="$(cd "$SDK_DIR/a2/upstream"; pwd -P)"
+A2_BUILD="$(cd "$SDK_DIR/a2/build"; pwd -P)"
+
 echo PREPARING
 SOURCE_PATH=
-for bundle in ../*.*.*/ ; do
+for bundle in $BUNDLES_BASEDIR/*.*.*/ ; do
 echo $bundle
 # clean
 rm -rf $bundle/generated/*
@@ -18,12 +27,13 @@ SOURCE_PATH="$SOURCE_PATH $bundle/src[-d $bundle/bin]"
 done
 
 echo COMPILING
-$JVM -jar $ECJ_JAR @ecj.args -time -cp $OSGI_JAR:"$(printf %s: target/sdk-*-a2-target/*/*.jar)" $SOURCE_PATH 
+$JVM -jar $ECJ_JAR @$SDK_DIR/ecj.args -time -cp $OSGI_JAR:"$(printf %s: $A2_UPSTREAM/*/*.jar)" $SOURCE_PATH 
 
 echo PACKAGING
-bnd build
+bnd -b $SDK_DIR build
 
-mkdir -p target/a2/org.argeo.commons
-cp ../*/generated/*.jar target/a2/org.argeo.commons
+mkdir -p $A2_BUILD/$A2_CATEGORY
+mv $BUNDLES_BASEDIR/*/generated/*.jar $A2_BUILD/$A2_CATEGORY
+bnd index -d $A2_BUILD/ */*.jar
 
-echo DONE
\ No newline at end of file
+echo DONE
diff --git a/sdk/configure.sh b/sdk/configure.sh
new file mode 100644 (file)
index 0000000..ed8576d
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+SDK_DIR="$(cd "$(dirname "$0")"; pwd -P)"
+A2_UPSTREAM="$(cd "$SDK_DIR/a2/upstream"; pwd -P)"
+
+
+mvn -f $SDK_DIR clean assembly:single -Pa2-provided
+rsync -rv $SDK_DIR/target/sdk-*-a2-provided/ $A2_UPSTREAM
+bnd index -d $A2_UPSTREAM/ */*.jar
+