Skip to content

Commit 11ed3a9

Browse files
authored
Ensure built with same JDK on local and CI (#76)
Configure toolchain auto-provisioning so that CI uses Azul 8 for compiling. M1 Macs must use Azul because it's the only native JDK 8 for ARM.
1 parent 02f3727 commit 11ed3a9

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

.github/actions/build/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ runs:
2020
- name: Set up Java
2121
uses: actions/setup-java@v2
2222
with:
23-
distribution: temurin
24-
java-version: 8
23+
distribution: zulu
24+
java-version: 20
2525
- name: Validate Gradle wrapper JAR
2626
uses: gradle/wrapper-validation-action@v1.0.6
2727
- name: Set up Gradle

examples/example-project/app/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ repositories {
1212
maven(url = "https://jitpack.io")
1313
}
1414

15+
java {
16+
toolchain {
17+
languageVersion.set(JavaLanguageVersion.of(8))
18+
}
19+
}
20+
1521
dependencies {
1622
implementation("com.github.gabrielfeo:gradle-enterprise-api-kotlin:0.16.0")
1723
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
rootProject.name = "example-project"
22

3-
include(":app")
3+
plugins {
4+
id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0")
5+
}
46

57
dependencyResolutionManagement {
68
repositories {
79
mavenCentral()
810
}
911
}
12+
13+
include(":app")

library/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ java {
139139
withJavadocJar()
140140
toolchain {
141141
languageVersion.set(JavaLanguageVersion.of(8))
142+
vendor.set(JvmVendorSpec.AZUL)
142143
}
143144
}
144145

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id("com.gradle.enterprise") version("3.13.2")
3+
id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0")
34
}
45

56
include(

0 commit comments

Comments
 (0)