Skip to content

Commit

Permalink
Delete android native target.
Browse files Browse the repository at this point in the history
  • Loading branch information
terrakok committed Apr 4, 2022
1 parent 33ccc9f commit 7759118
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ kotlin {
Target.ANDROID -> "android()"
Target.JVM -> if (projectInfo.gradlePlugins.contains(GradlePlugin.APPLICATION)) "jvm {\n withJava()\n }" else "jvm()"
Target.JS -> "js {\n browser()\n nodejs()\n }"
Target.ANDROID_NATIVE -> "androidNativeArm64()"
Target.LINUX -> "linuxX64()"
Target.MACOS -> "macosX64()\n macosArm64()"
Target.IOS -> "iosX64()\n iosArm64()\n iosSimulatorArm64()"
Expand Down Expand Up @@ -135,7 +134,6 @@ kotlin {
Target.ANDROID -> singleSourceSet(Target.ANDROID, compilation, GETTING)
Target.JVM -> singleSourceSet(Target.JVM, compilation, GETTING)
Target.JS -> singleSourceSet(Target.JS, compilation, GETTING)
Target.ANDROID_NATIVE -> "val androidNativeArm64$compilation by getting"
Target.LINUX -> "val linuxX64$compilation by getting"
Target.MACOS -> "val macosX64$compilation by getting ${intention}val macosArm64$compilation by getting"
Target.IOS -> "val iosX64$compilation by getting ${intention}val iosArm64$compilation by getting${intention}val iosSimulatorArm64$compilation by getting"
Expand All @@ -152,7 +150,6 @@ kotlin {
Target.ANDROID -> NAN
Target.JVM -> NAN
Target.JS -> NAN
Target.ANDROID_NATIVE -> "val androidNative$compilation by creating"
Target.LINUX -> "val linux$compilation by creating"
Target.MACOS -> "val macos$compilation by creating"
Target.IOS -> singleSourceSet(Target.IOS, compilation, CREATING)
Expand All @@ -169,7 +166,6 @@ kotlin {
Target.ANDROID -> "android$compilation.dependsOn(common$compilation)"
Target.JVM -> "jvm$compilation.dependsOn(common$compilation)"
Target.JS -> "js$compilation.dependsOn(common$compilation)"
Target.ANDROID_NATIVE -> "androidNative$compilation.dependsOn(native$compilation) ${intention}androidNativeArm64$compilation.dependsOn(androidNative$compilation)"
Target.LINUX -> "linux$compilation.dependsOn(native$compilation)${intention}linuxX64$compilation.dependsOn(linux$compilation)"
Target.MACOS -> "macos$compilation.dependsOn(native$compilation)${intention}macosX64$compilation.dependsOn(macos$compilation)${intention}macosArm64$compilation.dependsOn(macos$compilation)"
Target.IOS -> "ios$compilation.dependsOn(native$compilation)${intention}iosX64$compilation.dependsOn(ios$compilation)${intention}iosArm64$compilation.dependsOn(ios$compilation)${intention}iosSimulatorArm64$compilation.dependsOn(ios$compilation)"
Expand Down
17 changes: 2 additions & 15 deletions src/commonMain/kotlin/org/jetbrains/webwiz/models/Targets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,10 @@ enum class Target(val targetName: String, val userName: String) {
WATCH_OS("watchos", "watchOS"),
LINUX("linux", "Linux"),
MACOS("macos", "macOS"),
WINDOWS("windows", "Windows"),
ANDROID_NATIVE("androidNative", "Android Native")
WINDOWS("windows", "Windows")
}

private val NativeTargets = setOf(
Target.ANDROID_NATIVE,
Target.LINUX,
Target.MACOS,
Target.IOS,
Target.TV_OS,
Target.WATCH_OS,
Target.WINDOWS
)

private val CommonNativeTargets = setOf(
Target.LINUX,
Target.MACOS,
Target.IOS,
Expand All @@ -35,6 +24,4 @@ private val CommonNativeTargets = setOf(
fun Target.isJvm() = this in setOf(Target.JVM, Target.ANDROID)

fun Set<Target>.isNativeTargetPresent() = this.any { it in NativeTargets }
fun Set<Target>.isCommonNativeTargetPresent() = this.any { it in CommonNativeTargets }
fun Set<Target>.isAndroidTargetPresent() = this.any { it == Target.ANDROID }
fun Set<Target>.isJvmTargetPresent() = this.any { it.isJvm() }
fun Set<Target>.isCommonNativeTargetPresent() = this.filter { it in NativeTargets }.size > 1

0 comments on commit 7759118

Please sign in to comment.