Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ val Project.hasDesktop: Boolean get() = hasNative || files.any { it.name == "des
val Project.hasLinux: Boolean get() = hasNative || hasJvmAndNative || files.any { it.name == "linux" }
val Project.hasApple: Boolean get() = hasNative || hasJvmAndNative || files.any { it.name == "apple" }
val Project.hasWindows: Boolean get() = hasNative || files.any { it.name == "windows" }
val Project.hasPosix: Boolean get() = hasNative || hasJvmAndNative || files.any { it.name == "posix" }

/**
* Test if a project follows the convention and needs configured for KMP (used in handful of spots where we have a
* subproject that is just a container for other projects but isn't a KMP project itself).
*/
val Project.needsKmpConfigured: Boolean get() = hasCommon || hasJvm || hasNative || hasJs || hasJvmAndNative || hasDesktop || hasLinux || hasApple || hasWindows
val Project.needsKmpConfigured: Boolean get() = hasCommon || hasJvm || hasNative || hasJs || hasJvmAndNative || hasDesktop || hasLinux || hasApple || hasWindows || hasPosix

@OptIn(ExperimentalKotlinGradlePluginApi::class)
fun Project.configureKmpTargets() {
Expand Down Expand Up @@ -96,6 +97,16 @@ fun Project.configureKmpTargets() {
}
}
}

if (hasPosix) {
common {
group("posix") {
// Linux and Apple but NOT Mingw/Windows
withLinux()
withMacos()
}
}
}
}

// enable the targets
Expand Down
Loading