Skip to content

Commit

Permalink
Use the new kotlin DSL block in build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
olshevski committed Jul 19, 2023
1 parent 59d5225 commit 50b110f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gradle.kotlin.dsl.accessors._28c5872c54ea2c9cb63ee4324650cf5f.kotlin
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
android
Expand Down Expand Up @@ -49,6 +49,8 @@ android {
}
}

tasks.withType<KotlinCompile> {
compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8)
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
7 changes: 4 additions & 3 deletions buildSrc/src/main/kotlin/android-library-config.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`android-library`
Expand Down Expand Up @@ -44,6 +43,8 @@ android {
}
}

tasks.withType<KotlinCompile> {
compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8)
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
11 changes: 7 additions & 4 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ plugins {

android {
namespace = "${project.group}.reimagined.sample"
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=androidx.lifecycle.viewmodel.compose.SavedStateHandleSaveableApi",
"-opt-in=dev.olshevski.navigation.reimagined.ExperimentalReimaginedApi"
}

kotlin {
compilerOptions {
optIn.addAll(
"androidx.lifecycle.viewmodel.compose.SavedStateHandleSaveableApi",
"dev.olshevski.navigation.reimagined.ExperimentalReimaginedApi"
)
}
}
Expand Down

0 comments on commit 50b110f

Please sign in to comment.