From d8aeb5f4bccac7410accb9a37f5f7bf1fa7a1e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Mon, 6 May 2024 23:13:24 -0300 Subject: [PATCH] Test building native-image --- .github/workflows/build.yml | 42 +++++++++++++++++++ dev.thihup.jvisualg.ide/pom.xml | 31 +++++++++++--- .../java/dev/thihup/jvisualg/ide/Main.java | 1 + 3 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3e5f754 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: GraalVM build +on: [push, pull_request, workflow_dispatch] +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: graalvm/setup-graalvm@v1 + with: + java-version: '22' + distribution: 'graalvm' + cache: 'maven' + github-token: ${{ secrets.GITHUB_TOKEN }} + + # Setup the Windows build environment + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Visual Studio shell + uses: egor-tensin/vs-shell@v2 + + + - name: Example step + run: | + echo "GRAALVM_HOME: $GRAALVM_HOME" + echo "JAVA_HOME: $JAVA_HOME" + java --version + native-image --version + - name: Compile and package + run: mvn package + - name: Example step using Maven plugin + run: | + cd dev.thihup.jvisualg.ide + mvn -Pnative gluonfx:build + - name: Release + uses: ncipollo/release-action@v1 + with: + artifacts: "dev.thihup.jvisualg.ide/target/gluonfx/x86_64-windows/JVisualG.exe" + replacesArtifacts: true + tag: JVisualg + token: ${{ secrets.GITHUB_TOKEN }} + allowUpdates: true diff --git a/dev.thihup.jvisualg.ide/pom.xml b/dev.thihup.jvisualg.ide/pom.xml index 67186a7..5b67e7e 100644 --- a/dev.thihup.jvisualg.ide/pom.xml +++ b/dev.thihup.jvisualg.ide/pom.xml @@ -11,22 +11,25 @@ dev.thihup.jvisualg.ide + JVisualG + - 22 - 22 - UTF-8 + dev.thihup.jvisualg.ide.Main + 0.9.12 + JVisualG + 22 org.openjfx javafx-controls - 22 + ${javafx.version} org.openjfx javafx-fxml - 22 + ${javafx.version} org.fxmisc.richtext @@ -34,5 +37,23 @@ 0.11.2 + + + native + + + + com.gluonhq + gluonfx-maven-plugin + 1.0.22 + + ${mainClass} + true + + + + + + diff --git a/dev.thihup.jvisualg.ide/src/main/java/dev/thihup/jvisualg/ide/Main.java b/dev.thihup.jvisualg.ide/src/main/java/dev/thihup/jvisualg/ide/Main.java index 971f061..0cdadb7 100644 --- a/dev.thihup.jvisualg.ide/src/main/java/dev/thihup/jvisualg/ide/Main.java +++ b/dev.thihup.jvisualg.ide/src/main/java/dev/thihup/jvisualg/ide/Main.java @@ -1,6 +1,7 @@ package dev.thihup.jvisualg.ide; import javafx.application.Application; +import javafx.application.Platform; import javafx.concurrent.Task; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader;