Skip to content

Commit

Permalink
Test building native-image
Browse files Browse the repository at this point in the history
  • Loading branch information
Thihup committed May 7, 2024
1 parent 604a53c commit d8aeb5f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 5 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 26 additions & 5 deletions dev.thihup.jvisualg.ide/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,49 @@

<artifactId>dev.thihup.jvisualg.ide</artifactId>

<name>JVisualG</name>

<properties>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>dev.thihup.jvisualg.ide.Main</mainClass>
<native.maven.plugin.version>0.9.12</native.maven.plugin.version>
<imageName>JVisualG</imageName>
<javafx.version>22</javafx.version>
</properties>

<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>22</version>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>22</version>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.fxmisc.richtext</groupId>
<artifactId>richtextfx</artifactId>
<version>0.11.2</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>1.0.22</version>
<configuration>
<mainClass>${mainClass}</mainClass>
<enableSWRendering>true</enableSWRendering>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit d8aeb5f

Please sign in to comment.