Skip to content

Commit

Permalink
Fix kotlin compat version issue x2
Browse files Browse the repository at this point in the history
  • Loading branch information
mars885 committed Aug 8, 2024
1 parent 6ff9a51 commit 978039e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ subprojects {

plugins.withId(PLUGIN_KOTLIN) {
extensions.findByType<KotlinProjectExtension>()?.run {
jvmToolchain(appConfig.kotlinCompatibilityVersion)
jvmToolchain(appConfig.jvmToolchainVersion)
}
}

Expand Down
7 changes: 6 additions & 1 deletion buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

@file:Suppress("ClassName")

import org.gradle.api.JavaVersion

object appConfig {

const val compileSdkVersion = 34
Expand All @@ -25,7 +27,10 @@ object appConfig {
const val versionCode = 1
const val versionName = "1.0.0"

const val kotlinCompatibilityVersion = 8
const val jvmToolchainVersion = 17

val javaCompatibilityVersion = JavaVersion.VERSION_17
val kotlinCompatibilityVersion = JavaVersion.VERSION_17
}

object versions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import PLUGIN_ANDROID_APPLICATION
import PLUGIN_KOTLIN_ANDROID
import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
import org.gradle.kotlin.dsl.findByType
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
import java.util.Properties

class GamedgeAndroidPlugin : Plugin<Project> {
Expand Down Expand Up @@ -92,6 +93,11 @@ class GamedgeAndroidPlugin : Plugin<Project> {
}
}

compileOptions {
sourceCompatibility = appConfig.javaCompatibilityVersion
targetCompatibility = appConfig.javaCompatibilityVersion
}

// Without the below block, a build failure was happening when running ./gradlew connectedAndroidTest
// See: https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-debug#debug-agent-and-android
packagingOptions {
Expand Down

0 comments on commit 978039e

Please sign in to comment.