Skip to content
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
4 changes: 1 addition & 3 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
with:
java-version: 17
- name: Build and publish local
run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64
- name: Install pods
run: cd sample/ios-app && pod install
run: ./gradlew build publishToMavenLocal :sample:mpp-library:embedAndSignAppleFrameworkForXcode
- name: Check iOS
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ build
Pods
xcuserdata
local.properties
local.gradle
local.gradle
.kotlin
.DS_Store
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.detekt) apply false
}

buildscript {
repositories {
mavenCentral()
Expand All @@ -16,7 +21,6 @@ buildscript {
classpath(libs.mobileMultiplatformGradlePlugin)
classpath(libs.kotlinSerializationGradlePlugin)
classpath(libs.composeJetBrainsGradlePlugin)
classpath(libs.detektGradlePlugin)
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ kotlin.mpp.androidSourceSetLayoutVersion=2

android.useAndroidX=true

moko.android.targetSdk=34
moko.android.compileSdk=34
moko.android.targetSdk=36
moko.android.compileSdk=36
moko.android.minSdk=16

moko.publish.name=MOKO permissions
Expand Down
41 changes: 24 additions & 17 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
[versions]
kotlinVersion = "1.9.10"
androidAppCompatVersion = "1.6.1"
androidxCoreVersion = "1.9.0" # TODO we have two versions (1.8 + 1.9) - unify them
composeMaterialVersion = "1.4.1"
composeActivityVersion = "1.7.0"
activityVersion = "1.7.0"
materialDesignVersion = "1.8.0"
kotlinVersion = "2.2.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if library will be compiled with kotlin 2.2.0 then users that use kotlin 2.0 or kotlin 1.9 will lost access to library.
i not see any reason to increase minimal kotlin version in this library. maybe you have some reasons?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about this? I don't think upgrading to Kotlin 2.2.0 prevents users with lower versions from using the library 🤔

One important thing to note is that upgrading Kotlin improves many aspects of KMP in general in terms of configuration and setup.

This is the main reason why I upgraded to this version.

Also, upgrading to a newer version of Kotlin simply implies that if users want to use the latest release, they should also upgrade. Projects using KMP today should most likely not be using Kotlin versions lower than 2.0 🤔

Concerning all the other comments of using the configured moko plugins, since upgrading to Kotlin 2.2.0 changes various KMP configurations, these plugins would have to be upgraded beforehand which is why I didn't do it. If you want, I could take some time and update them but I'd need to be sure that upgrading to Kotlin 2+ is possible for you

androidAppCompatVersion = "1.7.1"
androidxCoreVersion = "1.16.0" # TODO we have two versions (1.8 + 1.9) - unify them
composeMaterialVersion = "1.8.3"
composeActivityVersion = "1.10.1"
activityVersion = "1.10.1"
materialDesignVersion = "1.12.0"
androidLifecycleVersion = "2.2.0"
androidCoreTestingVersion = "2.2.0"
coroutinesVersion = "1.6.4"
mokoMvvmVersion = "0.16.0"
coroutinesVersion = "1.10.2"
mokoMvvmVersion = "0.16.1"
mokoPermissionsVersion = "0.19.1"
composeJetBrainsVersion = "1.7.1"
lifecycleRuntime = "2.6.1"
composeUiVersion = "1.0.1"
composeJetBrainsVersion = "1.8.2"
lifecycleRuntime = "2.9.1"
composeUiVersion = "1.8.3"
detekt = "1.23.8"

[libraries]
androidxCore = { module = "androidx.core:core", version.ref = "androidxCoreVersion" }
Expand All @@ -30,12 +31,18 @@ mokoMvvmCore = { module = "dev.icerock.moko:mvvm-core", version.ref = "mokoMvvmV
mokoMvvmTest = { module = "dev.icerock.moko:mvvm-test", version.ref = "mokoMvvmVersion" }
kotlinTestJUnit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinVersion" }
androidCoreTesting = { module = "androidx.arch.core:core-testing", version.ref = "androidCoreTestingVersion" }

detekt-cli = { group = "io.gitlab.arturbosch.detekt", name = "detekt-cli", version.ref = "detekt" }
detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
detekt-libraries = { group = "io.gitlab.arturbosch.detekt", name = "detekt-rules-libraries", version.ref = "detekt" }

kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.4.2" }
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.4.2" }
mobileMultiplatformGradlePlugin = { module = "dev.icerock:mobile-multiplatform", version = "0.14.2" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "8.11.0" }
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.5.0" }
mobileMultiplatformGradlePlugin = { module = "dev.icerock:mobile-multiplatform", version = "0.14.4" }
kotlinSerializationGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlinVersion" }
composeJetBrainsGradlePlugin = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "composeJetBrainsVersion" }
detektGradlePlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version = "1.22.0" }
detektGradlePlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }

[plugins]
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinVersion" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jun 10 21:09:29 CEST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
36 changes: 19 additions & 17 deletions permissions-avfoundation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,34 @@
import dev.icerock.moko.gradle.utils.connectTargetsToSourceSet
import dev.icerock.moko.gradle.utils.createMainTest
import dev.icerock.moko.gradle.utils.setupDependency
import io.gitlab.arturbosch.detekt.CONFIGURATION_DETEKT_PLUGINS

plugins {
id("org.jetbrains.kotlin.multiplatform")
id("dev.icerock.moko.gradle.publication")
id("dev.icerock.moko.gradle.detekt")
alias(libs.plugins.detekt)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in moko detekt plugin already configured all required rules and dependencies. why you not use it?

}

kotlin {
iosArm64()
iosX64()
iosSimulatorArm64()
applyDefaultHierarchyTemplate()

with(this.sourceSets) {
// creation
createMainTest("ios")
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
)
Comment on lines -17 to +23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use convention plugin to simplify build configs. now we have duplication in this logic in each build config


// ios dependencies
setupDependency("ios", "common")
connectTargetsToSourceSet(
targetNames = listOf("iosX64", "iosArm64", "iosSimulatorArm64"),
sourceSetPrefix = "ios"
)
sourceSets {
commonMain {
dependencies {
api(projects.permissions)
implementation(libs.coroutines)
}
}
}
}

dependencies {
commonMainApi(projects.permissions)
commonMainImplementation(libs.coroutines)
dependencies {
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.cli)
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.formatting)
}
}
35 changes: 30 additions & 5 deletions permissions-bluetooth/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
import io.gitlab.arturbosch.detekt.CONFIGURATION_DETEKT_PLUGINS

/*
* Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("dev.icerock.moko.gradle.multiplatform.mobile")
id("org.jetbrains.kotlin.multiplatform")
id("com.android.library")
id("dev.icerock.moko.gradle.publication")
id("dev.icerock.moko.gradle.stub.javadoc")
id("dev.icerock.moko.gradle.detekt")
alias(libs.plugins.detekt)
}

android {
namespace = "dev.icerock.moko.permissions.bluetooth"
compileSdk = 36
}

dependencies {
commonMainApi(projects.permissions)
commonMainImplementation(libs.coroutines)
kotlin {
applyDefaultHierarchyTemplate()

androidTarget { publishLibraryVariants("release", "debug") }

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
)
Comment on lines +21 to +29
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be from convention plugin too


sourceSets {
commonMain {
dependencies {
api(projects.permissions)
implementation(libs.coroutines)
}
}
}

dependencies {
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.cli)
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.formatting)
}
}
42 changes: 36 additions & 6 deletions permissions-camera/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,50 @@
import io.gitlab.arturbosch.detekt.CONFIGURATION_DETEKT_PLUGINS

/*
* Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("dev.icerock.moko.gradle.multiplatform.mobile")
id("org.jetbrains.kotlin.multiplatform")
id("com.android.library")
id("dev.icerock.moko.gradle.publication")
id("dev.icerock.moko.gradle.stub.javadoc")
id("dev.icerock.moko.gradle.detekt")
alias(libs.plugins.detekt)
}

android {
namespace = "dev.icerock.moko.permissions.camera"
compileSdk = 36
}

dependencies {
commonMainApi(projects.permissions)
iosMainImplementation(projects.permissionsAvfoundation)
commonMainImplementation(libs.coroutines)
kotlin {
applyDefaultHierarchyTemplate()

androidTarget { publishLibraryVariants("release", "debug") }

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
)
Comment on lines +21 to +29
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be from convention plugin too


sourceSets {
commonMain {
dependencies {
api(projects.permissions)
implementation(libs.coroutines)
}
}

iosMain {
dependencies {
implementation(projects.permissionsAvfoundation)
}
}
}

dependencies {
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.cli)
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.formatting)
}
}
47 changes: 39 additions & 8 deletions permissions-compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,27 +1,58 @@
import io.gitlab.arturbosch.detekt.CONFIGURATION_DETEKT_PLUGINS

/*
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("dev.icerock.moko.gradle.multiplatform.mobile")
id("org.jetbrains.kotlin.multiplatform")
id("org.jetbrains.kotlin.plugin.compose")
id("com.android.library")
id("dev.icerock.moko.gradle.publication")
id("dev.icerock.moko.gradle.stub.javadoc")
id("dev.icerock.moko.gradle.detekt")
alias(libs.plugins.detekt)
id("org.jetbrains.compose")
}

android {
namespace = "dev.icerock.moko.permissions.compose"
compileSdk = 36

defaultConfig {
minSdk = 21
}
}

dependencies {
commonMainApi(projects.permissions)
commonMainApi(compose.runtime)
androidMainImplementation(libs.activity)
androidMainImplementation(libs.composeUi)
androidMainImplementation(libs.lifecycleRuntime)
kotlin {
applyDefaultHierarchyTemplate()

androidTarget { publishLibraryVariants("release", "debug") }

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
)
Comment on lines +27 to +35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be from convention plugin too


sourceSets {
commonMain {
dependencies {
api(projects.permissions)
api(compose.runtime)
}
}

androidMain {
dependencies {
implementation(libs.activity)
implementation(libs.composeUi)
implementation(libs.lifecycleRuntime)
}
}
}
Comment on lines +37 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what reason to change small version of dependency declaration to this one?


dependencies {
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.cli)
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.formatting)
}
}
35 changes: 30 additions & 5 deletions permissions-contacts/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
import io.gitlab.arturbosch.detekt.CONFIGURATION_DETEKT_PLUGINS

/*
* Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("dev.icerock.moko.gradle.multiplatform.mobile")
id("org.jetbrains.kotlin.multiplatform")
id("com.android.library")
id("dev.icerock.moko.gradle.publication")
id("dev.icerock.moko.gradle.stub.javadoc")
id("dev.icerock.moko.gradle.detekt")
alias(libs.plugins.detekt)
}

android {
namespace = "dev.icerock.moko.permissions.contacts"
compileSdk = 36
}

dependencies {
commonMainApi(projects.permissions)
commonMainImplementation(libs.coroutines)
kotlin {
applyDefaultHierarchyTemplate()

androidTarget { publishLibraryVariants("release", "debug") }

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
)
Comment on lines +21 to +29
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be from convention plugin too


sourceSets {
commonMain {
dependencies {
api(projects.permissions)
implementation(libs.coroutines)
}
}
}

dependencies {
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.cli)
CONFIGURATION_DETEKT_PLUGINS(libs.detekt.formatting)
}
}
Loading