Saturday, November 21, 2026
HomeiOS Developmentkotlin - Find out how to publish KMM library iOS binary (obfuscated)...

kotlin – Find out how to publish KMM library iOS binary (obfuscated) to a personal repo

[ad_1]

I’ve a KMM library for each Android and iOS. I’m attempting publish the iOS binary to a personal repo.
I’ve 2 objectives:

  1. An username and password ought to be required to make use of this library in XCode initiatives.
  2. The supply ought to be obfuscated, in order that XCode consumer will not be in a position to see the supply codes.

Right here is my construct.gradle.kts file at this second:

plugins {
    kotlin("multiplatform")
    kotlin("native.cocoapods")
    id("com.android.library")
    id("maven-publish")
}

group = "com.instance.lib"
model = "1.0"

kotlin {
    android()
    iosX64()
    iosArm64()
    iosSimulatorArm64()

    cocoapods {
        abstract = "Some description for the Shared Module"
        homepage = ""
        ios.deploymentTarget = "14.1"
        framework {
            baseName = "testlib"
        }
    }
    
    sourceSets {
        val commonMain by getting
        val commonTest by getting {
            dependencies {
                implementation(kotlin("take a look at"))
            }
        }
        val androidMain by getting
        val androidTest 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)
        }
        val iosX64Test by getting
        val iosArm64Test by getting
        val iosSimulatorArm64Test by getting
        val iosTest by creating {
            dependsOn(commonTest)
            iosX64Test.dependsOn(this)
            iosArm64Test.dependsOn(this)
            iosSimulatorArm64Test.dependsOn(this)
        }
    }
}

android {
    compileSdk = 32
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    defaultConfig {
        minSdk = 21
        targetSdk = 32
    }
}

I’m an Android developer. So have very restricted information about iOS. It will be nice when you can share how I can obtain these 2 objectives.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments