Skip to content

Commit

Permalink
Set javaToolchain for cli-bot:nativeCompile
Browse files Browse the repository at this point in the history
  • Loading branch information
serpro69 committed Mar 10, 2024
1 parent abf73d9 commit 6b1bc04
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ jobs:
run: ./gradlew nativeCompile
- name: Test native image
run: |
_app_path=$(find ./cli-bot/build/native/nativeCompile/ -type f -name faker-bot\* -not -name \*.txt)
mv "$_app_path" $RUNNER_TEMP/faker-bot
# run several iterations to test various pathways when generating data
for i in {0..10}; do
./cli-bot/build/native/nativeCompile/faker-bot list --verbose >/dev/null || false
./cli-bot/build/native/nativeCompile/faker-bot lookup a --verbose >/dev/null || false
${{ runner.temp }}/faker-bot list --verbose >/dev/null || false
${{ runner.temp }}/faker-bot lookup a --verbose >/dev/null || false
done
4 changes: 1 addition & 3 deletions .github/workflows/publish_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ jobs:
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: |
8
17
java-version: 8
distribution: 'temurin'
# loosely based on https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#installing-java-from-local-file
- name: Fetch latest graalce JDK
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ subprojects {
configure<JavaPluginExtension> {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
vendor.set(JvmVendorSpec.matching("Temurin"))
}
}

configure<KotlinJvmProjectExtension> {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(8))
vendor.set(JvmVendorSpec.matching("Temurin"))
}
}

Expand Down
13 changes: 10 additions & 3 deletions cli-bot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ application {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
vendor.set(JvmVendorSpec.matching("Temurin"))
}
}

testlogger {
Expand Down Expand Up @@ -91,7 +93,12 @@ graalvmNative {
toolchainDetection = true
binaries {
named("main") {
imageName = "faker-bot"
imageName = "faker-bot_${project.version}"
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
vendor.set(JvmVendorSpec.GRAAL_VM)
}
mainClass.set(mainFunction)
}
}
}
Expand Down

0 comments on commit 6b1bc04

Please sign in to comment.