Dont add languageVersion for KotlinNativeLink tasks
#KT-61401: Fixed
This commit is contained in:
committed by
Space Team
parent
37aad51438
commit
c2ee9bb1a4
+37
@@ -303,6 +303,43 @@ class TryK2IT : KGPBaseTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@DisplayName("Native: check that only expected tasks use languageVersion")
|
||||
@NativeGradlePluginTests
|
||||
@GradleTest
|
||||
fun smokeTestForNativeTasks(gradleVersion: GradleVersion) {
|
||||
project("native-configuration-cache", gradleVersion) {
|
||||
enableTryK2()
|
||||
build("build") {
|
||||
if (HostManager.hostIsMac) {
|
||||
assertOutputContains(
|
||||
"""
|
||||
|##### 'kotlin.experimental.tryK2' results #####
|
||||
|:lib:compileCommonMainKotlinMetadata: 2.0 language version
|
||||
|:lib:compileKotlinIosArm64: 2.0 language version
|
||||
|:lib:compileKotlinIosSimulatorArm64: 2.0 language version
|
||||
|:lib:compileKotlinIosX64: 2.0 language version
|
||||
|:lib:compileKotlinLinuxX64: 2.0 language version
|
||||
|:lib:compileTestKotlinIosSimulatorArm64: 2.0 language version
|
||||
|:lib:compileTestKotlinIosX64: 2.0 language version
|
||||
|:lib:compileTestKotlinLinuxX64: 2.0 language version
|
||||
|##### 100% (8/8) tasks have been compiled with Kotlin 2.0 #####
|
||||
""".trimMargin().normalizeLineEndings()
|
||||
)
|
||||
} else {
|
||||
assertOutputContains(
|
||||
"""
|
||||
|##### 'kotlin.experimental.tryK2' results #####
|
||||
|:lib:compileKotlinLinuxX64: 2.0 language version
|
||||
|:lib:compileCommonMainKotlinMetadata: 2.0 language version
|
||||
|:lib:compileTestKotlinLinuxX64: 2.0 language version
|
||||
|##### 100% (3/3) tasks have been compiled with Kotlin 2.0 #####
|
||||
""".trimMargin().normalizeLineEndings()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun TestProject.enableTryK2() = gradleProperties.appendText(
|
||||
"""
|
||||
|
|
||||
|
||||
-1
@@ -73,7 +73,6 @@ private val Project.kotlinNativeCompilerJar: String
|
||||
else
|
||||
"$konanHome/konan/lib/kotlin-native.jar"
|
||||
|
||||
|
||||
internal abstract class KotlinNativeToolRunner(
|
||||
protected val toolName: String,
|
||||
private val settings: Settings,
|
||||
|
||||
+1
-1
@@ -356,7 +356,7 @@ constructor(
|
||||
fun compile() {
|
||||
val metricsReporter = metrics.get()
|
||||
|
||||
addBuildMetricsForTaskAction(metricsReporter = metricsReporter, languageVersion = parseLanguageVersion(externalDependenciesArgs)) {
|
||||
addBuildMetricsForTaskAction(metricsReporter = metricsReporter, languageVersion = null) {
|
||||
validatedExportedLibraries()
|
||||
|
||||
val output = outputFile.get()
|
||||
|
||||
+1
-1
@@ -1168,7 +1168,7 @@ abstract class CInteropProcess @Inject internal constructor(params: Params) :
|
||||
addAll(extraOpts)
|
||||
|
||||
}
|
||||
addBuildMetricsForTaskAction(buildMetrics, languageVersion = parseLanguageVersion(args)) {
|
||||
addBuildMetricsForTaskAction(buildMetrics, languageVersion = null) {
|
||||
outputFile.parentFile.mkdirs()
|
||||
KotlinNativeCInteropRunner.createExecutionContext(
|
||||
task = this,
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
||||
@get:Input val outputKind: CompilerOutputKind,
|
||||
private val objectFactory: ObjectFactory,
|
||||
private val execOperations: ExecOperations,
|
||||
private val projectLayout: ProjectLayout
|
||||
private val projectLayout: ProjectLayout,
|
||||
) : DefaultTask(),
|
||||
UsesBuildMetricsService,
|
||||
KotlinToolTask<KotlinCommonCompilerToolOptions> {
|
||||
@@ -183,7 +183,7 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
||||
@get:Internal
|
||||
val konanHome: Provider<String> = project.provider { project.konanHome }
|
||||
|
||||
private val runnerSettings = KotlinNativeCompilerRunner.Settings.of(konanHome.get(), konanDataDir.getOrNull(),project)
|
||||
private val runnerSettings = KotlinNativeCompilerRunner.Settings.of(konanHome.get(), konanDataDir.getOrNull(), project)
|
||||
|
||||
init {
|
||||
baseName.convention(project.name)
|
||||
|
||||
Reference in New Issue
Block a user