Skip to content

Commit d251b92

Browse files
authored
Merge pull request #48 from icerockdev/develop
Release 0.11.0
2 parents 47ad140 + f7d2e8a commit d251b92

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
![mobile-multiplatform](https://user-images.githubusercontent.com/5010169/100611874-9aa17f80-3344-11eb-9737-c50ba63b0f6e.png)
2-
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock/mobile-multiplatform) ](https://repo1.maven.org/maven2/dev/icerock/mobile-multiplatform) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.31-orange)
2+
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock/mobile-multiplatform) ](https://repo1.maven.org/maven2/dev/icerock/mobile-multiplatform)
33

44
# Mobile Multiplatform gradle plugin
55
This is a Gradle plugin for simple setup of Kotlin Multiplatform mobile Gradle modules.
@@ -13,8 +13,8 @@ repositories {
1313
}
1414

1515
dependencies {
16-
implementation("dev.icerock:mobile-multiplatform:0.10.1")
17-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31")
16+
implementation("dev.icerock:mobile-multiplatform:0.11.0")
17+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20")
1818
implementation("com.android.tools.build:gradle:4.1.1")
1919
}
2020
```
@@ -64,6 +64,8 @@ framework {
6464
export(kotlinNativeExportable = MultiPlatfomLibrary(<...>))
6565
export(kotlinNativeExportable = MultiPlatfomModule(<...>))
6666
export(arm64Dependency = "my.group:name-iosarm64:0.1.0", x64Dependency = "my.group:name-iosx64:0.1.0")
67+
export(artifact = "my.group:name:0.1.0") // common artifact
68+
export(provider = libs.myLib) // gradle 7 version catalog libraries accessors
6769
}
6870
```
6971

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
group = "dev.icerock"
14-
version = "0.10.1"
14+
version = "0.11.0"
1515

1616
repositories {
1717
mavenCentral()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/kotlin/dev/icerock/gradle/FrameworkConfig.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ package dev.icerock.gradle
66

77
import KotlinNativeExportable
88
import org.gradle.api.Project
9+
import org.gradle.api.artifacts.MinimalExternalModuleDependency
10+
import org.gradle.api.provider.Provider
911
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework
1012
import org.jetbrains.kotlin.konan.target.Architecture
1113

@@ -33,6 +35,18 @@ open class FrameworkConfig {
3335
).let { exports.add(it) }
3436
}
3537

38+
fun export(artifact: String) {
39+
ExportDeclaration.ArtifactStringExport(
40+
artifact = artifact
41+
).let { exports.add(it) }
42+
}
43+
44+
fun export(provider: Provider<MinimalExternalModuleDependency>) {
45+
ExportDeclaration.VersionCatalogExport(
46+
provider = provider
47+
).let { exports.add(it) }
48+
}
49+
3650
internal sealed class ExportDeclaration {
3751
data class ExternalExport(
3852
val arm64: String,
@@ -64,6 +78,22 @@ open class FrameworkConfig {
6478
}
6579
}
6680

81+
data class ArtifactStringExport(
82+
val artifact: String
83+
) : ExportDeclaration() {
84+
override fun export(project: Project, framework: Framework) {
85+
framework.export(this.artifact)
86+
}
87+
}
88+
89+
data class VersionCatalogExport(
90+
val provider: Provider<MinimalExternalModuleDependency>
91+
) : ExportDeclaration() {
92+
override fun export(project: Project, framework: Framework) {
93+
framework.export(this.provider.get())
94+
}
95+
}
96+
6797
abstract fun export(project: Project, framework: Framework)
6898
}
6999
}

0 commit comments

Comments
 (0)