Skip to content

Commit

Permalink
use java.toolchain and also build against jdk 17
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed May 12, 2023
1 parent 0920107 commit 42428a3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: true
matrix:
java_version: [ 11, 14 ]
java_version: [ 11, 17 ]

steps:
- uses: actions/checkout@v3
Expand All @@ -19,6 +19,8 @@ jobs:
java-version: ${{ matrix.java_version }}

- name: build
env:
JAVA_VERSION: ${{ matrix.java_version }}
run: ./gradlew build

# TODO 1.3.0 re-activate scala API
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: true
matrix:
java_version: [ 11, 14 ]
java_version: [ 11, 17 ]

steps:
- uses: actions/checkout@v3
Expand All @@ -21,6 +21,8 @@ jobs:
java-version: ${{ matrix.java_version }}

- name: build
env:
JAVA_VERSION: ${{ matrix.java_version }}
run: ./gradlew build

- name: Cache android jar
Expand Down
15 changes: 13 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ plugins {
kotlin("jvm") apply false
//needs to be applied before tutteli's dokka plugin in order that version takes precedence
id("org.jetbrains.dokka") version "1.8.10"
val tutteliGradleVersion = "4.8.0"
val tutteliGradleVersion = "4.9.0"
id("ch.tutteli.gradle.plugins.dokka") version tutteliGradleVersion
id("ch.tutteli.gradle.plugins.project.utils") version tutteliGradleVersion
id("ch.tutteli.gradle.plugins.publish") version tutteliGradleVersion apply false
Expand Down Expand Up @@ -133,7 +133,7 @@ configure(multiplatformProjects) {
withJava()
}

//TODO 1.3.0 switch from LEGACY to IR once we output Kotlin > 1.4
//TODO 1.1.0 switch from LEGACY to IR
js(LEGACY) { nodejs() }

sourceSets {
Expand Down Expand Up @@ -237,11 +237,22 @@ configure(subprojects.filter {
}

allprojects {
project.extensions.findByType<JavaPluginExtension>()?.apply {
toolchain {
// reading JAVA_VERSION from env to enable jdk17 build in CI
val jdkVersion = System.getenv("JAVA_VERSION")?.toIntOrNull() ?: 11
languageVersion.set(JavaLanguageVersion.of(jdkVersion))
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
sourceCompatibility = "11"
targetCompatibility = "11"
}
tasks.withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
}
}

//TODO 1.1.0 re-introduce bcTests again? I am currently not sure if it is actually worth it
Expand Down

0 comments on commit 42428a3

Please sign in to comment.