Skip to content

#54 fixed fields list validation #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Print Xcode version
run: xcodebuild -version
- name: Check build
run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64
- name: Install pods
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle
.kotlin
.settings
.project
.classpath
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ allprojects {
project build.gradle
```groovy
dependencies {
commonMainApi("dev.icerock.moko:fields-core:0.12.0")
commonMainApi("dev.icerock.moko:fields-core:0.13.0")

// integration with reactive flows
commonMainApi("dev.icerock.moko:fields-livedata:0.12.0")
commonMainApi("dev.icerock.moko:fields-flow:0.12.0")
commonMainApi("dev.icerock.moko:fields-livedata:0.13.0")
commonMainApi("dev.icerock.moko:fields-flow:0.13.0")

androidMainApi("dev.icerock.moko:fields-material:0.12.0")
androidMainApi("dev.icerock.moko:fields-material:0.13.0")
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

package dev.icerock.moko.fields.core

fun List<FormField<*, *>>.validate(): Boolean =
all { it.validate() }
fun List<FormField<*, *>>.validate(): Boolean {
return map { it.validate() }.all { it }
}
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlinVersion = "1.8.10"
kotlinVersion = "1.9.10"

# android
androidAppCompatVersion = "1.6.1"
Expand All @@ -10,10 +10,10 @@ androidLifecycleVersion = "2.6.1"
coroutinesVersion = "1.6.4"

# moko
mokoResourcesVersion = "0.21.2"
mokoResourcesVersion = "0.24.5"
mokoMvvmVersion = "0.16.0"
mokoTestVersion = "0.6.1"
mokoFieldsVersion = "0.12.0"
mokoFieldsVersion = "0.13.0"

[libraries]
# android
Expand Down Expand Up @@ -41,7 +41,7 @@ mokoTest = { module = "dev.icerock.moko:test-core", version.ref = "mokoTestVersi

# gradle plugins
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.4.2" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "8.2.1" }
mokoResourcesGradlePlugin = { module = "dev.icerock.moko:resources-generator", version.ref = "mokoResourcesVersion" }
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.3.0" }
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.4.2" }
mokoKSwiftGradlePlugin = { module = "dev.icerock.moko:kswift-gradle-plugin", version = "0.6.1" }
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Tue Apr 15 22:30:14 KRAT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 10 additions & 3 deletions sample-declarative-ui/androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ plugins {
}

android {
compileSdk = 33
compileSdk = 34
buildFeatures {
compose = true
}
defaultConfig {
applicationId = "dev.icerock.moko.fields.sample.declarativeui.android"
minSdk = 21
targetSdk = 33
targetSdk = 34
versionCode = 1
versionName = "1.0"
}
Expand All @@ -25,7 +25,14 @@ android {
}
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.4"
kotlinCompilerExtensionVersion = "1.5.15"
}

namespace = "dev.icerock.sample.declarativeui.android"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

Expand Down
6 changes: 2 additions & 4 deletions sample-declarative-ui/androidApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="dev.icerock.moko.fields.sample.declarativeui.android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="false"
android:supportsRtl="true"
android:usesCleartextTraffic="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:name="dev.icerock.moko.fields.sample.declarativeui.android.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
15 changes: 11 additions & 4 deletions sample-declarative-ui/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ val dependenciesList = listOf(
)

kotlin {
android()
androidTarget()

val xcf = XCFramework("MultiPlatformLibrary")
listOf(
Expand Down Expand Up @@ -75,15 +75,22 @@ kotlin {
}

multiplatformResources {
multiplatformResourcesPackage = "dev.icerock.moko.fields.sample.declarativeui"
resourcesPackage.set("dev.icerock.moko.fields.sample.declarativeui.shared")
}

android {
compileSdk = 32
compileSdk = 34
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 21
targetSdk = 32
targetSdk = 34
}

namespace = "dev.icerock.sample.declarativeui.shared"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import dev.icerock.moko.fields.core.validations.notBlank
import dev.icerock.moko.fields.flow.FormField
import dev.icerock.moko.fields.flow.flowBlock
import dev.icerock.moko.fields.flow.validations.fieldValidation
import dev.icerock.moko.fields.sample.declarativeui.shared.MR
import dev.icerock.moko.mvvm.flow.CFlow
import dev.icerock.moko.mvvm.flow.cFlow
import dev.icerock.moko.mvvm.viewmodel.ViewModel
Expand Down
7 changes: 6 additions & 1 deletion sample/mpp-library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import java.util.Locale

/*
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/
Expand Down Expand Up @@ -25,10 +28,12 @@ dependencies {
commonMainApi(libs.mokoMvvmLiveData)
commonMainApi(libs.mokoMvvmLiveDataResources)
commonMainApi(projects.fieldsLivedata)

iosMainImplementation("dev.icerock.moko:parcelize:0.9.0")
}

multiplatformResources {
multiplatformResourcesPackage = "com.icerockdev.library"
resourcesPackage.set("com.icerockdev.library")
}

framework {
Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/
enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

dependencyResolutionManagement {
Expand Down
Loading