Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 524366c

Browse files
authored
Merge pull request #310 from icerockdev/#309-apple-silicon
#309 apple silicon
2 parents 1271ca4 + 3cb968c commit 524366c

File tree

78 files changed

+276
-517
lines changed

Some content is hidden

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

78 files changed

+276
-517
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
![moko-widgets](https://user-images.githubusercontent.com/5010169/70204294-93a45900-1752-11ea-9bb6-820d514ceef9.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.moko/moko-widgets) ](https://repo1.maven.org/maven2/dev/icerock/moko/moko-widgets) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko&name=widgets)
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.moko/widgets) ](https://repo1.maven.org/maven2/dev/icerock/moko/widgets/) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko&name=widgets)
33

44
# Mobile Kotlin widgets
55
This is a Kotlin MultiPlatform library that provides declarative UI and application screens management

build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44

55
buildscript {
66
repositories {
7+
gradlePluginPortal()
78
mavenCentral()
89
google()
9-
gradlePluginPortal()
1010
jcenter()
1111
}
1212
dependencies {
13-
classpath("dev.icerock.moko:resources-generator:0.16.2")
13+
classpath("dev.icerock.moko:resources-generator:0.21.2")
1414
classpath("dev.icerock.moko.widgets:gradle-plugin")
1515

1616
classpath(":widgets-build-logic")
1717
}
1818
}
1919

2020
allprojects {
21-
2221
plugins.withId("org.gradle.maven-publish") {
2322
group = "dev.icerock.moko"
2423
version = libs.versions.mokoWidgetsVersion.get()

gradle.properties

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ org.gradle.configureondemand=false
33
org.gradle.parallel=true
44

55
kotlin.code.style=official
6-
7-
kotlin.native.enableDependencyPropagation=false
8-
kotlin.mpp.enableGranularSourceSetsMetadata=true
9-
kotlin.mpp.enableCompatibilityMetadataVariant=true
6+
kotlin.mpp.androidSourceSetLayoutVersion=2
7+
kotlin.mpp.enableCInteropCommonization=true
108

119
android.useAndroidX=true
1210

1311
mobile.multiplatform.useIosShortcut=false
1412
mobile.multiplatform.iosTargetWarning=false
15-
mobile.multiplatform.podsProject=sample/ios-app/Pods/Pods.xcodeproj
13+
mobile.multiplatform.podsProject=sample/ios-app/Pods/Pods.xcodeproj

gradle/libs.versions.toml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
[versions]
2-
kotlinVersion = "1.5.20"
3-
mokoWidgetsVersion = "0.1.0"
4-
mokoResourcesVersion = "0.16.2"
5-
appCompatVersion = "1.3.1"
6-
fragmentVersion = "1.3.6"
2+
kotlinVersion = "1.8.10"
3+
4+
mokoWidgetsVersion = "0.2.0"
5+
mokoResourcesVersion = "0.21.2"
6+
mokoMvvmVersion = "0.16.0"
7+
mokoFieldsVersion = "0.12.0"
8+
mokoUnitsVersion = "0.8.0"
9+
mokoMediaVersion = "0.11.0"
10+
mokoPermissionsVersion = "0.16.0"
11+
mokoGraphicsVersion = "0.9.0"
12+
mokoParcelizeVersion = "0.8.0"
13+
14+
appCompatVersion = "1.6.1"
15+
fragmentVersion = "1.5.6"
716
swipeRefreshLayoutVersion = "1.1.0"
8-
materialVersion = "1.4.0"
9-
constraintLayoutVersion = "2.0.4"
10-
lifecycleVersion = "2.3.1"
11-
recyclerViewVersion = "1.2.1"
17+
materialVersion = "1.8.0"
18+
constraintLayoutVersion = "2.1.4"
19+
lifecycleVersion = "2.6.1"
20+
recyclerViewVersion = "1.3.0"
1221
inputMaskVersion = "6.0.0"
13-
glideVersion = "4.12.0"
22+
glideVersion = "4.14.2"
1423
roundedImageViewVersion = "2.3.0"
15-
playServiceAuthVersion = "19.2.0"
16-
playServiceAuthSmsVersion = "17.5.1"
17-
coroutinesVersion = "1.5.1-native-mt"
18-
mokoMvvmVersion = "0.11.0"
19-
mokoFieldsVersion = "0.8.0"
20-
mokoUnitsVersion = "0.6.2"
21-
mokoMediaVersion = "0.9.0"
22-
mokoPermissionsVersion = "0.10.1"
23-
mokoGraphicsVersion = "0.8.0"
24-
mokoParcelizeVersion = "0.7.1"
25-
klockVersion = "2.3.1"
24+
playServiceAuthVersion = "20.5.0"
25+
playServiceAuthSmsVersion = "18.0.1"
26+
coroutinesVersion = "1.6.4"
27+
klockVersion = "3.4.0"
2628
autoServiceVersion = "1.0-rc6"
2729

2830
[libraries]
@@ -38,17 +40,19 @@ glide = { module = "com.github.bumptech.glide:glide", version.ref = "glideVersio
3840
roundedImageView = { module = "com.makeramen:roundedimageview", version.ref = "roundedImageViewVersion" }
3941
playServiceAuth = { module = "com.google.android.gms:play-services-auth", version.ref = "playServiceAuthVersion" }
4042
playServiceAuthSms = { module = "com.google.android.gms:play-services-auth-api-phone", version.ref = "playServiceAuthSmsVersion" }
43+
4144
mokoResources = { module = "dev.icerock.moko:resources", version.ref = "mokoResourcesVersion" }
4245
mokoMvvmCore = { module = "dev.icerock.moko:mvvm-core", version.ref = "mokoMvvmVersion" }
4346
mokoMvvmState = { module = "dev.icerock.moko:mvvm-state", version.ref = "mokoMvvmVersion" }
4447
mokoMvvmLivedata = { module = "dev.icerock.moko:mvvm-livedata", version.ref = "mokoMvvmVersion" }
4548
mokoMvvmDataBinding = { module = "dev.icerock.moko:mvvm-databinding", version.ref = "mokoMvvmVersion" }
46-
mokoFields = { module = "dev.icerock.moko:fields", version.ref = "mokoFieldsVersion" }
49+
mokoFields = { module = "dev.icerock.moko:fields-livedata", version.ref = "mokoFieldsVersion" }
4750
mokoUnits = { module = "dev.icerock.moko:units", version.ref = "mokoUnitsVersion" }
4851
mokoMedia = { module = "dev.icerock.moko:media", version.ref = "mokoMediaVersion" }
4952
mokoPermissions = { module = "dev.icerock.moko:permissions", version.ref = "mokoPermissionsVersion" }
5053
mokoGraphics = { module = "dev.icerock.moko:graphics", version.ref = "mokoGraphicsVersion" }
5154
mokoParcelize = { module = "dev.icerock.moko:parcelize", version.ref = "mokoParcelizeVersion" }
55+
5256
coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutinesVersion" }
5357
klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "klockVersion" }
5458
autoService = { module = "com.google.auto.service:auto-service", version.ref = "autoServiceVersion" }
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-7.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

plugin/gradle-plugin/src/main/kotlin/dev/icerock/moko/widgets/WidgetsGeneratorGradlePlugin.kt

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,53 @@
44

55
package dev.icerock.moko.widgets
66

7+
import dev.icerock.moko.widgets.gradle_plugin.BuildConfig
78
import org.gradle.api.Project
9+
import org.gradle.api.internal.provider.DefaultProvider
10+
import org.gradle.api.provider.Provider
811
import org.gradle.kotlin.dsl.configure
912
import org.gradle.kotlin.dsl.withType
1013
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
14+
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
15+
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerPluginSupportPlugin
1116
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
1217
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
18+
import org.jetbrains.kotlin.gradle.plugin.SubpluginArtifact
19+
import org.jetbrains.kotlin.gradle.plugin.SubpluginOption
1320
import java.io.File
1421

15-
open class WidgetsGeneratorGradlePlugin : org.gradle.api.Plugin<Project> {
16-
override fun apply(project: Project) {
17-
project.plugins.withType<KotlinMultiplatformPluginWrapper> {
18-
project.configure<KotlinMultiplatformExtension> {
19-
val path = getGenerationDir(project).path
22+
open class WidgetsGeneratorGradlePlugin : KotlinCompilerPluginSupportPlugin {
23+
override fun apply(target: Project) {
24+
target.plugins.withType<KotlinMultiplatformPluginWrapper> {
25+
target.configure<KotlinMultiplatformExtension> {
26+
val path = getGenerationDir(target).path
2027
sourceSets.getByName(KotlinSourceSet.COMMON_MAIN_SOURCE_SET_NAME).kotlin.srcDir(path)
2128
}
2229
}
2330
}
31+
32+
override fun applyToCompilation(kotlinCompilation: KotlinCompilation<*>): Provider<List<SubpluginOption>> {
33+
return DefaultProvider {
34+
listOf(
35+
SubpluginOption(
36+
key = "generationDir",
37+
value = getGenerationDir(kotlinCompilation.target.project).path
38+
)
39+
)
40+
}
41+
}
42+
43+
override fun getCompilerPluginId(): String = "widgets-generator"
44+
45+
override fun getPluginArtifact(): SubpluginArtifact = SubpluginArtifact(
46+
groupId = "dev.icerock.moko.widgets",
47+
artifactId = "kotlin-plugin",
48+
version = BuildConfig.compilerPluginVersion
49+
)
50+
51+
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
52+
return true
53+
}
2454
}
2555

2656
fun getGenerationDir(project: Project): File {

plugin/gradle-plugin/src/main/kotlin/dev/icerock/moko/widgets/WidgetsGeneratorGradleSubplugin.kt

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

plugin/kotlin-common-plugin/build.gradle.kts

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

plugin/kotlin-native-plugin/build.gradle.kts

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

0 commit comments

Comments
 (0)