mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Update kotlin monorepo (#1614)
* Update kotlin monorepo * Update ksp to v1.8.0-1.0.9 * Lower metadata to 0.5.0 * Update KCT * Update to compilerOptions * Suppress deprecation * Add missing java target too * Raise it again because it's broken on all * Kotlin 1.8.20 + updated kotlinpoet * Update kotlinpoet * Update kotlin * Fix KSP equality check for KotlinPoet 1.13.x --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jake Wharton <github@jakewharton.com> Co-authored-by: Zac Sweers <pandanomic@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import com.vanniktech.maven.publish.JavadocJar.Dokka
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
@@ -24,9 +25,13 @@ val customLauncher = service.launcherFor {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
tasks.named<JavaCompile>("compileJava16Java") {
|
||||
options.release.set(16)
|
||||
}
|
||||
|
||||
tasks.named<KotlinCompile>("compileJava16Kotlin") {
|
||||
kotlinJavaToolchain.toolchain.use(customLauncher)
|
||||
kotlinOptions.jvmTarget = "16"
|
||||
compilerOptions.jvmTarget.set(JvmTarget.JVM_16)
|
||||
}
|
||||
|
||||
// Grant our java16 sources access to internal APIs in the main source set
|
||||
@@ -59,16 +64,14 @@ tasks.withType<Test>().configureEach {
|
||||
|
||||
tasks.withType<KotlinCompile>()
|
||||
.configureEach {
|
||||
kotlinOptions {
|
||||
val toAdd = mutableListOf(
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll(
|
||||
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-Xjvm-default=all",
|
||||
)
|
||||
if (name.contains("test", true)) {
|
||||
toAdd += "-opt-in=kotlin.ExperimentalStdlibApi"
|
||||
freeCompilerArgs.add("-opt-in=kotlin.ExperimentalStdlibApi")
|
||||
}
|
||||
@Suppress("SuspiciousCollectionReassignment") // It's not suspicious
|
||||
freeCompilerArgs += toAdd
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user