0cad069522
This is required to be able to compile KGP and it's dependencies which set LV to 1.4 when repo will use LV 1.9. This caused by the change how enums are compiled (KT-48872).
40 lines
1.0 KiB
Kotlin
40 lines
1.0 KiB
Kotlin
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
|
|
|
plugins {
|
|
kotlin("jvm")
|
|
id("jps-compatible")
|
|
}
|
|
|
|
project.updateJvmTarget("1.8")
|
|
|
|
dependencies {
|
|
api(kotlinStdlib())
|
|
compileOnly(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
|
|
testApi(commonDependency("junit"))
|
|
}
|
|
|
|
sourceSets {
|
|
"main" { projectDefault() }
|
|
"test" { projectDefault() }
|
|
}
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
"-Xallow-kotlin-package"
|
|
)
|
|
}
|
|
|
|
publish()
|
|
|
|
runtimeJar()
|
|
sourcesJar()
|
|
javadocJar()
|
|
|
|
// 1.9 level breaks Kotlin Gradle plugins via changes in enums (KT-48872)
|
|
// We limit api and LV until KGP will stop using Kotlin compiler directly (KT-56574)
|
|
tasks.withType<KotlinCompilationTask<*>>().configureEach {
|
|
compilerOptions.apiVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
|
compilerOptions.languageVersion.value(KotlinVersion.KOTLIN_1_8).finalizeValueOnRead()
|
|
}
|