Allen
05/22/2022, 7:50 PMplugins {
kotlin("multiplatform") version "1.6.21"
kotlin("native.cocoapods") version "1.6.21"
id("com.android.library")
id("maven-publish")
}
val libraryVersion = "0.0.4"
var libraryGroup = "com.ab"
var libraryArtifactId = "kmm-module"
repositories {
google()
mavenCentral()
}
kotlin {
android {
publishLibraryVariants("release", "debug")
}
cocoapods {
// Required properties
// Specify the required Pod version here. Otherwise, the Gradle project version is used.
version = "0.0.1"
summary = "Some description for a Kotlin/Native module"
homepage = "Link to a Kotlin/Native module homepage"
// Optional properties
// Configure the Pod name here instead of changing the Gradle project name
name = "MyCocoaPod"
framework {
// Required properties
// Framework name configuration. Use this property instead of deprecated 'frameworkName'
baseName = "MyFramework"
// Optional properties
// Dynamic framework support
isStatic = false
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
sourceSets {
val commonMain by getting
val androidMain by getting
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
}
}
}
ribesg
05/23/2022, 9:33 AMbuild
task should generate multiple frameworks in your build
folder but you shouldn’t have to care about that. You just need to setup your kmm lib as a cocoapods dependency in your XCode project, like any other normal cocoapods dependency you could have in a normal XCode project.xcodeproj
and .xcworkspace
folders, you should have a Podfile
with something like pod "yourKmmLib", :path => './path/to/folder/containging/podspec'
and then run pod install
in thereVivek Modi
05/23/2022, 11:01 AMframework
+ publish
folder. Actually I want to create private pod repo. So what should I need to share in that repo with .podspec
file?ribesg
05/23/2022, 12:39 PMAllen
05/23/2022, 1:54 PMmatej
08/11/2022, 1:12 PM