Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
npresseault committed Jul 15, 2024
1 parent 0300609 commit 07db218
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import com.android.build.api.dsl.CommonExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

private object Constants {
val JAVA_VERSION = JavaVersion.VERSION_17
Expand All @@ -30,12 +32,18 @@ internal fun Project.configureKotlinAndroid(
}

private fun Project.configureKotlin() {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = Constants.JAVA_VERSION.toString()
freeCompilerArgs += listOf(
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=com.mirego.pilot.components.InternalPilotComponentsApi"
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
tasks.withType<KotlinCompilationTask<*>> {
compilerOptions {
optIn.addAll(
listOf(
"kotlin.RequiresOptIn",
"com.mirego.pilot.components.InternalPilotComponentsApi",
),
)
}
}
Expand Down
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

plugins {
alias(libs.plugins.kotlin.android) apply false
Expand All @@ -16,6 +17,12 @@ allprojects {
google()
mavenCentral()
}

tasks.withType<KotlinCompilationTask<*>> {
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}

subprojects {
Expand Down

0 comments on commit 07db218

Please sign in to comment.