Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Some build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz committed Apr 4, 2022
1 parent 97765d4 commit 42e8c4f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
34 changes: 16 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
Expand Down Expand Up @@ -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("<meta http-equiv=\"refresh\" content=\"0; url=${project.name}\">\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("<meta http-equiv=\"refresh\" content=\"0; url=${project.name}\">\n")
}
}
}
Expand Down Expand Up @@ -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")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 42e8c4f

Please sign in to comment.