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(
|
private fun TestProject.enableTryK2() = gradleProperties.appendText(
|
||||||
"""
|
"""
|
||||||
|
|
|
|
||||||
|
|||||||
-1
@@ -73,7 +73,6 @@ private val Project.kotlinNativeCompilerJar: String
|
|||||||
else
|
else
|
||||||
"$konanHome/konan/lib/kotlin-native.jar"
|
"$konanHome/konan/lib/kotlin-native.jar"
|
||||||
|
|
||||||
|
|
||||||
internal abstract class KotlinNativeToolRunner(
|
internal abstract class KotlinNativeToolRunner(
|
||||||
protected val toolName: String,
|
protected val toolName: String,
|
||||||
private val settings: Settings,
|
private val settings: Settings,
|
||||||
|
|||||||
+1
-1
@@ -356,7 +356,7 @@ constructor(
|
|||||||
fun compile() {
|
fun compile() {
|
||||||
val metricsReporter = metrics.get()
|
val metricsReporter = metrics.get()
|
||||||
|
|
||||||
addBuildMetricsForTaskAction(metricsReporter = metricsReporter, languageVersion = parseLanguageVersion(externalDependenciesArgs)) {
|
addBuildMetricsForTaskAction(metricsReporter = metricsReporter, languageVersion = null) {
|
||||||
validatedExportedLibraries()
|
validatedExportedLibraries()
|
||||||
|
|
||||||
val output = outputFile.get()
|
val output = outputFile.get()
|
||||||
|
|||||||
+1
-1
@@ -1168,7 +1168,7 @@ abstract class CInteropProcess @Inject internal constructor(params: Params) :
|
|||||||
addAll(extraOpts)
|
addAll(extraOpts)
|
||||||
|
|
||||||
}
|
}
|
||||||
addBuildMetricsForTaskAction(buildMetrics, languageVersion = parseLanguageVersion(args)) {
|
addBuildMetricsForTaskAction(buildMetrics, languageVersion = null) {
|
||||||
outputFile.parentFile.mkdirs()
|
outputFile.parentFile.mkdirs()
|
||||||
KotlinNativeCInteropRunner.createExecutionContext(
|
KotlinNativeCInteropRunner.createExecutionContext(
|
||||||
task = this,
|
task = this,
|
||||||
|
|||||||
+2
-2
@@ -52,7 +52,7 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
|||||||
@get:Input val outputKind: CompilerOutputKind,
|
@get:Input val outputKind: CompilerOutputKind,
|
||||||
private val objectFactory: ObjectFactory,
|
private val objectFactory: ObjectFactory,
|
||||||
private val execOperations: ExecOperations,
|
private val execOperations: ExecOperations,
|
||||||
private val projectLayout: ProjectLayout
|
private val projectLayout: ProjectLayout,
|
||||||
) : DefaultTask(),
|
) : DefaultTask(),
|
||||||
UsesBuildMetricsService,
|
UsesBuildMetricsService,
|
||||||
KotlinToolTask<KotlinCommonCompilerToolOptions> {
|
KotlinToolTask<KotlinCommonCompilerToolOptions> {
|
||||||
@@ -183,7 +183,7 @@ abstract class KotlinNativeLinkArtifactTask @Inject constructor(
|
|||||||
@get:Internal
|
@get:Internal
|
||||||
val konanHome: Provider<String> = project.provider { project.konanHome }
|
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 {
|
init {
|
||||||
baseName.convention(project.name)
|
baseName.convention(project.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user