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

Commit

Permalink
Try to fix krypto build without cinterop commonization
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz-invideo committed Mar 3, 2022
1 parent b54da9c commit 8b80e2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -398,17 +398,19 @@ subprojects {
}
}

run {
val nativeInteropMainFolder = file("src/nativeInteropMain/kotlin")
for (baseName in listOf("nativeInteropMain", "posixInteropMain")) {
val nativeInteropMainFolder = file("src/$baseName/kotlin")
if (nativeInteropMainFolder.isDirectory) {
val currentNativeTarget = currentPlatformNativeTarget(project)
// @TODO: Copy instead of use the same source folder
for (target in allNativeTargets(project)) {
if (baseName.contains("Posix") && !target.isPosix) continue

val sourceSet = this@sourceSets.maybeCreate("${target.name}Main")
val folder = when {
target == currentNativeTarget -> nativeInteropMainFolder
else -> {
file("build/nativeInteropMainCopy${target.name}").also { outFolder ->
file("build/${baseName}Copy${target.name}").also { outFolder ->
outFolder.mkdirs()
copy {
from(nativeInteropMainFolder)
Expand All @@ -422,7 +424,6 @@ subprojects {
}
}


// Copy test resources
afterEvaluate {
for (targetV in nativeTargets) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ val KotlinTarget.isTvosX64: Boolean get() = this.name == "tvosX64"
val KotlinTarget.isTvosArm64: Boolean get() = this.name == "tvosArm64"
val KotlinTarget.isTvos: Boolean get() = isTvosX64 || isTvosArm64
val KotlinTarget.isDesktop: Boolean get() = isWin || isLinux || isMacos
val KotlinTarget.isPosix: Boolean get() = this is KotlinNativeTarget && !this.isWin

val isWindows: Boolean get() = org.apache.tools.ant.taskdefs.condition.Os.isFamily(org.apache.tools.ant.taskdefs.condition.Os.FAMILY_WINDOWS)
val isMacos: Boolean get() = org.apache.tools.ant.taskdefs.condition.Os.isFamily(org.apache.tools.ant.taskdefs.condition.Os.FAMILY_MAC)
Expand Down

0 comments on commit 8b80e2e

Please sign in to comment.