Skip to content

Commit 4fd99fd

Browse files
AYastrebovSpace Team
authored andcommitted
[Gradle] Workaround for not completable Future with cross compilation
^KT-81134
1 parent 677ddd7 commit 4fd99fd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/publishing/Publishing.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private fun createTargetPublications(project: Project, publishing: PublishingExt
7272
.withType(InternalKotlinTarget::class.java)
7373
.matching { kotlinTarget ->
7474
when (kotlinTarget) {
75-
is KotlinNativeTarget -> kotlinTarget.crossCompilationPublishable
75+
is KotlinNativeTarget -> kotlinTarget.publishableWithFallback
7676
else -> kotlinTarget.publishable
7777
}
7878
}

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTarget.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ abstract class KotlinNativeTarget @Inject constructor(
108108
get() = disambiguateName("binaries")
109109

110110
override val publishable: Boolean
111-
get() = crossCompilationOnCurrentHostSupported.getOrThrow()
111+
get() = publishableWithFallback
112112

113113
override val compilerOptions: KotlinNativeCompilerOptions = project.objects
114114
.newInstance<KotlinNativeCompilerOptionsDefault>()

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeTargetPreset.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ internal val AbstractKotlinNativeCompilation.crossCompilationOnCurrentHostSuppor
138138
else -> project.future { true }
139139
}
140140

141-
// The same as `KotlinNativeTarget.publishable`, but with a fallback to `enabledOnCurrentHostForKlibCompilation`
141+
// KT-81134 with a fallback to `enabledOnCurrentHostForKlibCompilation`
142142
@Suppress("DEPRECATION")
143-
internal val KotlinNativeTarget.crossCompilationPublishable: Boolean
143+
internal val KotlinNativeTarget.publishableWithFallback: Boolean
144144
get() = crossCompilationOnCurrentHostSupported.lenient.getOrNull()
145145
?: konanTarget.enabledOnCurrentHostForKlibCompilation(project.kotlinPropertiesProvider)
146146

0 commit comments

Comments
 (0)