Skip to content

Commit

Permalink
Use JDK 17 on CI (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt authored May 15, 2023
1 parent 3f0ea40 commit 9be9800
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'

- uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'

- uses: actions/cache@v3
with:
Expand Down
1 change: 1 addition & 0 deletions axis/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down
21 changes: 13 additions & 8 deletions box/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ plugins {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

android { publishAllLibraryVariants() }
android().publishAllLibraryVariants()
jvm()
js().browser()
macosArm64()
Expand Down Expand Up @@ -91,15 +92,19 @@ kotlin {
// }

android {
compileSdkVersion(libs.versions.android.compile.get())

defaultConfig {
minSdkVersion(libs.versions.android.min.get())
// Workaround (for `jvmToolchain` not being honored) needed until AGP 8.1.0-alpha09.
// https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

lintOptions {
isAbortOnError = true
isWarningsAsErrors = true
compileSdk = libs.versions.android.compile.get().toInt()
defaultConfig.minSdk = libs.versions.android.min.get().toInt()

lint {
abortOnError = true
warningsAsErrors = true
}

sourceSets {
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ plugins {
alias(libs.plugins.kotlinter) apply false
alias(libs.plugins.dokka)
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.java8)
alias(libs.plugins.validator)
}

Expand Down
1 change: 1 addition & 0 deletions color/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down
19 changes: 12 additions & 7 deletions compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

android() { publishAllLibraryVariants() }
jvm("desktop")
Expand Down Expand Up @@ -41,15 +42,19 @@ kotlin {
}

android {
compileSdkVersion(libs.versions.android.compile.get())

defaultConfig {
minSdkVersion(libs.versions.android.min.get())
// Workaround (for `jvmToolchain` not being honored) needed until AGP 8.1.0-alpha09.
// https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

lintOptions {
isAbortOnError = true
isWarningsAsErrors = true
compileSdk = libs.versions.android.compile.get().toInt()
defaultConfig.minSdk = libs.versions.android.min.get().toInt()

lint {
abortOnError = true
warningsAsErrors = true
}

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
Expand Down
21 changes: 13 additions & 8 deletions element-view/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ plugins {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

android { publishAllLibraryVariants() }
android().publishAllLibraryVariants()
js().browser()

sourceSets {
Expand Down Expand Up @@ -53,15 +54,19 @@ kotlin {
}

android {
compileSdkVersion(libs.versions.android.compile.get())

defaultConfig {
minSdkVersion(libs.versions.android.min.get())
// Workaround (for `jvmToolchain` not being honored) needed until AGP 8.1.0-alpha09.
// https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

lintOptions {
isAbortOnError = true
isWarningsAsErrors = true
compileSdk = libs.versions.android.compile.get().toInt()
defaultConfig.minSdk = libs.versions.android.min.get().toInt()

lint {
abortOnError = true
warningsAsErrors = true
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion element-view/src/androidMain/kotlin/ElementView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ElementView @JvmOverloads constructor(
private val blitPaint = AndroidPaint()

/** The chart [ElementViewAdapter]. */
var adapter: ElementViewAdapter<*>? = null
public var adapter: ElementViewAdapter<*>? = null
set(value) {
if (isAttachedToWindow) {
field?.onDetached()
Expand Down
1 change: 1 addition & 0 deletions element/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m
org.gradle.jvmargs=-Xmx2048m

# Android Configuration
android.useAndroidX=true
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[versions]
agp = "7.4.1" # 7.4.1 is the maximum version supported by IDEA 2023.1
android-compile = "android-33"
android-target = "32"
android-compile = "33"
android-min = "21"
android-target = "32"
compose = "1.4.0"
coroutines = "1.7.1"
jacoco = "0.8.7"
jvm-toolchain = "11"
kotlin = "1.8.20"

[libraries]
Expand All @@ -27,7 +28,6 @@ android-library = { id = "com.android.library", version.ref = "agp" }
atomicfu = { id = "kotlinx-atomicfu", version = "0.20.2" }
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
dokka = { id = "org.jetbrains.dokka", version = "1.8.10" }
java8 = { id = "net.mbonnin.one.eight", version = "0.2" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinter = { id = "org.jmailen.kotlinter", version = "3.14.0" }
maven-publish = { id = "com.vanniktech.maven.publish", version = "0.25.2" }
Expand Down
1 change: 1 addition & 0 deletions hierarchy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down
1 change: 1 addition & 0 deletions interpolate/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down
21 changes: 13 additions & 8 deletions kanvas/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

android { publishAllLibraryVariants() }
android().publishAllLibraryVariants()
jvm()
js().browser()
iosArm64()
Expand Down Expand Up @@ -85,15 +86,19 @@ kotlin {
}

android {
compileSdkVersion(libs.versions.android.compile.get())

defaultConfig {
minSdkVersion(libs.versions.android.min.get())
// Workaround (for `jvmToolchain` not being honored) needed until AGP 8.1.0-alpha09.
// https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

lintOptions {
isAbortOnError = true
isWarningsAsErrors = true
compileSdk = libs.versions.android.compile.get().toInt()
defaultConfig.minSdk = libs.versions.android.min.get().toInt()

lint {
abortOnError = true
warningsAsErrors = true
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion kanvas/src/androidMain/kotlin/KanvasView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import android.util.TypedValue.applyDimension
import android.view.View

/** Base class for custom [View]s implemented using Krayon. */
abstract class KanvasView(
public abstract class KanvasView(
context: Context,
attrs: AttributeSet? = null,
) : View(context, attrs) {
Expand Down
15 changes: 12 additions & 3 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ plugins {
}

kotlin {
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

android()
jvm("desktop")
js {
Expand Down Expand Up @@ -78,10 +80,17 @@ kotlin {
}

android {
compileSdkVersion(libs.versions.android.compile.get())
// Workaround (for `jvmToolchain` not being honored) needed until AGP 8.1.0-alpha09.
// https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

compileSdk = libs.versions.android.compile.get().toInt()

defaultConfig {
minSdkVersion(libs.versions.android.min.get())
minSdk = libs.versions.android.min.get().toInt()
targetSdk = libs.versions.android.target.get().toInt()
versionCode = 1
versionName = "sample"
Expand All @@ -92,7 +101,7 @@ android {
viewBinding = true
}

lintOptions {
lint {
// Good habits for a real app, but trying to keep the sample project minimal.
disable += "AllowBackup"
disable += "MissingApplicationIcon"
Expand Down
1 change: 1 addition & 0 deletions scale/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down
1 change: 1 addition & 0 deletions selection/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down
1 change: 1 addition & 0 deletions shape/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down
1 change: 1 addition & 0 deletions time/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jacoco {

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())

jvm()
js().browser()
Expand Down

0 comments on commit 9be9800

Please sign in to comment.