Skip to content

Commit

Permalink
Cleanup (#650)
Browse files Browse the repository at this point in the history
* Improve reproducibility of builds by using digest on docker images
* Inline the manifest Multi-Release entry
* Remove unused files
* Switch the groupId to org.apache.maven.daemon and use maven parent pom
* Fix distribution
* Fix ITs
* Fix native build for windows
  • Loading branch information
gnodet authored Jun 15, 2022
1 parent e51416f commit 1327fe2
Show file tree
Hide file tree
Showing 21 changed files with 136 additions and 1,248 deletions.
2 changes: 1 addition & 1 deletion agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>0.8.1-SNAPSHOT</version>
</parent>
Expand Down
6 changes: 3 additions & 3 deletions build-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>0.8.1-SNAPSHOT</version>
</parent>
Expand All @@ -31,8 +31,8 @@
<name>Maven Daemon - Documentation Maven Plugin</name>

<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>

<roaster.version>2.23.2.Final</roaster.version>
<maven.plugin-tools.version>3.6.0</maven.plugin-tools.version>
Expand Down
4 changes: 2 additions & 2 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>0.8.1-SNAPSHOT</version>
</parent>
Expand All @@ -37,7 +37,7 @@

<dependencies>
<dependency>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-common</artifactId>
</dependency>
<dependency>
Expand Down
17 changes: 5 additions & 12 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>0.8.1-SNAPSHOT</version>
</parent>
Expand Down Expand Up @@ -61,7 +61,7 @@
<build>
<plugins>
<plugin>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-build-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
Expand Down Expand Up @@ -123,7 +123,9 @@
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
Expand Down Expand Up @@ -188,15 +190,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/resources/META-INF/MANIFEST.MF

This file was deleted.

6 changes: 3 additions & 3 deletions daemon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>0.8.1-SNAPSHOT</version>
</parent>
Expand All @@ -32,7 +32,7 @@

<dependencies>
<dependency>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-common</artifactId>
<exclusions>
<exclusion>
Expand All @@ -42,7 +42,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-native</artifactId>
</dependency>
<dependency>
Expand Down
17 changes: 11 additions & 6 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>0.8.1-SNAPSHOT</version>
</parent>
Expand All @@ -30,21 +30,26 @@
<packaging>pom</packaging>
<name>Maven Daemon - Distribution</name>

<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
</properties>

<dependencies>
<dependency>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-agent</artifactId>
</dependency>
<dependency>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-helper-agent</artifactId>
</dependency>
<dependency>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-client</artifactId>
</dependency>
<dependency>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon</artifactId>
</dependency>
</dependencies>
Expand All @@ -62,7 +67,7 @@
<goal>provision</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/mvnd-${project.version}-${os.detected.name}-${os.detected.arch}</outputDirectory>
<outputDirectory>${project.build.directory}/maven-mvnd-${project.version}-${os.detected.name}-${os.detected.arch}</outputDirectory>
</configuration>
</execution>
</executions>
Expand Down
8 changes: 4 additions & 4 deletions dist/src/main/provisio/maven-distro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</artifactSet>

<artifactSet to="/mvn/lib/ext">
<artifact id="org.mvndaemon.mvnd:mvnd-daemon:${project.version}">
<artifact id="org.apache.maven.daemon:mvnd-daemon:${project.version}">
<exclusion id="org.codehaus.plexus:plexus-classworlds"/>
<exclusion id="*:cdi-api"/>
<exclusion id="*:commons-cli"/>
Expand Down Expand Up @@ -71,11 +71,11 @@
<exclusion id="*:plexus-utils"/>
<exclusion id="*:plexus-container-default"/>
</artifact>
<artifact id="org.mvndaemon.mvnd:mvnd-client:${project.version}">
<artifact id="org.apache.maven.daemon:mvnd-client:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.mvndaemon.mvnd:mvnd-agent:${project.version}"/>
<artifact id="org.mvndaemon.mvnd:mvnd-helper-agent:${project.version}"/>
<artifact id="org.apache.maven.daemon:mvnd-agent:${project.version}"/>
<artifact id="org.apache.maven.daemon:mvnd-helper-agent:${project.version}"/>
</artifactSet>

<fileSet to="/">
Expand Down
2 changes: 1 addition & 1 deletion helper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>0.8.1-SNAPSHOT</version>
</parent>
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>0.8.1-SNAPSHOT</version>
</parent>
Expand All @@ -32,7 +32,7 @@
<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<mvnd.home>${project.basedir}/../dist/target/mvnd-${project.version}-${os.detected.name}-${os.detected.arch}</mvnd.home>
<mvnd.home>${project.basedir}/../dist/target/maven-mvnd-${project.version}-${os.detected.name}-${os.detected.arch}</mvnd.home>
<preinstall.artifacts>
org/apache/maven/surefire/surefire-providers/${surefire.version}
org/apache/maven/surefire/surefire-junit-platform/${surefire.version}
Expand All @@ -57,7 +57,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mvndaemon.mvnd</groupId>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-dist</artifactId>
<type>pom</type>
<scope>test</scope>
Expand Down
69 changes: 46 additions & 23 deletions native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ include Makefile.common

.PHONY: all package native native-all deploy crossbuild ducible clean-native

linux-armv6-digest:=@sha256:7bad6ab302af34bdf6634c8c2b02c8dc6ac932c67da9ecc199c549ab405e971e
linux-x86-digest:=@sha256:7a8fda5ff1bb436ac1f2e7d40043deb630800fce33d123d04779d48f85702dcd
windows-static-x86-digest:=@sha256:99d7069789560ef77a7504ead4a2b5e3c245cb45a45f964c74fecbf649398d3a
windows-static-x64-digest:=@sha256:f159861bc80b29e5dafb223477167bec53ecec6cdacb051d31e90c5823542100
cross-build-digest:=@sha256:8dbaa86462270db93ae1b1b319bdd88d89272faf3a68632daf4fa36b414a326e
freebsd-crossbuild-digest:=@sha256:cda62697a15d8bdc0bc26e780b1771ee78f12c55e7d5813e62c478af5a747c43
mcandre-snek-digest:=@sha256:9f84e9fcdf66daafc1f1c3fb772a6c97977714e17800aeac2e3bbe5dc5039dd0

all: package

MVNDNATIVE_OUT:=target/native-$(OS_NAME)-$(OS_ARCH)
Expand All @@ -36,11 +44,14 @@ download-includes: target
test -f target/inc/unix/jni_md.h || wget -O target/inc/unix/jni_md.h https://raw.githubusercontent.com/openjdk/jdk/jdk-11%2B28/src/java.base/unix/native/include/jni_md.h
test -f target/inc/windows/jni_md.h || wget -O target/inc/windows/jni_md.h https://raw.githubusercontent.com/openjdk/jdk/jdk-11%2B28/src/java.base/windows/native/include/jni_md.h

crossbuild: target
@test -d target || mkdir target
test -d target/crossbuild || git clone https://github.com/multiarch/crossbuild.git target/crossbuild
git -C target/crossbuild reset --hard d06cdc31fce0c85ad78408b44794366dafd59554
docker build target/crossbuild -t multiarch/crossbuild
dockcross: target
@test -d target/dockcross || mkdir target/dockcross

# This target does not generate the same image digest that the one uploaded
#crossbuild: target
# test -d target/crossbuild || git clone https://github.com/multiarch/crossbuild.git target/crossbuild
# git -C target/crossbuild reset --hard d06cdc31fce0c85ad78408b44794366dafd59554
# docker build target/crossbuild -t multiarch/crossbuild

ducible: target
test -d target/ducible || git clone --branch v1.2.2 https://github.com/jasonwhite/ducible.git target/ducible
Expand Down Expand Up @@ -81,57 +92,69 @@ $(NATIVE_DLL): $(MVNDNATIVE_OUT)/$(LIBNAME)
@mkdir -p $(NATIVE_TARGET_DIR)
cp $< $(NATIVE_TARGET_DIR)/$(LIBNAME)

linux-x86: download-includes
./docker/dockcross-linux-x86 bash -c 'make clean-native native OS_NAME=Linux OS_ARCH=x86'
target/dockcross/dockcross-linux-x86: dockcross
docker run --rm dockcross/linux-x86$(linux-x86-digest) > target/dockcross/dockcross-linux-x86
chmod +x target/dockcross/dockcross-linux-x86
linux-x86: download-includes target/dockcross/dockcross-linux-x86
target/dockcross/dockcross-linux-x86 bash -c 'make clean-native native OS_NAME=Linux OS_ARCH=x86'

linux-x86_64: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=x86_64-linux-gnu multiarch/crossbuild make clean-native native OS_NAME=Linux OS_ARCH=x86_64
-e CROSS_TRIPLE=x86_64-linux-gnu multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Linux OS_ARCH=x86_64

linux-arm: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=arm-linux-gnueabi multiarch/crossbuild make clean-native native OS_NAME=Linux OS_ARCH=arm
-e CROSS_TRIPLE=arm-linux-gnueabi multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Linux OS_ARCH=arm

linux-armv6:
./docker/dockcross-linux-armv6 bash -c 'make clean-native native CROSS_PREFIX=armv6-unknown-linux-gnueabihf- OS_NAME=Linux OS_ARCH=armv6'
target/dockcross/dockcross-linux-armv6: dockcross
docker run --rm dockcross/linux-armv6$(linux-armv6-digest) > target/dockcross/dockcross-linux-armv6
chmod +x target/dockcross/dockcross-linux-armv6
linux-armv6: download-includes target/dockcross/dockcross-linux-armv6
target/dockcross/dockcross-linux-armv6 bash -c 'make clean-native native CROSS_PREFIX=armv6-unknown-linux-gnueabihf- OS_NAME=Linux OS_ARCH=armv6'

linux-armv7: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=arm-linux-gnueabihf multiarch/crossbuild make clean-native native OS_NAME=Linux OS_ARCH=armv7
-e CROSS_TRIPLE=arm-linux-gnueabihf multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Linux OS_ARCH=armv7

linux-arm64: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=aarch64-linux-gnu multiarch/crossbuild make clean-native native OS_NAME=Linux OS_ARCH=arm64
-e CROSS_TRIPLE=aarch64-linux-gnu multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Linux OS_ARCH=arm64

linux-ppc64: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=powerpc64le-linux-gnu multiarch/crossbuild make clean-native native OS_NAME=Linux OS_ARCH=ppc64
-e CROSS_TRIPLE=powerpc64le-linux-gnu multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Linux OS_ARCH=ppc64

win-x86: download-includes
./docker/dockcross-windows-static-x86 bash -c 'make clean-native native CROSS_PREFIX=i686-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86'
target/dockcross/dockcross-windows-static-x86: dockcross
docker run --rm dockcross/windows-static-x86$(windows-static-x86-digest) > target/dockcross/dockcross-windows-static-x86
chmod +x target/dockcross/dockcross-windows-static-x86
win-x86: download-includes target/dockcross/dockcross-windows-static-x86
target/dockcross/dockcross-windows-static-x86 bash -c 'make clean-native native CROSS_PREFIX=i686-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86'

win-x86_64: download-includes
./docker/dockcross-windows-static-x64 bash -c 'make clean-native native CROSS_PREFIX=x86_64-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86_64'
target/dockcross/dockcross-windows-static-x64: dockcross
docker run --rm dockcross/windows-static-x64$(windows-static-x64-digest) > target/dockcross/dockcross-windows-static-x64
chmod +x target/dockcross/dockcross-windows-static-x64
win-x86_64: download-includes target/dockcross/dockcross-windows-static-x64
target/dockcross/dockcross-windows-static-x64 bash -c 'make clean-native native CROSS_PREFIX=x86_64-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86_64'

mac-x86: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=i386-apple-darwin multiarch/crossbuild make clean-native native OS_NAME=Mac OS_ARCH=x86
-e CROSS_TRIPLE=i386-apple-darwin multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Mac OS_ARCH=x86

mac-x86_64: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=x86_64-apple-darwin multiarch/crossbuild make clean-native native OS_NAME=Mac OS_ARCH=x86_64
-e CROSS_TRIPLE=x86_64-apple-darwin multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Mac OS_ARCH=x86_64

mac-arm64: download-includes
docker run -it --rm -v $$PWD:/src --user $$(id -u):$$(id -g) \
-e TARGET=arm64-apple-darwin mcandre/snek:darwin sh -c "make clean-native native CROSS_PREFIX=arm64-apple-darwin20.4- OS_NAME=Mac OS_ARCH=arm64"
-e TARGET=arm64-apple-darwin mcandre/snek$(mcandre-snek-digest) sh -c "make clean-native native CROSS_PREFIX=arm64-apple-darwin20.4- OS_NAME=Mac OS_ARCH=arm64"

freebsd-x86: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
empterdose/freebsd-cross-build:9.3 make clean-native native CROSS_PREFIX=i386-freebsd9- OS_NAME=FreeBSD OS_ARCH=x86
empterdose/freebsd-cross-build$(freebsd-crossbuild-digest) make clean-native native CROSS_PREFIX=i386-freebsd9- OS_NAME=FreeBSD OS_ARCH=x86

freebsd-x86_64: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
empterdose/freebsd-cross-build:9.3 make clean-native native CROSS_PREFIX=x86_64-freebsd9- OS_NAME=FreeBSD OS_ARCH=x86_64
empterdose/freebsd-cross-build$(freebsd-crossbuild-digest) make clean-native native CROSS_PREFIX=x86_64-freebsd9- OS_NAME=FreeBSD OS_ARCH=x86_64

#sparcv9:
# $(MAKE) native OS_NAME=SunOS OS_ARCH=sparcv9
Expand Down
Loading

0 comments on commit 1327fe2

Please sign in to comment.