-
-
Notifications
You must be signed in to change notification settings - Fork 27
Development
This page describes how to work with the source code and how to build the application for yourself.
In order to build the application for yourself you need OpenJDK 10, which is provided by AdoptOpenJDK and Azul Systems.
Besides this it is recommended to use an IDE, that supports Java 10. A project for IntelliJ IDEA is provided in the project repository but an import into Netbeans and Eclipse should also be possible.
In case you don't use an IDE, you also need to install Apache Maven. Most IDE's already provide Apache Maven. Therefore a separate installation is not strictly necessary.
You should be able to compile the application on Windows systems. But the creation of application bundles (that contain the OpenJDK runtime environment) most probably won't work. Currently the easiest solution to create the application bundles on Windows systems should be a separate Linux installation in a VirtualBox or VMWare. Maybe creating the application bundles through Cygwin also works.
You should be able to compile the application on macOS systems. But in order to create an application bundle (that contains the OpenJDK runtime environment)
- for Linux systems, you'll need to install makeself on your system.
- for Windows systems, you'll need to install p7zip on your system.
If you like to sign the compiled JAR files, you also need GnuPG.
The dependencies are available through Homebrew (see formulas for p7zip, makeself, gnupg and maven). They can be installed via:
brew install p7zip makeself gnupg maven
You should be able to compile the application on Linux systems. But in order to create an application bundle (that contains the OpenJDK runtime environment) you should install the following packages from your distribution:
- Creating application bundles for Linux systems requires makeself.
- Creating application bundles for Windows systems requires p7zip.
If you like to sign the compiled JAR files, you also need GnuPG.
The dependencies should be packages by your Linux distribution - e.g. on Debian / Ubuntu you can install them via:
apt-get install makeself p7zip gnupg maven
In order to create cross platform application bundles we need to obtain OpenJDK for each supported target platform. Unfortunately there is no easy solution available for this task yet. Therefore we've added some bash scripts in the folder release/share/openjdk
.
-
init-linux32.sh
downloads OpenJDK for Linux i686 and creates a OpenJDK runtime environment in therelease/share/openjdk/runtime/linux32
folder -
init-linux64.sh
downloads OpenJDK for Linux x86_64 and creates a OpenJDK runtime environment in therelease/share/openjdk/runtime/linux64
folder -
init-mac64.sh
downloads OpenJDK for macOS and creates a OpenJDK runtime environment in therelease/share/openjdk/runtime/mac64
folder -
init-windows32.sh
downloads OpenJDK for Windows 32bit and creates a OpenJDK runtime environment in therelease/share/openjdk/runtime/windows32
folder -
init-windows64.sh
downloads OpenJDK for Windows 64bit and creates a OpenJDK runtime environment in therelease/share/openjdk/runtime/windows64
folder
These scripts only have to be executed once for each target platform. The created OpenJDK runtime environments in the release/share/openjdk/runtime
folder are used for future packaging.
In order to clean up the whole project folder you might start mvn-clean.sh
or enter mvn clean
on the command line from the root folder of the repository. IDE's like IntelliJ IDEA, Netbeans or Eclipse should also provide additional ways to execute this task.
In order to compile the application you might start mvn-install.sh
or enter mvn clean install
on the command line root folder of the repository. IDE's like IntelliJ IDEA, Netbeans or Eclipse should also provide additional ways to execute this task.
Compiled JAR files and all dependencies are written into the release/target/modules
folder.
In order to prepare the application for release you might start mvn-release.sh
or enter mvn -Popenindex-release clean install
on the command line from the root folder of the repository. IDE's like IntelliJ IDEA, Netbeans or Eclipse should also provide additional ways to execute this task.
By default Maven tries to sign the created JAR files. To make this work, you need to install GnuPG, create a keypair and register its name in Maven's settings.xml
:
<profiles>
<profile>
<id>openindex-release</id>
<properties>
<gpg.keyname>0x12345678</gpg.keyname>
</properties>
</profile>
</profiles>
Alternatively you can disable JAR signing by setting the property <gpg.skip>true</gpg.skip>
in the project's pom.xml
.
After the release was prepared, you can create the application bundles for the different target platforms by executing these scripts in the release
folder:
-
bundle-linux.sh
creates the application bundles for Linux i686 & x86_64 in therelease/target
folder -
bundle-mac.sh
creates the application bundles for macOS in therelease/target
folder -
bundle-windows.sh
creates the application bundles for Windows 32bit & 64bit in therelease/target
folder
In order to make the application easily startable for your customers on macOS, you need to sign it with a Developer ID (see also Developer ID and Gatekeeper). You can obtain a Developer ID by participating on the Apple Developer Program, which currently costs 99 USD per year for individuals.
After you've joined the Apple Developer Program you can register the application under a certain identifier - e.g. com.mycompany.support.*
. Put this identifier into the application bundle:
-
Edit
release/src/macos/Customer.app/Contents/Info.plist
and enter your identifier into<key>CFBundleIdentifier</key> <string>com.mycompany.support.customer</string>
-
Edit
release/src/macos/Staff.app/Contents/Info.plist
and enter your identifier into<key>CFBundleIdentifier</key> <string>com.mycompany.support.staff</string>
You might also want change the values for CFBundleName
and CFBundleDisplayName
in the Info.plist
files.
Afterwards edit [release/codesign-mac.sh
]https://github.com/OpenIndex/RemoteSupportTool/blob/develop/release/codesign-mac.sh and place the name of your development certificate provided by Apple in the KEY
variable, e.g.:
KEY="Developer ID Application: John Smith (1234567890)"
You can obtain the name of the certificate from the Keychain Access utility (Applications -> Utilities).
After preparing the application for release and launching release/bundle-mac.sh
you can sign the macOS application bundles via release/codesign-mac.sh
. The signed application bundles are stored into the release/signed
folder.
Notice: Signing the application for macOS requires a macOS system. As far as we know you can't do code signing from other operating systems.