-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#58 added samples of different target configurations
- Loading branch information
Showing
20 changed files
with
216 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ object Versions { | |
const val kotlinPoet = "1.3.0" | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
plugins { | ||
id("com.android.library") | ||
id("org.jetbrains.kotlin.multiplatform") | ||
id("dev.icerock.mobile.multiplatform-resources") | ||
} | ||
|
||
android { | ||
compileSdkVersion(Versions.Android.compileSdk) | ||
|
||
defaultConfig { | ||
minSdkVersion(Versions.Android.minSdk) | ||
targetSdkVersion(Versions.Android.targetSdk) | ||
} | ||
} | ||
|
||
kotlin { | ||
android() | ||
val onPhone = System.getenv("SDK_NAME")?.startsWith("iphoneos") ?: false | ||
if (onPhone) { | ||
iosArm64("ios") | ||
} else { | ||
iosX64("ios") | ||
} | ||
|
||
targets.getByName<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>("ios") { | ||
binaries.framework { | ||
baseName = "MultiPlatformLibrary" | ||
isStatic = false | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
commonMainImplementation("org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}") | ||
commonMainImplementation("dev.icerock.moko:resources:${Versions.Libs.MultiPlatform.mokoResources}") | ||
} | ||
|
||
multiplatformResources { | ||
multiplatformResourcesPackage = "com.icerockdev.library" | ||
} |
9 changes: 9 additions & 0 deletions
9
sample/mpp-conditional/src/commonMain/kotlin/com/icerockdev/library/Testing.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package com.icerockdev.library | ||
|
||
fun test() { | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../mpp-library/src/commonMain/resources |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.icerockdev.library"/> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
plugins { | ||
id("com.android.library") | ||
id("org.jetbrains.kotlin.multiplatform") | ||
id("dev.icerock.mobile.multiplatform-resources") | ||
} | ||
|
||
android { | ||
compileSdkVersion(Versions.Android.compileSdk) | ||
|
||
defaultConfig { | ||
minSdkVersion(Versions.Android.minSdk) | ||
targetSdkVersion(Versions.Android.targetSdk) | ||
} | ||
} | ||
|
||
kotlin { | ||
android() | ||
ios() | ||
} | ||
|
||
dependencies { | ||
commonMainImplementation("org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}") | ||
commonMainImplementation("dev.icerock.moko:resources:${Versions.Libs.MultiPlatform.mokoResources}") | ||
} | ||
|
||
multiplatformResources { | ||
multiplatformResourcesPackage = "com.icerockdev.library" | ||
} |
9 changes: 9 additions & 0 deletions
9
sample/mpp-hierarhical/src/commonMain/kotlin/com/icerockdev/library/Testing.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package com.icerockdev.library | ||
|
||
fun test() { | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../mpp-library/src/commonMain/resources |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.icerockdev.library"/> |
27 changes: 27 additions & 0 deletions
27
sample/mpp-library/src/commonMain/resources/MR/es/plurals.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<resources> | ||
<plural name="test.plural"> | ||
<item quantity="zero">cero</item> | ||
<item quantity="one">uno</item> | ||
<item quantity="two">dos</item> | ||
<item quantity="few">algo</item> | ||
<item quantity="many">mucho</item> | ||
<item quantity="other">otro</item> | ||
</plural> | ||
<plural name="my_plural"> | ||
<item quantity="zero">cero</item> | ||
<item quantity="one">uno</item> | ||
<item quantity="two">dos</item> | ||
<item quantity="few">algo</item> | ||
<item quantity="many">mucho</item> | ||
<item quantity="other">otro</item> | ||
</plural> | ||
<plural name="myPlural"> | ||
<item quantity="zero">cero</item> | ||
<item quantity="one">uno</item> | ||
<item quantity="two">dos</item> | ||
<item quantity="few">algo</item> | ||
<item quantity="many">mucho</item> | ||
<item quantity="other">otro</item> | ||
</plural> | ||
</resources> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
plugins { | ||
id("com.android.library") | ||
id("org.jetbrains.kotlin.multiplatform") | ||
id("dev.icerock.mobile.multiplatform-resources") | ||
} | ||
|
||
android { | ||
compileSdkVersion(Versions.Android.compileSdk) | ||
|
||
defaultConfig { | ||
minSdkVersion(Versions.Android.minSdk) | ||
targetSdkVersion(Versions.Android.targetSdk) | ||
} | ||
} | ||
|
||
kotlin { | ||
android() | ||
iosX64 { | ||
binaries.framework { | ||
baseName = "MultiPlatformLibrary" | ||
isStatic = false | ||
} | ||
} | ||
iosArm64 { | ||
binaries.framework { | ||
baseName = "MultiPlatformLibrary" | ||
isStatic = false | ||
} | ||
} | ||
|
||
sourceSets { | ||
val iosX64Main by getting {} | ||
val iosX64Test by getting {} | ||
val iosArm64Main by getting { | ||
dependsOn(iosX64Main) | ||
} | ||
val iosArm64Test by getting { | ||
dependsOn(iosX64Test) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
commonMainImplementation("org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}") | ||
commonMainImplementation("dev.icerock.moko:resources:${Versions.Libs.MultiPlatform.mokoResources}") | ||
} | ||
|
||
multiplatformResources { | ||
multiplatformResourcesPackage = "com.icerockdev.library" | ||
} |
9 changes: 9 additions & 0 deletions
9
sample/mpp-mixed/src/commonMain/kotlin/com/icerockdev/library/Testing.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package com.icerockdev.library | ||
|
||
fun test() { | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../mpp-library/src/commonMain/resources |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.icerockdev.library"/> |
This file contains 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