Commit 6234deb7 authored by Mike Prechtl's avatar Mike Prechtl
Browse files

Update build instructions and prerequisites

parent e1069432
......@@ -4,16 +4,21 @@ Prerequisites
In order to build the Open eCard project, some additional tools are needed.
Required dependencies are:
* Java JDK 7 or higher
Oracle JDK and OpenJDK are working correctly
* Java JDK 11 or higher - Oracle JDK and OpenJDK are working correctly (jlink is required for building modular runtime images)
* Maven in at least version 3.6.1
* Maven in at least version 3.0.3 for JRE builds and 3.1.1 for Android builds
https://maven.apache.org/download.html
* Git 1.7.11 or higher (older versions are probably also ok)
http://git-scm.com/downloads
Optional dependencies are:
* Java JDK 14 with the new jpackage tool for creating native packages (early-access builds are available)
https://jdk.java.net/jpackage/)
* Android SDK
The Android SDK dependent modules are built when the environment variable
ANDROID_HOME is set and points to the installation directory of the Android
......@@ -30,27 +35,69 @@ Optional dependencies are:
https://developer.android.com/tools/sdk/ndk/index.html
Prior to starting the build, all Git submodules must be initialized with the
following command, which must be issued form the project root:
$ git submodule update --init
Git submodule updates may also be necessary after pulling changes from the
remote repository. The `git status` command indicates when this is needed.
Native packages can be created with an early-access build of JDK-14 which contains the new jpackage tool. For this purpose, JDK-14 must be managed independently of other JDK versions. This can be done with Maven toolchains. For this purpose, a `toolchains.xml` file is required on the building machine. The default location of this file is `~/.m2/toolchains.xml`. It should look similar to this one (JDK paths must be adjusted):
```xml
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<!-- JDK toolchains -->
<toolchain>
<type>jdk</type>
<provides>
<version>14</version>
<vendor>OpenJDK</vendor>
<id>JavaSE-14</id>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/jdk-14/</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
<vendor>OpenJDK</vendor>
<id>JavaSE-11</id>
</provides>
<configuration>
<jdkHome>/usr/lib/jvm/java-11-openjdk-amd64/</jdkHome>
</configuration>
</toolchain>
</toolchains>
```
If native packages are not created on the building machine, the first toolchain is not required.
Build Sources
=============
A standard build is performed by the command:
$ mvn clean install
$ mvn clean install
In order to create Javadoc and source artifacts, perform the following command:
$ mvn clean javadoc:javadoc javadoc:jar source:jar install
$ mvn clean javadoc:javadoc javadoc:jar source:jar install
By default, only a modular runtime image is created. However, if the early-access build of JDK-14 with the new jpackage tool is added to the toolchains, a native application package can be created by using the property `desktop-package`:
$ mvn clean install -Ddesktop-package
Usually, the predefined package formats are used: dmg for Mac OS, deb for Linux and msi and exe for Windows. An additional property `jlink-jpackager.package-type` can replace the predefined format of the native application package (only for Mac and Linux). The possible formats are:
- dmg
- pkg
- deb
- rpm
A native package with the `pkg` format can be created by using the following command:
$ mvn clean install -Ddesktop-package -Djlink-jpackager.package-type=pkg
The developer has to make sure that all necessary packaging tools are installed. In case of Windows, msi and exe packages are built. For this purpose, two additional tools are required:
- [WiX toolset](https://wixtoolset.org/) - to create msi installers
- [Inno Setup](http://www.jrsoftware.org/isinfo.php) - to create exe installers (Path environment variable must be set)
Build Profiles
--------------
......@@ -61,7 +108,7 @@ performed and which artifacts are created.
Maven profiles are selected on the commandline by adding the -P option as
follows:
$ mvn -Pprofile1,profile2 <Maven goals>
$ mvn -Pprofile1,profile2 <Maven goals>
The following global profiles are defined:
......
......@@ -42,13 +42,13 @@ Finally, you can run the Open eCard App from command line:
Packaging
-----------
Native packages which are based on a modular runtime image can be built with the new [jpackage](https://openjdk.java.net/jeps/343) tool which is a candidate for JDK-14. Early-access builds are already [provided](https://jdk.java.net/jpackage/). Native packages for the Open eCard can be built by downloading the JDK-14 early-access build, referencing it as toolchain and by specifying the following profile:
Native packages which are based on a modular runtime image can be built with the new [jpackage](https://openjdk.java.net/jeps/343) tool which is a candidate for JDK-14. Early-access builds are already [provided](https://jdk.java.net/jpackage/). Native packages for the Open eCard can be built by downloading the JDK-14 early-access build, referencing it as toolchain and by specifying the following property:
$ mvn clean install -Pdesktop-package
$ mvn clean install -Ddesktop-package
By default, the packager will take the predefined package types, such as dmg for Mac OS and deb for Linux-based systems. The package type can be overridden for Mac and Linux packages by using the following user property:
$ mvn clean install -Pdesktop-package -Djlink-jpackager.package-type=<type>
$ mvn clean install -Ddesktop-package -Djlink-jpackager.package-type=<type>
Thereby, the following types are available:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment