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 // Common outputs will also produce '${project.name}.kotlin_module' file, so we need to avoid
// files clash // files clash
tasks.named<KotlinCompile>("compile${commonSourceSet.name.replaceFirstChar { it.uppercase() }}Kotlin") { tasks.named<KotlinCompile>("compile${commonSourceSet.name.replaceFirstChar { it.uppercase() }}Kotlin") {
@Suppress("DEPRECATION")
kotlinOptions { kotlinOptions {
moduleName = "${this@createGradleCommonSourceSet.name}_${commonSourceSet.name}" 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 // 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") { tasks.named<KotlinCompile>("compile${variantSourceSet.name.replaceFirstChar { it.uppercase() }}Kotlin") {
@Suppress("DEPRECATION")
kotlinOptions { kotlinOptions {
moduleName = this@createGradlePluginVariant.name moduleName = this@createGradlePluginVariant.name
} }
@@ -515,6 +517,7 @@ private fun Project.commonVariantAttributes(): Action<Configuration> = Action<Co
} }
fun Project.configureKotlinCompileTasksGradleCompatibility() { fun Project.configureKotlinCompileTasksGradleCompatibility() {
@Suppress("DEPRECATION")
tasks.withType<KotlinCompile>().configureEach { tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.languageVersion = "1.4" kotlinOptions.languageVersion = "1.4"
kotlinOptions.apiVersion = "1.4" kotlinOptions.apiVersion = "1.4"
+2
View File
@@ -123,6 +123,7 @@ fun KotlinCompile.configureTaskToolchain(
) )
) )
) )
@Suppress("DEPRECATION")
kotlinOptions { kotlinOptions {
jvmTarget = jdkVersion.targetName jvmTarget = jdkVersion.targetName
} }
@@ -165,6 +166,7 @@ fun Project.updateJvmTarget(
.withType<KotlinCompile>() .withType<KotlinCompile>()
.matching { it.name != "compileJava9Kotlin" } .matching { it.name != "compileJava9Kotlin" }
.configureEach { .configureEach {
@Suppress("DEPRECATION")
kotlinOptions.jvmTarget = jvmTarget kotlinOptions.jvmTarget = jvmTarget
} }
@@ -22,6 +22,7 @@ fun Project.configureJava9Compilation(
tasks.named("compileJava9Kotlin", KotlinCompile::class.java) { tasks.named("compileJava9Kotlin", KotlinCompile::class.java) {
configureTaskToolchain(JdkMajorVersion.JDK_9) configureTaskToolchain(JdkMajorVersion.JDK_9)
@Suppress("DEPRECATION")
kotlinOptions.jvmTarget = JdkMajorVersion.JDK_9.targetName kotlinOptions.jvmTarget = JdkMajorVersion.JDK_9.targetName
} }
@@ -115,6 +115,7 @@ fun Project.configureKotlinCompilationOptions() {
val useFirIC by extra(project.kotlinBuildProperties.useFirTightIC) val useFirIC by extra(project.kotlinBuildProperties.useFirTightIC)
val renderDiagnosticNames by extra(project.kotlinBuildProperties.renderDiagnosticNames) val renderDiagnosticNames by extra(project.kotlinBuildProperties.renderDiagnosticNames)
@Suppress("DEPRECATION")
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach { tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
kotlinOptions { kotlinOptions {
languageVersion = kotlinLanguageVersion languageVersion = kotlinLanguageVersion
@@ -127,8 +128,10 @@ fun Project.configureKotlinCompilationOptions() {
!kotlinBuildProperties.getBoolean("kotlin.build.use.absolute.paths.in.klib") !kotlinBuildProperties.getBoolean("kotlin.build.use.absolute.paths.in.klib")
} }
// Workaround to avoid remote build cache misses due to absolute paths in relativePathBaseArg
doFirst { doFirst {
if (relativePathBaseArg != null) { if (relativePathBaseArg != null) {
@Suppress("DEPRECATION")
kotlinOptions.freeCompilerArgs += relativePathBaseArg kotlinOptions.freeCompilerArgs += relativePathBaseArg
} }
} }
+1
View File
@@ -333,6 +333,7 @@ fun Project.confugureFirPluginAnnotationsDependency(testTask: TaskProvider<Test>
} }
fun Project.optInToExperimentalCompilerApi() { fun Project.optInToExperimentalCompilerApi() {
@Suppress("DEPRECATION")
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach { tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().configureEach {
kotlinOptions { kotlinOptions {
freeCompilerArgs += "-opt-in=org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi" freeCompilerArgs += "-opt-in=org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi"
@@ -162,6 +162,7 @@ abstract class BenchmarkingPlugin: Plugin<Project> {
protected fun Project.configureNativeTarget(hostPreset: AbstractKotlinNativeTargetPreset<*>) { protected fun Project.configureNativeTarget(hostPreset: AbstractKotlinNativeTargetPreset<*>) {
kotlin.targetFromPreset(hostPreset, NATIVE_TARGET_NAME) { kotlin.targetFromPreset(hostPreset, NATIVE_TARGET_NAME) {
@Suppress("DEPRECATION")
compilations.getByName("main").kotlinOptions.freeCompilerArgs = benchmark.compilerOpts + project.compilerArgs compilations.getByName("main").kotlinOptions.freeCompilerArgs = benchmark.compilerOpts + project.compilerArgs
compilations.getByName("main").enableEndorsedLibs = true compilations.getByName("main").enableEndorsedLibs = true
configureNativeOutput(this@configureNativeTarget) configureNativeOutput(this@configureNativeTarget)
@@ -202,6 +203,7 @@ abstract class BenchmarkingPlugin: Plugin<Project> {
return result return result
} }
@Suppress("DEPRECATION")
protected open fun getCompilerFlags(project: Project, nativeTarget: KotlinNativeTarget) = protected open fun getCompilerFlags(project: Project, nativeTarget: KotlinNativeTarget) =
compilerFlagsFromBinary(project) + nativeTarget.compilations.main.kotlinOptions.freeCompilerArgs.map { "\"$it\"" } compilerFlagsFromBinary(project) + nativeTarget.compilations.main.kotlinOptions.freeCompilerArgs.map { "\"$it\"" }
@@ -133,6 +133,7 @@ open class KotlinNativeBenchmarkingPlugin: BenchmarkingPlugin() {
private fun Project.configureJVMTarget() { private fun Project.configureJVMTarget() {
kotlin.jvm { kotlin.jvm {
compilations.all { compilations.all {
@Suppress("DEPRECATION")
compileKotlinTask.kotlinOptions { compileKotlinTask.kotlinOptions {
jvmTarget = "1.8" jvmTarget = "1.8"
suppressWarnings = true suppressWarnings = true
+3 -1
View File
@@ -179,7 +179,9 @@ compileTestKotlin {
"-XXLanguage:+RangeUntilOperator", "-XXLanguage:+RangeUntilOperator",
] ]
// This is needed for JavaTypeTest; typeOf for non-reified type parameters doesn't work otherwise, for implementation reasons. // 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
} }
} }