fun targets()

in gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/NativeApplication.kt [24:47]


    fun targets(vararg targets: KotlinTarget) {
        val nonNativeTargets = arrayListOf<KotlinTarget>()
        val nonMacOSTargets = arrayListOf<KotlinNativeTarget>()
        for (target in targets) {
            if (target is KotlinNativeTarget) {
                if (target.konanTarget.family == Family.OSX) {
                    _targets.add(target)
                } else {
                    nonMacOSTargets.add(target)
                }
            } else {
                nonNativeTargets.add(target)
            }
        }

        check(nonNativeTargets.isEmpty() && nonMacOSTargets.isEmpty()) {
            buildString {
                appendLine("compose.nativeApplication.targets supports only Kotlin/Native macOS targets for now:")
                nonNativeTargets.forEach { appendLine("* '${it.name}' is not a native target;") }
                nonMacOSTargets.forEach { appendLine("* '${it.name}' is not a macOS target;") }
            }

        }
    }