Skip to content

Commit 2f1969b

Browse files
committed
use -O3 for production build
1 parent 77e63f1 commit 2f1969b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
java-version: '21'
3434
distribution: 'graalvm-community'
3535
- name: Build JAR
36-
run: ./gradlew nativeCompile
36+
run: ./gradlew nativeCompile -Pprod
3737
- name: Build Docker image
3838
run: docker build -t javabot .
3939
- name: Tag docker image

build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,11 @@ tasks.processTestAot {
121121
graalvmNative {
122122
binaries {
123123
named("main") {
124-
//For development:
125-
//quickBuild.set(true)
124+
if (hasProperty("prod")) {
125+
buildArgs.add("-O3")
126+
} else {
127+
quickBuild.set(true)
128+
}
126129
buildArgs.add("-H:+UnlockExperimentalVMOptions")
127130
buildArgs.add("-H:JNIConfigurationFiles=${projectDir}/graal/jni-config.json")
128131
}

0 commit comments

Comments
 (0)