Last active
March 7, 2024 18:52
-
-
Save ismai117/0a100a426e119c9c664be52a07ca2390 to your computer and use it in GitHub Desktop.
kmp sample / cocoapods setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl | |
plugins { | |
alias(libs.plugins.kotlinMultiplatform) | |
alias(libs.plugins.kotlinCocoapods) | |
alias(libs.plugins.androidLibrary) | |
alias(libs.plugins.jetbrainsCompose) | |
} | |
kotlin { | |
androidTarget() | |
jvm() | |
js { | |
browser() | |
binaries.executable() | |
} | |
@OptIn(ExperimentalWasmDsl::class) | |
wasmJs { | |
browser() | |
binaries.executable() | |
} | |
iosX64() | |
iosArm64() | |
iosSimulatorArm64() | |
cocoapods { | |
summary = "Some description for the Shared Module" | |
homepage = "Link to the Shared Module homepage" | |
version = "1.0" | |
ios.deploymentTarget = "17.2" | |
podfile = project.file("../iosApp/Podfile") | |
pod("lottie-ios") { | |
version = "4.4.0" | |
linkOnly = true | |
} | |
} | |
sourceSets { | |
val commonMain by getting { | |
dependencies { | |
implementation(compose.runtime) | |
implementation(compose.foundation) | |
implementation(compose.material3) | |
implementation(compose.materialIconsExtended) | |
implementation(compose.ui) | |
implementation(compose.components.resources) | |
api(project(":lib")) | |
} | |
} | |
val androidMain by getting { | |
dependencies { | |
api(libs.androidx.activityCompose) | |
api(libs.androidx.appcompat) | |
api(libs.androidx.core.ktx) | |
} | |
} | |
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 jvmMain by getting { | |
dependencies { | |
implementation(compose.desktop.common) | |
} | |
} | |
val jsMain by getting { | |
dependencies { | |
implementation(compose.html.core) | |
} | |
} | |
} | |
} | |
android { | |
compileSdk = libs.versions.android.compileSdk.get().toInt() | |
namespace = "com.myapplication.common" | |
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") | |
sourceSets["main"].res.srcDirs("src/androidMain/res") | |
sourceSets["main"].resources.srcDirs("src/commonMain/resources") | |
defaultConfig { | |
minSdk = libs.versions.android.minSdk.get().toInt() | |
} | |
compileOptions { | |
sourceCompatibility = JavaVersion.VERSION_17 | |
targetCompatibility = JavaVersion.VERSION_17 | |
} | |
kotlin { | |
jvmToolchain(17) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment