[Gradle, JS] Remove Native Only isMainCompilation only

This commit is contained in:
Ilya Goncharov
2020-06-08 13:34:04 +03:00
parent 2d068a42f4
commit b72f7c3021
3 changed files with 4 additions and 7 deletions
@@ -199,7 +199,7 @@ open class KotlinNativeTargetConfigurator<T : KotlinNativeTarget>(
with(compilation) {
// Register the interop library as a dependency of the compilation to make IDE happy.
project.dependencies.add(compileDependencyConfigurationName, interopOutput)
if (isMainCompilation) {
if (isMain()) {
// Register the interop library as an outgoing klib to allow depending on projects with cinterops.
project.dependencies.add(target.apiElementsConfigurationName, interopOutput)
// Add the interop library in publication.
@@ -149,9 +149,6 @@ internal val KonanTarget.isCurrentHost: Boolean
internal val KonanTarget.enabledOnCurrentHost
get() = HostManager().isEnabled(this)
internal val AbstractKotlinNativeCompilation.isMainCompilation: Boolean
get() = isMain()
// KonanVersion doesn't provide an API to compare versions,
// so we have to transform it to KotlinVersion first.
// Note: this check doesn't take into account the meta version (release, eap, dev).
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -325,7 +325,7 @@ open class KotlinNativeCompile : AbstractKotlinNativeCompile<KotlinCommonOptions
@get:Internal
override val baseName: String
get() = if (compilation.isMainCompilation) project.name else "${project.name}_${compilation.name}"
get() = if (compilation.isMain()) project.name else "${project.name}_${compilation.name}"
@get:Input
val moduleName: String by project.provider {
@@ -940,7 +940,7 @@ open class CInteropProcess : DefaultTask() {
val baseKlibName: String
@Internal get() {
val compilationPrefix = settings.compilation.let {
if (it.isMainCompilation) project.name else it.name
if (it.isMain()) project.name else it.name
}
return "$compilationPrefix-cinterop-$interopName"
}