Skip to content

Commit

Permalink
#30: adds necessary files to switch pkg creation on mac to deploy to …
Browse files Browse the repository at this point in the history
…app store by default
  • Loading branch information
rladstaetter committed Mar 10, 2023
1 parent 91df371 commit 3152cd8
Show file tree
Hide file tree
Showing 25 changed files with 104 additions and 337 deletions.
53 changes: 35 additions & 18 deletions BuildInstructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,36 @@

There are several apps you will have to install to sucessfully build `LogoRRR`, but it isn't overly complicated.

Given you have followed the instructions for [maven-gluonfx-plugin](https://github.com/gluonhq/gluonfx-maven-plugin) you only have to provide the path to your GraalVM installation in the main pom.xml found at the root folder of the project.
Given you have followed the instructions for [maven-gluonfx-plugin](https://github.com/gluonhq/gluonfx-maven-plugin) you
only have to provide the path to your GraalVM installation in the main pom.xml found at the root folder of the project.

## Fast forward

For the brave, there are build scripts in the main directory for each OS:

build-linux-aarch64.sh
build-linux-amd64.sh
build-mac-aarch64.sh
build-mac-x64.sh
build-mac.sh
build-win-x64.bat

After configuring the project once properly, you can use those build scripts (which are trivial but handy) to build `LogoRRR`.

After configuring the project once properly, you can use those build scripts (which are trivial but handy) to
build `LogoRRR`.

### MacOs X

Following commands should get you a working environment. This is a fast way to install everything you'll need as far as I remember.
Following commands should get you a working environment. This is a fast way to install everything you'll need as far as
I remember.

git clone https://github.com/rladstaetter/LogoRRR.git
curl -s "https://get.sdkman.io" | bash
sdk install maven 3.8.1
sdk install java 22.3.r19-grl

([sdkman.io](https://sdkman.io) is a package manager specifically tailored for java development, you can install various JVM based utilities / libraries and tools with it, manage different JVM versions as well - very handy!)
([sdkman.io](https://sdkman.io) is a package manager specifically tailored for java development, you can install various
JVM based utilities / libraries and tools with it, manage different JVM versions as well - very handy!)

After this initial setup, you should be ready to build via maven. You have to adapt some paths in `pom.xml` - just search for `graalvm.home` and make sure it is pointing to the correct path.
After this initial setup, you should be ready to build via maven. You have to adapt some paths in `pom.xml` - just
search for `graalvm.home` and make sure it is pointing to the correct path.

Execute

Expand All @@ -49,36 +52,46 @@ To setup your Windows development environment, you have to perform following ste

- Install Visual Studio 2019 (Community Edition should suffice, tested with Visual Studio Professional)
- Gluon's build of GraalVM in a recent version (at least [22.0.0.2](https://github.com/gluonhq/graal/releases))
- (optionally) Install [Advanced Installer Suite](https://www.advancedinstaller.com) for creating installers (if you don't the build doesn't create installers)
- set `GRAALVM_HOME`, `JAVA_HOME` andy your PATH variable to use this JDK for your builds.
- (optionally) Install [Advanced Installer Suite](https://www.advancedinstaller.com) for creating installers (if you
don't the build doesn't create installers)
- set `GRAALVM_HOME`, `JAVA_HOME` andy your PATH variable to use this JDK for your builds.

For my setup, those commands work:

set GRAALVM_HOME=C:\Program Files\Java\graalvm-svm-java11-windows-gluon-22.0.0.2-Final
set JAVA_HOME=%GRAALVM_HOME%
set PATH=%GRAALVM_HOME%\bin;%PATH%

After setting `graalvm.home` in the main pom.xml to your GraalVM Installation directory all you have to do to get to a binary is:
After setting `graalvm.home` in the main pom.xml to your GraalVM Installation directory all you have to do to get to a
binary is:

mvn clean install

A binary is available here after some minutes:

./dist/dist-win/binary-win/target/gluonfx/x86_64-windows/app.logorrr.dist.win.binary.exe

If you want to execute this exe on another computer, you have to make sure that the Visual Studio runtime dlls are present there. If not, you can download [Visual Studio 2019 redistributables here](https://aka.ms/vs/16/release/vc_redist.x64.exe). If the application doesn't start - this is a possible reason for that.
If you want to execute this exe on another computer, you have to make sure that the Visual Studio runtime dlls are
present there. If not, you can
download [Visual Studio 2019 redistributables here](https://aka.ms/vs/16/release/vc_redist.x64.exe). If the application
doesn't start - this is a possible reason for that.

### Linux

Setup on Linux is quite similar to Mac. You'll need at least `maven`, a `JDK` and a `GraalVM` installation.

My preferred way to get those tools is `apt` and `sdkman`, but this may vary on personal preferences. Use whatever fits you best.
My preferred way to get those tools is `apt` and `sdkman`, but this may vary on personal preferences. Use whatever fits
you best.

After installing all tools and configuring some paths in the `pom.xml` files a simple `mvn clean package` should do the trick.
After installing all tools and configuring some paths in the `pom.xml` files a simple `mvn clean package` should do the
trick.

## Running from IntelliJ

Running JavaFX applications in IntelliJ needs a some more work if you work with modularized Java. There are builds of Java which incorporate JavaFX (from Azul for example) where following steps are not necessary. However, if you use GraalVM or AdoptOpenJDK builds, you have to provide special VM Parameters in order to start a JavaFX application from your IDE.
Running JavaFX applications in IntelliJ needs a some more work if you work with modularized Java. There are builds of
Java which incorporate JavaFX (from Azul for example) where following steps are not necessary. However, if you use
GraalVM or AdoptOpenJDK builds, you have to provide special VM Parameters in order to start a JavaFX application from
your IDE.

As such, you have to provide following parameters:

Expand All @@ -88,7 +101,8 @@ For me following settings work:

--module-path /Users/lad/gh/javafx-sdk-16/lib --add-modules javafx.controls,javafx.fxml

Note that you have to download this javafx-sdk separately and install it once on your computer, you can get it on [Gluon's Download Page for JavaFX](https://gluonhq.com/products/javafx/).
Note that you have to download this javafx-sdk separately and install it once on your computer, you can get it
on [Gluon's Download Page for JavaFX](https://gluonhq.com/products/javafx/).

A comprehensive tutorial how to get started with developing JavaFX can be found on [openjfx.io](https://openjfx.io).

Expand All @@ -100,9 +114,12 @@ A comprehensive tutorial how to get started with developing JavaFX can be found

mvn gluonfx:runagent

It will start `LogoRRR`. Now you have to execute all possible click paths - in your code repository configuration files will appear in `src/main/resources/META-INF/native-image/`. Those files are different depending on which OS you execute the application.
It will start `LogoRRR`. Now you have to execute all possible click paths - in your code repository configuration files
will appear in `src/main/resources/META-INF/native-image/`. Those files are different depending on which OS you execute
the application.

Currently, those files are checked in under src/main/native-image/<os>/, and via a maven configuration they are placed in the right place needed for native-image. Like this the project can be build on multiple platforms via
Currently, those files are checked in under src/main/native-image/<os>/, and via a maven configuration they are placed
in the right place needed for native-image. Like this the project can be build on multiple platforms via

mvn clean install

Expand Down
File renamed without changes.
17 changes: 0 additions & 17 deletions dist/dist-osx/installer-osx/notarize-apps.md

This file was deleted.

0 comments on commit 3152cd8

Please sign in to comment.