Skip to content

Instantly share code, notes, and snippets.

@Alex009
Created November 22, 2021 15:39
Show Gist options
  • Save Alex009/6f8d47a925b75259341cab3356cd4d7a to your computer and use it in GitHub Desktop.
Save Alex009/6f8d47a925b75259341cab3356cd4d7a to your computer and use it in GitHub Desktop.
Welcome Feature Gradle Build File
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import dev.icerock.gradle.generator.FatFrameworkWithResourcesTask
plugins {
kotlin(module = "multiplatform")
id("com.android.library")
id("dev.icerock.mobile.multiplatform-resources")
}
multiplatformResources {
multiplatformResourcesPackage = "*PACKAGE_NAME*.feature_welcome"
iosBaseLocalizationRegion = "ru"
}
android {
compileSdk = 31
sourceSets["main"].manifest.srcFile(srcPath = "src/commonMain/AndroidManifest.xml")
defaultConfig {
minSdk = 21
targetSdk = 31
}
}
kotlin {
android()
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { target ->
target.binaries.framework {
baseName = "feature_welcome"
export(dependency = libs.moko.resources)
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(dependencyNotation = libs.moko.resources)
implementation(dependencyNotation = libs.decompose.common)
implementation(dependencyNotation = libs.bundles.mvikotlin.common)
}
}
}
tasks.register(name = "debugFatFramework", type = FatFrameworkWithResourcesTask::class) {
baseName = "multiplatform"
from(
mapOf<String, KotlinNativeTarget>(
"iosX64" to kotlin.targets.getByName(name = "iosX64"),
"iosArm64" to kotlin.targets.getByName(name = "iosArm64")
).toList().map { pair ->
pair.second.binaries.getFramework(
buildType = NativeBuildType.DEBUG
)
}
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment