From f418a101bf382224379f2db6d17b4e808bc6b66f Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 27 Nov 2020 10:49:39 +0300 Subject: [PATCH] minor fix --- build.gradle.kts | 2 +- src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt | 4 ++-- src/main/kotlin/ru/mipt/npm/gradle/KScienceMPPlugin.kt | 3 ++- .../kotlin/ru/mipt/npm/gradle/KSciencePublishPlugin.kt | 8 ++++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8317e59..b1cc4a8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "ru.mipt.npm" -version = "0.7.0" +version = "0.7.0-fix" repositories { gradlePluginPortal() diff --git a/src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt b/src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt index 305c2f3..2837af4 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/KScienceExtension.kt @@ -86,8 +86,8 @@ class KScienceExtension(val project: Project) { js { binaries.executable() } - (targets.findByName("native") as? KotlinNativeTarget)?.apply { - binaries.executable() + targets.filterIsInstance().forEach { + it.binaries.executable() } } } diff --git a/src/main/kotlin/ru/mipt/npm/gradle/KScienceMPPlugin.kt b/src/main/kotlin/ru/mipt/npm/gradle/KScienceMPPlugin.kt index 92a97d3..167d9b9 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/KScienceMPPlugin.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/KScienceMPPlugin.kt @@ -7,8 +7,9 @@ import org.gradle.kotlin.dsl.apply open class KScienceMPPlugin : Plugin { override fun apply(project: Project): Unit = project.run { if (plugins.findPlugin("org.jetbrains.kotlin.multiplatform") == null) { - logger.info("Kotlin multiplatform plugin is not resolved. Adding it automatically") pluginManager.apply("org.jetbrains.kotlin.multiplatform") + } else { + logger.info("Kotlin MPP plugin is already present") } plugins.apply(KScienceCommonPlugin::class) } diff --git a/src/main/kotlin/ru/mipt/npm/gradle/KSciencePublishPlugin.kt b/src/main/kotlin/ru/mipt/npm/gradle/KSciencePublishPlugin.kt index 4e9661c..51fce36 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/KSciencePublishPlugin.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/KSciencePublishPlugin.kt @@ -14,6 +14,14 @@ open class KSciencePublishPlugin : Plugin { override fun apply(project: Project): Unit = project.run { plugins.apply("maven-publish") +// plugins.withId("org.jetbrains.kotlin.jvm"){ +// extensions.findByType()?.apply { +// withSourcesJar() +// //withJavadocJar() +// } +// } + + afterEvaluate { val githubOrg: String = project.findProperty("githubOrg") as? String ?: "mipt-npm" val githubProject: String? by project