Skip to content

Commit

Permalink
#22: adds first try for building a deb package on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
rladstaetter committed Oct 22, 2022
1 parent 946d0e0 commit 71b9b83
Show file tree
Hide file tree
Showing 2 changed files with 200 additions and 2 deletions.
197 changes: 197 additions & 0 deletions dist/dist-linux/installer-linux/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>app.logorrr.dist.osx</groupId>
<artifactId>dist-linux</artifactId>
<version>${revision}${changelist}</version>
</parent>

<artifactId>installer-linux</artifactId>
<name>app.logorrr.dist.linux.installer</name>

<dependencies>
<dependency>
<groupId>app.logorrr</groupId>
<artifactId>app</artifactId>
</dependency>
<dependency>
<groupId>app.logorrr.dist.repackaged</groupId>
<artifactId>dist-repackaged</artifactId>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>icon/**</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs/</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>compile</includeScope>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- delete java rt in any case (otherwise build exits with error later) -->
<execution>
<id>delete-javart</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete dir="${project.build.directory}/java-rt"/>
<delete dir="${project.build.directory}/app-tmp-image"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>step-1-create-custom-jre</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${jdk.jlink.binary}</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<environmentVariables>
<JAVA_HOME>${jdk.home}</JAVA_HOME>
</environmentVariables>
<arguments>
<argument>--strip-native-commands</argument>
<argument>--no-header-files</argument>
<argument>--no-man-pages</argument>
<argument>--compress=2</argument>
<argument>--strip-debug</argument>
<argument>--add-modules</argument>
<argument>jdk.crypto.ec,jdk.localedata,java.base,java.desktop,jdk.jfr,java.logging,jdk.unsupported</argument>
<argument>--include-locales=en</argument>
<argument>--output</argument>
<argument>java-rt</argument>
</arguments>
</configuration>
</execution>
<!-- create application image -->
<execution>
<id>step-2-create-unsigned-app</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${jdk.jpackage.binary}</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<environmentVariables>
<JAVA_HOME>${jdk.home}</JAVA_HOME>
</environmentVariables>
<arguments>
<argument>--verbose</argument>
<argument>--name</argument>
<argument>LogoRRR</argument>
<argument>--app-version</argument>
<argument>${revision}</argument>
<argument>--resource-dir</argument>
<argument>classes/res/</argument>
<argument>--vendor</argument>
<argument>logorrr.app</argument>
<argument>--description</argument>
<argument>LogoRRR is a log file visualisation app, see https://www.logorrr.app/ </argument>
<argument>--copyright</argument>
<argument>Copyright 2021-2022 www.logorrr.app</argument>
<argument>--type</argument>
<argument>app-image</argument>
<argument>--runtime-image</argument>
<argument>java-rt</argument>
<argument>--input</argument>
<argument>libs</argument>
<argument>--main-class</argument>
<argument>${main.launcher.class}</argument>
<argument>--main-jar</argument>
<argument>app-${project.version}.jar</argument>
<argument>--java-options</argument>
<argument>-Xmx4096m</argument>
<argument>--dest</argument>
<argument>app-tmp-image</argument>
<argument>--verbose</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>step-4-create-pkg</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${jdk.jpackage.binary}</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<environmentVariables>
<JAVA_HOME>${jdk.home}</JAVA_HOME>
</environmentVariables>
<arguments>
<argument>--verbose</argument>
<argument>--name</argument>
<argument>LogoRRR</argument>
<argument>--app-image</argument>
<argument>app-tmp-image/LogoRRR.app</argument>
<argument>--mac-package-name</argument>
<argument>LogoRRR</argument>
<argument>--app-version</argument>
<argument>${revision}</argument>
<argument>--resource-dir</argument>
<argument>classes/res/</argument>
<argument>--vendor</argument>
<argument>logorrr.app</argument>
<argument>--description</argument>
<argument>LogoRRR is a log file visualisation app, see https://www.logorrr.app/</argument>
<argument>--copyright</argument>
<argument>Copyright 2021-2022 www.logorrr.app</argument>
<argument>--license-file</argument>
<argument>${basedir}/../../../LICENSE</argument>
<argument>--type</argument>
<argument>deb</argument>
<argument>--dest</argument>
<argument>installer</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
5 changes: 3 additions & 2 deletions dist/dist-linux/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<packaging>pom</packaging>
<description>Distribution bundle for Linux</description>

<!-- todo -->

<modules>
<module>installer-linux</module>
</modules>

</project>

0 comments on commit 71b9b83

Please sign in to comment.