Alberto
12/03/2022, 4:42 PMkotlin {
android {
publishLibraryVariants("release")
}
val xcf = XCFramework(rootProject.name)
val nativeTargets = listOf(iosArm64(),iosX64())
nativeTargets.forEach { target ->
target.binaries.framework {
baseName = rootProject.name
xcf.add(this)
transitiveExport = true
}
target.binaries.staticLib {
baseName = rootProject.name
}
target.binaries.all {
linkerOpts("-framework","MqttWrapper","-F/build/cocoapods/publish/release/shared.xcframework")
}
}
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
ios.deploymentTarget = "14.1"
podfile = project.file("../appIos/Podfile")
framework {
baseName = "shared"
isStatic = true
embedBitcode(org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode.DISABLE)
}
pod("MqttWrapper") {
version = "0.1.9"
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.kotlin.coroutinesCore)
implementation(libs.kotlin.datetime)
}
}
val commonTest by getting {
dependencies {
implementation(libs.kotlin.testCoroutines)
implementation(kotlin("test"))
implementation(kotlin("test-common"))
}
}
val androidMain by getting {
dependencies{
implementation(libs.hivemq)
}
}
val androidTest by getting
//val iosSimulatorArm64Main by getting
val iosArm64Main by getting
val iosX64Main by getting
val iosMain by creating {
dependsOn(commonMain)
//iosSimulatorArm64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosX64Main.dependsOn(this)
}
val iosTest by creating {
dependsOn(commonTest)
}
}
}
Anmol Verma
12/03/2022, 6:29 PM