Update Kotlin repo for bootstrap update

^KT-27301 Fixed
This commit is contained in:
Yahor Berdnikau
2022-09-16 13:17:15 +02:00
parent e606018372
commit e94c1ea0ed
8 changed files with 16 additions and 1 deletions
+3
View File
@@ -139,6 +139,7 @@ fun Project.createGradleCommonSourceSet(): SourceSet {
// Common outputs will also produce '${project.name}.kotlin_module' file, so we need to avoid
// files clash
tasks.named<KotlinCompile>("compile${commonSourceSet.name.replaceFirstChar { it.uppercase() }}Kotlin") {
@Suppress("DEPRECATION")
kotlinOptions {
moduleName = "${this@createGradleCommonSourceSet.name}_${commonSourceSet.name}"
}
@@ -479,6 +480,7 @@ fun Project.createGradlePluginVariant(
// KT-52138: Make module name the same for all variants, so KSP could access internal methods/properties
tasks.named<KotlinCompile>("compile${variantSourceSet.name.replaceFirstChar { it.uppercase() }}Kotlin") {
@Suppress("DEPRECATION")
kotlinOptions {
moduleName = this@createGradlePluginVariant.name
}
@@ -515,6 +517,7 @@ private fun Project.commonVariantAttributes(): Action<Configuration> = Action<Co
}
fun Project.configureKotlinCompileTasksGradleCompatibility() {
@Suppress("DEPRECATION")
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.languageVersion = "1.4"
kotlinOptions.apiVersion = "1.4"
+2
View File
@@ -123,6 +123,7 @@ fun KotlinCompile.configureTaskToolchain(
)
)
)
@Suppress("DEPRECATION")
kotlinOptions {
jvmTarget = jdkVersion.targetName
}
@@ -165,6 +166,7 @@ fun Project.updateJvmTarget(
.withType<KotlinCompile>()
.matching { it.name != "compileJava9Kotlin" }
.configureEach {
@Suppress("DEPRECATION")
kotlinOptions.jvmTarget = jvmTarget
}
@@ -22,6 +22,7 @@ fun Project.configureJava9Compilation(
tasks.named("compileJava9Kotlin", KotlinCompile::class.java) {
configureTaskToolchain(JdkMajorVersion.JDK_9)
@Suppress("DEPRECATION")
kotlinOptions.jvmTarget = JdkMajorVersion.JDK_9.targetName
}
@@ -115,6 +115,7 @@ fun Project.configureKotlinCompilationOptions() {
val useFirIC by extra(project.kotlinBuildProperties.useFirTightIC)
val renderDiagnosticNames by extra(project.kotlinBuildProperties.renderDiagnosticNames)
@Suppress("DEPRECATION")
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
kotlinOptions {
languageVersion = kotlinLanguageVersion
@@ -127,8 +128,10 @@ fun Project.configureKotlinCompilationOptions() {
!kotlinBuildProperties.getBoolean("kotlin.build.use.absolute.paths.in.klib")
}
// Workaround to avoid remote build cache misses due to absolute paths in relativePathBaseArg
doFirst {
if (relativePathBaseArg != null) {
@Suppress("DEPRECATION")
kotlinOptions.freeCompilerArgs += relativePathBaseArg
}
}
+1
View File
@@ -333,6 +333,7 @@ fun Project.confugureFirPluginAnnotationsDependency(testTask: TaskProvider<Test>
}
fun Project.optInToExperimentalCompilerApi() {
@Suppress("DEPRECATION")
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
kotlinOptions {
freeCompilerArgs += "-opt-in=org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi"
@@ -162,6 +162,7 @@ abstract class BenchmarkingPlugin: Plugin<Project> {
protected fun Project.configureNativeTarget(hostPreset: AbstractKotlinNativeTargetPreset<*>) {
kotlin.targetFromPreset(hostPreset, NATIVE_TARGET_NAME) {
@Suppress("DEPRECATION")
compilations.getByName("main").kotlinOptions.freeCompilerArgs = benchmark.compilerOpts + project.compilerArgs
compilations.getByName("main").enableEndorsedLibs = true
configureNativeOutput(this@configureNativeTarget)
@@ -202,6 +203,7 @@ abstract class BenchmarkingPlugin: Plugin<Project> {
return result
}
@Suppress("DEPRECATION")
protected open fun getCompilerFlags(project: Project, nativeTarget: KotlinNativeTarget) =
compilerFlagsFromBinary(project) + nativeTarget.compilations.main.kotlinOptions.freeCompilerArgs.map { "\"$it\"" }
@@ -133,6 +133,7 @@ open class KotlinNativeBenchmarkingPlugin: BenchmarkingPlugin() {
private fun Project.configureJVMTarget() {
kotlin.jvm {
compilations.all {
@Suppress("DEPRECATION")
compileKotlinTask.kotlinOptions {
jvmTarget = "1.8"
suppressWarnings = true
+3 -1
View File
@@ -179,7 +179,9 @@ compileTestKotlin {
"-XXLanguage:+RangeUntilOperator",
]
// This is needed for JavaTypeTest; typeOf for non-reified type parameters doesn't work otherwise, for implementation reasons.
freeCompilerArgs.remove("-Xno-optimized-callable-references")
def args = new ArrayList(freeCompilerArgs)
args.remove("-Xno-optimized-callable-references")
freeCompilerArgs = args
}
}