[Repo] Don't use kotlinOptions in repo build scripts

^KT-63419 In Progress
This commit is contained in:
Yahor Berdnikau
2024-02-19 23:34:11 +01:00
committed by Space Team
parent 22e1e79c41
commit 6b19b8b9d0
54 changed files with 300 additions and 204 deletions
@@ -25,5 +25,10 @@ swiftBenchmark {
tasks.named<org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile>("compileKotlinNative") {
dependsOn(gradle.includedBuild("benchmarksAnalyzer").task(":cinteropLibcurlMacos"))
kotlinOptions.freeCompilerArgs = listOf("-l", project.file("$toolsPath/benchmarksAnalyzer/build/classes/kotlin/macos/main/benchmarksAnalyzer-cinterop-libcurl").absolutePath)
compilerOptions.freeCompilerArgs.addAll(
listOf(
"-l",
project.file("$toolsPath/benchmarksAnalyzer/build/classes/kotlin/macos/main/benchmarksAnalyzer-cinterop-libcurl").absolutePath
)
)
}
@@ -1,4 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
import java.util.Properties
import java.io.FileReader
@@ -43,9 +44,13 @@ sourceSets["main"].kotlin {
srcDir("../../tools/benchmarks/shared/src/main/kotlin/report")
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs +=
listOf("-opt-in=kotlin.RequiresOptIn", "-opt-in=kotlin.ExperimentalStdlibApi")
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions.optIn.addAll(
listOf(
"kotlin.RequiresOptIn",
"kotlin.ExperimentalStdlibApi",
)
)
}
@@ -108,9 +113,7 @@ afterEvaluate {
tasks.withType<JavaCompile>().configureEach {
targetCompatibility = "1.8"
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}
}
@@ -163,8 +163,9 @@ abstract class BenchmarkingPlugin: Plugin<Project> {
protected fun Project.configureNativeTarget(hostPreset: AbstractKotlinNativeTargetPreset<*>) {
kotlin.targetFromPreset(hostPreset, NATIVE_TARGET_NAME) {
compilations.named("main").configure {
@Suppress("DEPRECATION")
kotlinOptions.freeCompilerArgs = benchmark.compilerOpts + project.compilerArgs
compileTaskProvider.configure {
compilerOptions.freeCompilerArgs.set(benchmark.compilerOpts + project.compilerArgs)
}
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-cli:0.3.5")
}
@@ -5,6 +5,7 @@ import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.Task
import org.jetbrains.kotlin.*
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.plugin.mpp.Executable
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
@@ -133,11 +134,12 @@ open class KotlinNativeBenchmarkingPlugin: BenchmarkingPlugin() {
private fun Project.configureJVMTarget() {
kotlin.jvm {
compilations.all {
@Suppress("DEPRECATION")
compileKotlinTask.kotlinOptions {
jvmTarget = "1.8"
suppressWarnings = true
freeCompilerArgs = project.benchmark.compilerOpts + project.compilerArgs
compileTaskProvider.configure {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
suppressWarnings.set(true)
freeCompilerArgs.set(project.benchmark.compilerOpts + project.compilerArgs)
}
}
}
}