@@ -20,21 +20,21 @@ dependencies {
2020```
2121
2222## Usage
23- ### Setup gradle module as mobile multiplatform
23+ ### Setup mobile targets without config
2424` build.gradle.kts `
2525``` kotlin
2626plugins {
2727 id(" com.android.library" )
2828 id(" org.jetbrains.kotlin.multiplatform" )
29- id(" dev.icerock.mobile.multiplatform" )
29+ id(" dev.icerock.mobile.multiplatform.targets " )
3030}
3131```
32- Plugin automatically setup android, ios targets.
33- For Android setup sourceset path to ` androidMain ` .
34- For iOS setup ` sync ` gradle tasks in group ` cocoapods ` for ` cocoapods ` integration .
32+
33+ Plugin automatically setup android, ios targets.
34+ For Android setup sourceSet path to ` androidMain ` .
3535
3636By default used ` ios() ` targets creation with intermediate source set ` iosMain ` . To disable it add
37- into ` gradle.properties ` line:
37+ into ` gradle.properties ` line:
3838```
3939mobile.multiplatform.useIosShortcut=false
4040```
@@ -44,41 +44,20 @@ To disable warning about used ios targets add into `gradle.properties` line:
4444mobile.multiplatform.iosTargetWarning=false
4545```
4646
47- ### Definition of dependencies
48- ``` kotlin
49- val mokoTime = MultiPlatformLibrary (
50- android = " dev.icerock.moko:time-android:0.1.0" ,
51- common = " dev.icerock.moko:time:0.1.0" ,
52- iosX64 = " dev.icerock.moko:time-iosx64:0.1.0" ,
53- iosArm64 = " dev.icerock.moko:time-iosarm64:0.1.0"
54- )
55-
56- val appCompat = AndroidLibrary (
57- name = " androidx.appcompat:appcompat:1.1.0"
58- )
59-
60- val myFeature = MultiPlatformModule (
61- name = " :mpp-library:feature:myFeature"
62- )
63- ```
64-
65- ### Setup dependencies
66- ` build.gradle.kts `
67- ``` kotlin
68- dependencies {
69- mppLibrary(mokoTime)
70- androidLibrary(appCompat)
71- mppModule(myFeature)
72- }
73- ```
74-
75- ### Setup export as iOS framework
47+ ### Setup cocoapods integration for iOS
7648` build.gradle.kts `
7749``` kotlin
7850plugins {
7951 id(" dev.icerock.mobile.multiplatform.ios-framework" )
8052}
53+ ```
54+
55+ Plugin will setup ` sync ` gradle tasks in group ` cocoapods ` for ` cocoapods ` integration.
8156
57+ Example of ` podspec ` for integration here - https://github.com/icerockdev/moko-template/blob/master/mpp-library/MultiPlatformLibrary.podspec
58+
59+ #### Add artifacts to export
60+ ``` kotlin
8261// optional for export dependencies into framework header
8362framework {
8463 export(project = project(" :myproject" ))
@@ -88,17 +67,23 @@ framework {
8867}
8968```
9069
91- ### Setup sync task for all Apple frameworks
70+ ### Setup cocoapods integration for all Apple frameworks
9271` build.gradle.kts `
9372``` kotlin
9473plugins {
9574 id(" dev.icerock.mobile.multiplatform.apple-framework" )
9675}
9776```
9877
78+ with ` framework ` configuration you can add dependencies to export (just like in iOS framework).
79+
9980### Setup CocoaPods interop
10081` build.gradle.kts `
10182``` kotlin
83+ plugins {
84+ id(" dev.icerock.mobile.multiplatform.cocoapods" )
85+ }
86+
10287cocoaPods {
10388 podsProject = file(" ../ios-app/Pods/Pods.xcodeproj" ) // here should be path to your Pods project
10489 buildConfiguration = " dev-debug" // optional, default is "debug"
@@ -116,6 +101,45 @@ mobile.multiplatform.podsConfiguration=dev-debug
116101```
117102` podsProject ` should be relative path from root gradle project.
118103
104+ ### Multiple plugins in one line (deprecated, saved for backward compatibility)
105+ ``` kotlin
106+ plugins {
107+ id(" dev.icerock.mobile.multiplatform" )
108+ }
109+ ```
110+ This line will enable:
111+ - ` dev.icerock.mobile.multiplatform.cocoapods `
112+ - ` dev.icerock.mobile.multiplatform.targets `
113+ - publish of android build variants - ` release ` and ` debug `
114+
115+ ### Definition of dependencies (deprecated, saved for backward compatibility)
116+ ``` kotlin
117+ val mokoTime = MultiPlatformLibrary (
118+ android = " dev.icerock.moko:time-android:0.1.0" ,
119+ common = " dev.icerock.moko:time:0.1.0" ,
120+ iosX64 = " dev.icerock.moko:time-iosx64:0.1.0" ,
121+ iosArm64 = " dev.icerock.moko:time-iosarm64:0.1.0"
122+ )
123+
124+ val appCompat = AndroidLibrary (
125+ name = " androidx.appcompat:appcompat:1.1.0"
126+ )
127+
128+ val myFeature = MultiPlatformModule (
129+ name = " :mpp-library:feature:myFeature"
130+ )
131+ ```
132+
133+ ### Setup dependencies (deprecated, saved for backward compatibility)
134+ ` build.gradle.kts `
135+ ``` kotlin
136+ dependencies {
137+ mppLibrary(mokoTime)
138+ androidLibrary(appCompat)
139+ mppModule(myFeature)
140+ }
141+ ```
142+
119143## License
120144
121145 Copyright 2019 IceRock MAG Inc.
0 commit comments