From 42e8c4f2c9e0b33437b03dc6ffcfb2ee92bc5591 Mon Sep 17 00:00:00 2001 From: soywiz Date: Mon, 4 Apr 2022 10:43:37 +0200 Subject: [PATCH] Some build fixes --- build.gradle.kts | 34 +++++++++---------- .../com/soywiz/korlibs/modules/Targets.kt | 2 +- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9f6f63b2c..d0847f822 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,6 +28,8 @@ buildscript { plugins { java kotlin("multiplatform") + id("org.jetbrains.kotlinx.kover") version "0.5.0" apply false + id("org.jetbrains.dokka") version "1.6.10" apply false signing `maven-publish` } @@ -138,24 +140,20 @@ subprojects { } } - // @TODO: When Kotlin/Native is enabled: - // @TODO: Cannot change dependencies of dependency configuration ':kbignum:iosArm64MainImplementationDependenciesMetadata' after task dependencies have been resolved - if (!doEnableKotlinNative && !doEnableKotlinMobile) { - if (!isSample) { - apply(plugin = "org.jetbrains.dokka") - - tasks { - val dokkaCopy by creating(Task::class) { - dependsOn("dokkaHtml") - doLast { - val ffrom = File(project.buildDir, "dokka/html") - val finto = File(project.rootProject.projectDir, "build/dokka-all/${project.name}") - copy { - from(ffrom) - into(finto) - } - File(finto, "index.html").writeText("\n") + if (!isSample && rootProject.plugins.hasPlugin("org.jetbrains.dokka")) { + apply(plugin = "org.jetbrains.dokka") + + tasks { + val dokkaCopy by creating(Task::class) { + dependsOn("dokkaHtml") + doLast { + val ffrom = File(project.buildDir, "dokka/html") + val finto = File(project.rootProject.projectDir, "build/dokka-all/${project.name}") + copy { + from(ffrom) + into(finto) } + File(finto, "index.html").writeText("\n") } } } @@ -586,7 +584,7 @@ internal var _webServer: DecoratedHttpServer? = null samples { // @TODO: Patch, because runDebugReleaseExecutableMacosArm64 is not created! - if (isMacos && isArm) { + if (isMacos && isArm && doEnableKotlinNative) { project.tasks { afterEvaluate { for (kind in listOf("Debug", "Release")) { diff --git a/buildSrc/src/main/kotlin/com/soywiz/korlibs/modules/Targets.kt b/buildSrc/src/main/kotlin/com/soywiz/korlibs/modules/Targets.kt index cd60f2703..4ae925b9b 100644 --- a/buildSrc/src/main/kotlin/com/soywiz/korlibs/modules/Targets.kt +++ b/buildSrc/src/main/kotlin/com/soywiz/korlibs/modules/Targets.kt @@ -8,7 +8,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.* val Project.supportKotlinNative: Boolean get() { // Linux and Windows ARM hosts doesn't have K/N toolchains if ((isLinux || isWindows) && isArm) return false - return false + return true } val Project.doEnableKotlinNative: Boolean get() = supportKotlinNative && rootProject.findProperty("enableKotlinNative") == "true"