From e3aed7807b238a5f849ea5ff1ad58a0b3b9e14de Mon Sep 17 00:00:00 2001 From: lisonge Date: Fri, 24 May 2024 21:23:13 +0800 Subject: [PATCH] perf: gradle api --- selector/build.gradle.kts | 24 +++++++++++++++--------- wasm_matches/build.gradle.kts | 14 +++++++++----- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/selector/build.gradle.kts b/selector/build.gradle.kts index 563b4da..07ef4ce 100644 --- a/selector/build.gradle.kts +++ b/selector/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.serialization) @@ -5,8 +7,8 @@ plugins { kotlin { jvm { - compilations.all { - kotlinOptions.jvmTarget = JavaVersion.VERSION_17.majorVersion + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) } } // https://kotlinlang.org/docs/js-to-kotlin-interop.html#kotlin-types-in-javascript @@ -20,12 +22,16 @@ kotlin { all { languageSettings.optIn("kotlin.js.ExperimentalJsExport") } - } - sourceSets["commonMain"].dependencies { - implementation(libs.kotlin.stdlib.common) - } - sourceSets["jvmTest"].dependencies { - implementation(libs.kotlinx.serialization.json) - implementation(libs.junit) + commonMain { + dependencies { + implementation(libs.kotlin.stdlib.common) + } + } + jvmTest { + dependencies { + implementation(libs.kotlinx.serialization.json) + implementation(libs.junit) + } + } } } diff --git a/wasm_matches/build.gradle.kts b/wasm_matches/build.gradle.kts index f0cf42d..1a7408e 100644 --- a/wasm_matches/build.gradle.kts +++ b/wasm_matches/build.gradle.kts @@ -1,11 +1,13 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { alias(libs.plugins.kotlin.multiplatform) } kotlin { jvm { - compilations.all { - kotlinOptions.jvmTarget = JavaVersion.VERSION_17.majorVersion + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) } } wasmJs { @@ -18,8 +20,10 @@ kotlin { all { languageSettings.optIn("kotlin.js.ExperimentalJsExport") } - } - sourceSets["commonMain"].dependencies { - implementation(libs.kotlin.stdlib.common) + commonMain { + dependencies { + implementation(libs.kotlin.stdlib.common) + } + } } }