Skip to content

Commit

Permalink
Modify iOS target selection in gradle.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
wkal-pubnub committed Oct 8, 2024
1 parent 8f7e6c0 commit 63c7d04
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ class PubNubBaseKotlinMultiplatformPlugin : Plugin<Project> {
}


if (enableIosTarget) {
if (enableIosTargetOther) {
iosArm64()
iosX64()
}
if (enableIosSimulatorTarget) {
if (enableIosSimulatorArm64) {
iosSimulatorArm64()
iosX64()
}

applyDefaultHierarchyTemplate()
Expand Down Expand Up @@ -143,6 +143,6 @@ class PubNubBaseKotlinMultiplatformPlugin : Plugin<Project> {
}

val Project.enableJsTarget get() = project.findProperty("ENABLE_TARGET_JS") == "true"
val Project.enableIosTarget get() = project.findProperty("ENABLE_TARGET_IOS") == "true"
val Project.enableIosSimulatorTarget get() = project.findProperty("ENABLE_TARGET_IOS_SIMULATOR") == "true"
val Project.enableAnyIosTarget get() = enableIosTarget || enableIosSimulatorTarget
val Project.enableIosTargetOther get() = project.findProperty("ENABLE_TARGET_IOS_OTHER") == "true" || project.findProperty("ENABLE_TARGET_IOS_ALL") == "true"
val Project.enableIosSimulatorArm64 get() = project.findProperty("ENABLE_TARGET_IOS_SIMULATOR_ARM64") == "true" || project.findProperty("ENABLE_TARGET_IOS_ALL") == "true"
val Project.enableAnyIosTarget get() = enableIosTargetOther || enableIosSimulatorArm64
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ IOS_SIMULATOR_ID=iPhone 15 Pro
SWIFT_PATH=swift

ENABLE_TARGET_JS=true
ENABLE_TARGET_IOS=false
ENABLE_TARGET_IOS_SIMULATOR=true
ENABLE_TARGET_IOS_OTHER=false
ENABLE_TARGET_IOS_SIMULATOR_ARM64=true
# alternatively (e.g. for release):
# ENABLE_TARGET_IOS_ALL=true
22 changes: 1 addition & 21 deletions pubnub-kotlin/pubnub-kotlin-test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@

import com.codingfeline.buildkonfig.compiler.FieldSpec.Type
import com.pubnub.gradle.enableIosSimulatorTarget
import com.pubnub.gradle.enableIosTarget
import com.pubnub.gradle.enableJsTarget
import java.util.Properties

plugins {
alias(libs.plugins.benmanes.versions)
alias(libs.plugins.codingfeline.buildkonfig)
id("pubnub.shared")
id("pubnub.ios-simulator-test")
kotlin("multiplatform")
id("pubnub.base.multiplatform")
}

kotlin {
jvmToolchain(8)

if (enableJsTarget) {
js {
useEsModules()
browser()
nodejs()
}
}
jvm()
if (enableIosTarget) {
iosArm64()
}
if (enableIosSimulatorTarget) {
iosSimulatorArm64()
}

sourceSets {
val commonMain by getting {
dependencies {
Expand Down

0 comments on commit 63c7d04

Please sign in to comment.