!61 feat: #I7X2YR 使用gluonfx打包

Merge pull request !61 from songdragon/feature-I7X2YR
This commit is contained in:
Luke 2023-08-31 18:31:48 +00:00 committed by Gitee
commit e418d8b239
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 55 additions and 1 deletions

20
pom.xml
View File

@ -9,9 +9,11 @@
<version>1.0-SNAPSHOT</version>
<name>JNotepad</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.9.2</junit.version>
<javafx.version>17.0.1</javafx.version>
</properties>
<dependencies>
<dependency>
@ -22,7 +24,7 @@
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17.0.1</version>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
@ -95,6 +97,22 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>1.0.19</version>
<configuration>
<mainClass>org.jcnc.jnotepad/org.jcnc.jnotepad.LunchApp</mainClass>
<reflectionList>
org.jcnc.jnotepad.app.config.AppConfig,org.jcnc.jnotepad.app.config.AppConfig$ShortcutKey
</reflectionList>
<bundlesList>
i18n/i18n
</bundlesList>
</configuration>
</plugin>
</plugins>
</build>
</project>

3
tool/build.bat Normal file
View File

@ -0,0 +1,3 @@
cd ..
mvn clean gluonfx:build
cd tool

3
tool/build.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
mvn clean javafx:jlink gluonfx:build

BIN
tool/images/env.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
tool/images/path.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

30
tool/package.md Normal file
View File

@ -0,0 +1,30 @@
# 打包
## 准备
1. 下载maven 3.8.8 [Download](https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.zip)
2. 下载GraalVM。在[GraalVM下载页](https://www.graalvm.org/downloads/#)选择Java17操作系统后点击Download下载。
# Windows下基于GraalVM的打包
## 配置maven和GraalVM
1. 将下载的压缩包解压到目录例如d:\tools\maven,D:\tools\graalvm-17\graalvm-jdk-17.0.8+9.1
2. 配置环境变量
```
GRAALVM_HOME=D:\tools\graalvm-17\graalvm-jdk-17.0.8+9.1
M2_HOME=d:\tools\maven
```
![env.png](images%2Fenv.png)
3. 配置PATH环境变量
![path.png](images%2Fpath.png)
4. 安装visual studio build tools
安装说明https://www.graalvm.org/latest/docs/getting-started/windows/
a) 下载安装程序https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16
b) 参考网页中的安装步骤
5. 验证安装成功
使用下面命令启动编译环境
```
cmd.exe /k F:\vs\ide\VC\Auxiliary\Build\vcvars64.bat
```
需要把F:\vs\ide替换为本地的visual stuido安装路径。
6. 进入项目tool目录执行build.bat进行打包生成可执行文件。
```
build.bat
```