adjusted the build process to generate the windows and mac executables when deployed

* generates windows and mac icon files using imagemagick
* generates the executables using maven plugins launch4j for windows and appbundle for mac
* renames the jar from (removes the -jar-with-dependencies suffix)
* creates a zip file from the mac app directory
This commit is contained in:
Stefan Dollase 2015-12-20 20:40:14 +01:00
parent d7c59337fc
commit aa7f93ee36
6 changed files with 87 additions and 5 deletions

View File

@ -2,18 +2,23 @@ language: java
jdk:
- oraclejdk8
install:
- mvn clean
- mvn install -DskipTests=true
- mvn clean package -DskipTests=true
before_deploy:
- bash scripts/before-deploy.sh
- bash scripts/create-windows-icon.sh
- bash scripts/create-mac-icon.sh
- mvn install -DskipTests=true
- bash scripts/rename-jar-file.sh
- bash scripts/zip-mac-app.sh
- export filename=$(bash scripts/get-amidst-filename.sh)
deploy:
provider: releases
api-key:
secure: QMXa1QpW+mlTLlxCbKOAWIRUi2cR+Y2vMQDlwiV8BoUyZchvTBR+stDYuEdxd2fK8/aSRUWEgfUhKMJ4cIZEOOwz/UA/1RQmzumbFLexwTwDXfkTfCcDQFLtzywVoep2P3s1lpheo4f1G3z2sZTCxO5yRnpd/sBtWnaq3j5uifYZB+mv84eH+EsrQL7f+0KjycOPrAdiJ8xh/2twUtGMhaStrnhcH+RCi6qm6D5Dv4mwYM4wRxG3H9i2NceGa6lHIE4bU+kKY9lc3V6EzmTnnShwEcrf+4/ZfCe4A9aU3jzFhKCHKpJ4PlqLEtMeQ08ijaMrF4LaBqwRZ5il5nqKkFdfKOtx7EHqjxrQ1dT7JUXU/3lTfEX/DLbhPa3z5Tl9LgCu9flCS+ltQoPvx7MR1leaQeHNoFCfzWJQ8ytW2CEhnOqx3nr4AIW8q5akJxQB7USfHV5F8kw2T6QmzuniQRZex+15j9SLedaDXZCvno6C0+j59sABpiF9lRVww8jW6BxqklxDcjEtkMxyHiBCG0EgGlKJvVSyGGzDsjb8FweC1KQKBHuG+5UYNE1rJesj6rwfIIrbInjJRTPndb4GpuzzbqbTGxwHd2zqzkQhnxSjCoKIzyhpBzfyCJaqTv/DfimSc95sXH1w1d6zfcO01MkopXYUSlHvr/Rjxh8vE8U=
file: "target/${filename}.jar"
file:
- "target/${filename}.jar"
- "target/${filename}.zip"
- "target/${filename}.exe"
skip_cleanup: true
on:
repo: stefandollase/AMIDST
branch: testing-releases
tags: true

64
pom.xml
View File

@ -115,6 +115,55 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>sh.tak.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
<version>1.0.4</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>bundle</goal>
</goals>
<configuration>
<mainClass>amidst.Amidst</mainClass>
<iconFile>${project.build.directory}/icon.icns</iconFile>
<jvmVersion>${jdk.version}+</jvmVersion>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.8</version>
<executions>
<execution>
<id>launch4j</id>
<phase>install</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<outfile>${project.build.directory}/${amidst.filename}.exe</outfile>
<jar>${project.build.directory}/${amidst.filename}-jar-with-dependencies.jar</jar>
<dontWrapJar>false</dontWrapJar>
<errTitle>Error in Launcher</errTitle>
<classPath>
<mainClass>amidst.Amidst</mainClass>
<addDependencies>false</addDependencies>
</classPath>
<icon>${project.build.directory}/icon.ico</icon>
<jre>
<minVersion>${jdk.version}.0</minVersion>
<initialHeapSize>512</initialHeapSize>
<maxHeapSize>1024</maxHeapSize>
</jre>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
@ -154,6 +203,21 @@
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<type>maven-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>sh.tak.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
<version>1.0.4</version>
<type>maven-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.8</version>
<type>maven-plugin</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,3 @@
#!/bin/bash
convert src/main/resources/amidst/icon.png target/icon.icns

View File

@ -0,0 +1,3 @@
#!/bin/bash
convert src/main/resources/amidst/icon.png target/icon.ico

7
scripts/zip-mac-app.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
filename="`source scripts/get-amidst-filename.sh`"
cd "target/${filename}/"
zip -r "${filename}.zip" "AMIDST.app/"
mv "${filename}.zip" ".."