Skip to content

Commit b4b2ed1

Browse files
authored
Merge pull request #171 from icerockdev/develop
Release 0.12.0
2 parents 8af3cf1 + 9f90ff3 commit b4b2ed1

File tree

185 files changed

+2010
-2437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+2010
-2437
lines changed

.github/workflows/compilation-check.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,25 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: macOS-latest
12-
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ macos-latest, windows-latest, ubuntu-latest ]
1315
steps:
1416
- uses: actions/checkout@v1
1517
- name: Set up JDK 11
1618
uses: actions/setup-java@v1
1719
with:
1820
java-version: 11
19-
- name: Build and test
20-
run: ./gradlew build publishToMavenLocal
21+
- name: Check build
22+
run: ./run-check.sh "${{ matrix.os }}"
23+
shell: bash
2124
- name: Install pods
2225
run: cd sample/ios-app && pod install
26+
if: matrix.os == 'macOS-latest'
2327
- name: build ios sample
24-
run: cd sample/ios-app && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty
28+
run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty
29+
if: matrix.os == 'macOS-latest'
2530
- name: Publish Test Report
2631
uses: mikepenz/action-junit-report@v2
2732
if: ${{ always() }}

.github/workflows/publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ on:
1111
jobs:
1212
publish:
1313
name: Publish library at mavenCentral
14-
runs-on: macOS-latest
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ macos-latest, windows-latest, ubuntu-latest ]
1518
env:
1619
OSSRH_USER: ${{ secrets.OSSRH_USER }}
1720
OSSRH_KEY: ${{ secrets.OSSRH_KEY }}
@@ -25,8 +28,10 @@ jobs:
2528
uses: actions/setup-java@v1
2629
with:
2730
java-version: 11
28-
- name: Build and publish to mavenCentral
29-
run: ./gradlew publish
31+
- name: Build and publish
32+
run: ./run-publish.sh "${{ matrix.os }}"
33+
shell: bash
34+
3035
release:
3136
name: Create release
3237
needs: publish

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ build
99
Pods
1010
xcuserdata
1111
local.properties
12-
local.gradle
12+
local.gradle
13+
kotlin-js-store/

.idea/copyright/IceRock.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sonarcloud.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright 2022 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
5+
# Path to sources
6+
sonar.sources=.
7+
sonar.inclusions=**/src/*Main/**/*,**/src/main/**/*,**/*.swift
8+
sonar.exclusions=
9+
10+
# Path to tests
11+
sonar.tests=.
12+
sonar.test.inclusions=**/src/*Test/**/*
13+
sonar.test.exclusions=

MultiPlatformLibraryMvvm.podspec

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@ allprojects {
4040
project build.gradle
4141
```groovy
4242
dependencies {
43-
commonMainApi("dev.icerock.moko:mvvm-core:0.11.0") // only ViewModel, EventsDispatcher, Dispatchers.UI
44-
commonMainApi("dev.icerock.moko:mvvm-livedata:0.11.0") // api mvvm-core, LiveData and extensions
45-
commonMainApi("dev.icerock.moko:mvvm-state:0.11.0") // api mvvm-livedata, ResourceState class and extensions
43+
commonMainApi("dev.icerock.moko:mvvm-core:0.12.0") // only ViewModel, EventsDispatcher, Dispatchers.UI
44+
commonMainApi("dev.icerock.moko:mvvm-livedata:0.12.0") // api mvvm-core, LiveData and extensions
45+
commonMainApi("dev.icerock.moko:mvvm-state:0.12.0") // api mvvm-livedata, ResourceState class and extensions
46+
commonMainApi("dev.icerock.moko:mvvm-livedata-resources:0.12.0") // api mvvm-core, moko-resources, extensions for LiveData with moko-resources
4647
47-
androidMainApi("dev.icerock.moko:mvvm-livedata-material:0.11.0") // api mvvm-livedata, Material library android extensions
48-
androidMainApi("dev.icerock.moko:mvvm-livedata-glide:0.11.0") // api mvvm-livedata, Glide library android extensions
49-
androidMainApi("dev.icerock.moko:mvvm-livedata-swiperefresh:0.11.0") // api mvvm-livedata, SwipeRefreshLayout library android extensions
50-
androidMainApi("dev.icerock.moko:mvvm-databinding:0.11.0") // api mvvm-livedata, DataBinding support for Android
51-
androidMainApi("dev.icerock.moko:mvvm-viewbinding:0.11.0") // api mvvm-livedata, ViewBinding support for Android
48+
androidMainApi("dev.icerock.moko:mvvm-livedata-material:0.12.0") // api mvvm-livedata, Material library android extensions
49+
androidMainApi("dev.icerock.moko:mvvm-livedata-glide:0.12.0") // api mvvm-livedata, Glide library android extensions
50+
androidMainApi("dev.icerock.moko:mvvm-livedata-swiperefresh:0.12.0") // api mvvm-livedata, SwipeRefreshLayout library android extensions
51+
androidMainApi("dev.icerock.moko:mvvm-databinding:0.12.0") // api mvvm-livedata, DataBinding support for Android
52+
androidMainApi("dev.icerock.moko:mvvm-viewbinding:0.12.0") // api mvvm-livedata, ViewBinding support for Android
5253
53-
commonTestImplementation("dev.icerock.moko:mvvm-test:0.11.0") // test utilities
54+
commonTestImplementation("dev.icerock.moko:mvvm-test:0.12.0") // test utilities
5455
}
5556
```
5657

@@ -60,24 +61,19 @@ kotlin {
6061
// export correct artifact to use all classes of library directly from Swift
6162
targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget::class.java).all {
6263
binaries.withType(org.jetbrains.kotlin.gradle.plugin.mpp.Framework::class.java).all {
63-
export("dev.icerock.moko:mvvm-core:0.11.0")
64-
export("dev.icerock.moko:mvvm-livedata:0.11.0")
65-
export("dev.icerock.moko:mvvm-state:0.11.0")
64+
export("dev.icerock.moko:mvvm-core:0.12.0")
65+
export("dev.icerock.moko:mvvm-livedata:0.12.0")
66+
export("dev.icerock.moko:mvvm-livedata-resources:0.12.0")
67+
export("dev.icerock.moko:mvvm-state:0.12.0")
6668
}
6769
}
6870
}
6971
```
7072

71-
On iOS, in addition to the Kotlin library add in Podfile
72-
```ruby
73-
pod 'MultiPlatformLibraryMvvm', :git => 'https://github.com/icerockdev/moko-mvvm.git', :tag => 'release/0.11.0'
74-
```
75-
**`MultiPlatformLibraryMvvm` CocoaPod requires that the framework compiled from Kotlin be named
76-
`MultiPlatformLibrary` and be connected as a CocoaPod `MultiPlatformLibrary`.
77-
[Here](sample/ios-app/Podfile)'s an example.
78-
To simplify integration with MultiPlatformFramework you can use [mobile-multiplatform-plugin](https://github.com/icerockdev/mobile-multiplatform-gradle-plugin)**
73+
### KSwift
7974

80-
`MultiPlatformLibraryMvvm` CocoaPod contains the extension to `UIView`s for binding with `LiveData`.
75+
For iOS we recommend use [moko-kswift](https://github.com/icerockdev/moko-kswift) with extensions
76+
generation enabled. All `LiveData` to `UIView` bindings is extensions for UI elements.
8177

8278
## Documentation
8379
Documentation generated by Dokka and available at https://icerockdev.github.io/moko-mvvm/
@@ -88,7 +84,7 @@ Let’s say we need a screen with a button click counter. To implement it we sho
8884
#### common
8985
In `commonMain` we can create a `ViewModel` like:
9086
```kotlin
91-
class SimpleViewModel() : ViewModel() {
87+
class SimpleViewModel : ViewModel() {
9288
private val _counter: MutableLiveData<Int> = MutableLiveData(0)
9389
val counter: LiveData<String> = _counter.map { it.toString() }
9490

build.gradle.kts

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,47 @@
22
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
plugins {
6-
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.5.0"
7-
}
8-
95
buildscript {
106
repositories {
117
mavenCentral()
128
google()
13-
149
gradlePluginPortal()
1510
}
1611

1712
dependencies {
18-
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.4.20")
19-
2013
classpath(":mvvm-build-logic")
14+
classpath(libs.kswiftGradlePlugin)
2115
}
2216
}
2317

24-
allprojects {
25-
apply(plugin = "org.jetbrains.dokka")
18+
plugins {
19+
alias(libs.plugins.nexusPublish)
20+
}
2621

27-
plugins.withId("org.gradle.maven-publish") {
28-
group = "dev.icerock.moko"
29-
version = libs.versions.mokoMvvmVersion.get()
22+
nexusPublishing {
23+
repositories {
24+
sonatype {
25+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
26+
username.set(System.getenv("OSSRH_USER"))
27+
password.set(System.getenv("OSSRH_KEY"))
28+
}
3029
}
3130
}
3231

33-
val sampleProjects: Set<Project> = project(":sample").allprojects
34-
35-
apiValidation {
36-
ignoredPackages.add("dev.icerock.moko.mvvm.internal")
37-
38-
ignoredProjects.addAll(sampleProjects.map { it.name })
39-
}
32+
val mokoVersion = libs.versions.mokoMvvmVersion.get()
33+
allprojects {
34+
group = "dev.icerock.moko"
35+
version = mokoVersion
4036

41-
tasks.register("clean", Delete::class).configure {
42-
group = "build"
43-
delete(rootProject.buildDir)
37+
configurations.configureEach {
38+
resolutionStrategy {
39+
force(rootProject.libs.coroutines)
40+
}
41+
}
4442
}
4543

46-
tasks.withType<org.jetbrains.dokka.gradle.DokkaMultiModuleTask>().all {
47-
removeChildTasks(sampleProjects.plus(project(":mvvm")))
48-
49-
doLast {
50-
val dir = outputDirectory.get()
51-
val from = File(dir, "-modules.html")
52-
val to = File(dir, "index.html")
53-
54-
from.renameTo(to)
55-
56-
dir.renameTo(file("docs"))
57-
}
44+
// temporary fix for Apple Silicon (remove after 1.6.20 update)
45+
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
46+
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion =
47+
"16.0.0"
5848
}

gradle/libs.versions.toml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
11
[versions]
2-
kotlinVersion = "1.5.20"
3-
androidAppCompatVersion = "1.2.0"
4-
materialDesignVersion = "1.2.1"
2+
kotlinVersion = "1.6.10"
53
androidLifecycleVersion = "2.2.0"
6-
androidCoreTestingVersion = "2.1.0"
7-
glideVersion = "4.11.0"
8-
swipeRefreshVersion = "1.1.0"
9-
dokkaVersion = "1.4.20"
10-
coroutinesVersion = "1.5.0-native-mt"
11-
mokoResourcesVersion = "0.16.0"
12-
mokoTestVersion = "0.4.0"
13-
mokoMvvmVersion = "0.11.0"
4+
coroutinesVersion = "1.6.0-native-mt"
5+
mokoResourcesVersion = "0.18.0"
6+
mokoTestVersion = "0.6.1"
7+
mokoMvvmVersion = "0.12.0"
8+
mokoKSwiftVersion = "0.4.0"
149

1510
[libraries]
16-
appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidAppCompatVersion" }
17-
material = { module = "com.google.android.material:material", version.ref = "materialDesignVersion" }
11+
# android
12+
appCompat = { module = "androidx.appcompat:appcompat", version = "1.2.0" }
13+
material = { module = "com.google.android.material:material", version = "1.2.1" }
1814
lifecycle = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "androidLifecycleVersion" }
1915
androidViewModel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidLifecycleVersion" }
2016
androidLiveData = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidLifecycleVersion" }
21-
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glideVersion" }
22-
swipeRefresh = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swipeRefreshVersion" }
17+
glide = { module = "com.github.bumptech.glide:glide", version = "4.11.0" }
18+
swipeRefresh = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version = "1.1.0" }
19+
20+
# coroutines
2321
coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutinesVersion" }
22+
coroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutinesVersion" }
23+
24+
# moko
2425
mokoResources = { module = "dev.icerock.moko:resources", version.ref = "mokoResourcesVersion" }
2526
mokoTest = { module = "dev.icerock.moko:test-core", version.ref = "mokoTestVersion" }
27+
mokoKSwift = { module = "dev.icerock.moko:kswift-runtime", version.ref = "mokoKSwiftVersion"}
28+
29+
# tests
2630
kotlinTestJUnit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinVersion" }
27-
androidCoreTesting = { module = "androidx.arch.core:core-testing", version.ref = "androidCoreTestingVersion" }
28-
coroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutinesVersion" }
31+
androidCoreTesting = { module = "androidx.arch.core:core-testing", version = "2.1.0" }
32+
33+
# gradle plugins
34+
dokkaGradlePlugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "kotlinVersion" }
35+
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
36+
mobileMultiplatformGradlePlugin = { module = "dev.icerock:mobile-multiplatform", version = "0.13.0" }
37+
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.0.4" }
38+
detektGradlePlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version = "1.19.0" }
39+
kswiftGradlePlugin = { module = "dev.icerock.moko:kswift-gradle-plugin", version.ref = "mokoKSwiftVersion" }
40+
41+
[plugins]
42+
nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version = "1.1.0" }

0 commit comments

Comments
 (0)