在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):icerockdev/mobile-multiplatform-gradle-plugin开源软件地址(OpenSource Url):https://github.com/icerockdev/mobile-multiplatform-gradle-plugin开源编程语言(OpenSource Language):Kotlin 100.0%开源软件介绍(OpenSource Introduction):Mobile Multiplatform gradle pluginThis is a Gradle plugin for simple setup of Kotlin Multiplatform mobile Gradle modules. Setup
repositories {
google()
gradlePluginPortal()
}
dependencies {
implementation("dev.icerock:mobile-multiplatform:0.14.1")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
implementation("com.android.tools.build:gradle:7.0.4")
} UsageSetup mobile targets without config
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.multiplatform")
id("dev.icerock.mobile.multiplatform.targets")
} Plugin automatically setup android, ios targets.
Android target also automatically configured with By default used
Also by default
Setup AndroidManifest.xml in androidMain sourceSet
plugins {
id("dev.icerock.mobile.multiplatform.android-manifest")
} After enable this plugin you can move Setup android sourceSets in android prefixed source sets
plugins {
id("dev.icerock.mobile.multiplatform.android-sources")
} After enable this plugin you can move android's Setup cocoapods integration for iOS
plugins {
id("dev.icerock.mobile.multiplatform.ios-framework")
} Plugin will setup Example of Add artifacts to export// optional for export dependencies into framework header
framework {
export(project = project(":myproject"))
export(kotlinNativeExportable = MultiPlatfomLibrary(<...>))
export(kotlinNativeExportable = MultiPlatfomModule(<...>))
export(arm64Dependency = "my.group:name-iosarm64:0.1.0", x64Dependency = "my.group:name-iosx64:0.1.0")
export(artifact = "my.group:name:0.1.0") // common artifact
export(provider = libs.myLib) // gradle 7 version catalog libraries accessors
} Setup cocoapods integration for all Apple frameworks
plugins {
id("dev.icerock.mobile.multiplatform.apple-framework")
} with Setup CocoaPods interop
plugins {
id("dev.icerock.mobile.multiplatform.cocoapods")
}
cocoaPods {
podsProject = file("../ios-app/Pods/Pods.xcodeproj") // here should be path to your Pods project
buildConfiguration = "dev-debug" // optional, default is "debug"
pod("MBProgressHUD") // create cInterop and link with CocoaPod where schema and module is same
pod(schema = "moko-widgets-flat", module = "mokoWidgetsFlat") // create cInterop and link with CocoaPod where schema and module is different
pod(schema = "moko-widgets-flat", module = "mokoWidgetsFlat", onlyLink = true) // not create cInterop - just link framework with this CocoaPod
} Also path to Pods project and configuration can be set globally into mobile.multiplatform.podsProject=ios-app/Pods/Pods.xcodeproj
mobile.multiplatform.podsConfiguration=dev-debug
Multiple plugins in one line (deprecated, saved for backward compatibility)plugins {
id("dev.icerock.mobile.multiplatform")
} This line will enable:
Definition of dependencies (deprecated, saved for backward compatibility)val mokoTime = MultiPlatformLibrary(
android = "dev.icerock.moko:time-android:0.1.0",
common = "dev.icerock.moko:time:0.1.0",
iosX64 = "dev.icerock.moko:time-iosx64:0.1.0",
iosArm64 = "dev.icerock.moko:time-iosarm64:0.1.0"
)
val appCompat = AndroidLibrary(
name = "androidx.appcompat:appcompat:1.1.0"
)
val myFeature = MultiPlatformModule(
name = ":mpp-library:feature:myFeature"
) Setup dependencies (deprecated, saved for backward compatibility)
dependencies {
mppLibrary(mokoTime)
androidLibrary(appCompat)
mppModule(myFeature)
} License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论