Skip to content

Commit

Permalink
修复macOS上无法使用GraalVM构建的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
icuxika committed Jan 29, 2024
1 parent e33b893 commit 158517e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 16 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,17 @@ gradlew.bat nativeBuild -D"https.proxyHost"=127.0.0.1 -D"https.proxyPort"=7890
##### maven
###### 构建与运行
```shell
mvn gluonfx:build
mvn gluonfx:run
mvn -Pwin gluonfx:build
mvn -Pwin gluonfx:run

mvn -Pmac gluonfx:build
mvn -Pmac gluonfx:run
```

###### `Downloading JavaFX static libs...`网络问题
```shell
mvn gluonfx:build -D"https.proxyHost"=127.0.0.1 -D"https.proxyPort"=7890
mvn -Pwin gluonfx:build -D"https.proxyHost"=127.0.0.1 -D"https.proxyPort"=7890
mvn -Pmac gluonfx:build -D"https.proxyHost"=127.0.0.1 -D"https.proxyPort"=7890
```

## 补充
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ gluonfx {
"LanguageResource_en",
"LanguageResource_zh_CN"
]
if (org.gradle.internal.os.OperatingSystem.current().macOsX) {
compilerArgs = ["-Dsvm.platform=org.graalvm.nativeimage.Platform\$MACOS_AMD64"]
}
}

task printDependentJarsList {
Expand Down
61 changes: 48 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,54 @@
<mainClass>sample/com.icuxika.MainApp</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>1.0.22</version>
<configuration>
<mainClass>com.icuxika.MainApp</mainClass>
<bundlesList>
<list>LanguageResource</list>
<list>LanguageResource_en</list>
<list>LanguageResource_zh_CN</list>
</bundlesList>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>win</id>
<build>
<plugins>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>1.0.22</version>
<configuration>
<mainClass>com.icuxika.MainApp</mainClass>
<bundlesList>
<list>LanguageResource</list>
<list>LanguageResource_en</list>
<list>LanguageResource_zh_CN</list>
</bundlesList>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>mac</id>
<build>
<plugins>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>1.0.22</version>
<configuration>
<mainClass>com.icuxika.MainApp</mainClass>
<bundlesList>
<list>LanguageResource</list>
<list>LanguageResource_en</list>
<list>LanguageResource_zh_CN</list>
</bundlesList>
<nativeImageArgs>
<nativeImageArg>
-Dsvm.platform=org.graalvm.nativeimage.Platform$MACOS_AMD64
</nativeImageArg>
</nativeImageArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 158517e

Please sign in to comment.