Skip to content

Commit 67d746c

Browse files
committed
update libs config
1 parent 6ed829c commit 67d746c

File tree

9 files changed

+85
-24
lines changed

9 files changed

+85
-24
lines changed

build.gradle.kts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44

55
buildscript {
66
repositories {
7-
google()
7+
google {
8+
content {
9+
includeGroupByRegex("com\\.android.*")
10+
includeGroupByRegex("com\\.google.*")
11+
includeGroupByRegex("androidx.*")
12+
}
13+
}
814
mavenCentral()
15+
gradlePluginPortal()
916
}
1017
dependencies {
1118
classpath(":javascript-build-logic")
@@ -15,6 +22,6 @@ buildscript {
1522
allprojects {
1623
plugins.withId("org.gradle.maven-publish") {
1724
group = "dev.icerock.moko"
18-
version = libs.versions.mokoJavascriptVersion.get()
25+
version = moko.versions.mokoJavascriptVersion.get()
1926
}
2027
}

gradle/libs.versions.toml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
kotlinTestVersion = "2.2.10"
2+
kotlinVersion = "2.2.10"
33
androidAppCompatVersion = "1.7.1"
44
materialDesignVersion = "1.13.0"
55
androidLifecycleVersion = "2.2.0"
@@ -8,22 +8,29 @@ testJUnitExtVersion = "1.3.0"
88
coroutinesVersion = "1.10.2"
99
kotlinxSerializationVersion = "1.9.0"
1010
mokoTestVersion = "0.6.1"
11-
mokoJavascriptVersion = "0.4.0"
1211
ziplineVersion = "1.23.0"
13-
12+
mokoMultiplatformVersion = "0.14.4"
13+
androidGradleVersion = "8.12.3"
14+
detektVersion = "1.23.8"
1415

1516
[libraries]
1617
appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidAppCompatVersion" }
1718
material = { module = "com.google.android.material:material", version.ref = "materialDesignVersion" }
1819
lifecycle = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "androidLifecycleVersion" }
19-
kotlinTestJUnit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinTestVersion" }
20+
kotlinTestJUnit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinVersion" }
2021
testRunner = { module = "androidx.test:runner", version.ref = "androidCoreTestingVersion" }
2122
testRules = { module = "androidx.test:rules", version.ref = "androidCoreTestingVersion" }
2223
testJUnitExt = { module = "androidx.test.ext:junit", version.ref = "testJUnitExtVersion" }
2324
testJUnitExtKtx = { module = "androidx.test.ext:junit-ktx", version.ref = "testJUnitExtVersion" }
2425
ziplineAndroid = { module = "app.cash.zipline:zipline-android", version.ref = "ziplineVersion" }
2526
coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutinesVersion" }
2627
kotlinSerialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationVersion" }
27-
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlinTestVersion" }
28-
kotlinTestAnnotations = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlinTestVersion" }
28+
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlinVersion" }
29+
kotlinTestAnnotations = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlinVersion" }
2930
mokoTest = { module = "dev.icerock.moko:test-core", version.ref = "mokoTestVersion" }
31+
32+
mokoMultiplatform = { module = "dev.icerock:mobile-multiplatform", version.ref = "mokoMultiplatformVersion" }
33+
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
34+
androidGradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradleVersion" }
35+
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detektVersion" }
36+
detektPlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detektVersion" }

javascript-build-logic/build.gradle.kts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@ plugins {
33
}
44

55
repositories {
6-
google()
7-
gradlePluginPortal()
6+
google {
7+
content {
8+
includeGroupByRegex("com\\.android.*")
9+
includeGroupByRegex("com\\.google.*")
10+
includeGroupByRegex("androidx.*")
11+
}
12+
}
813
mavenCentral()
14+
gradlePluginPortal()
915
}
1016

1117
dependencies {
12-
implementation("dev.icerock:mobile-multiplatform:0.14.1")
13-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.10")
14-
implementation("com.android.tools.build:gradle:8.12.3")
15-
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.15.0")
18+
implementation(libs.mokoMultiplatform)
19+
implementation(libs.kotlinGradlePlugin)
20+
implementation(libs.androidGradlePlugin)
21+
implementation(libs.detektPlugin)
1622
}

javascript-build-logic/settings.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ rootProject.name = "javascript-build-logic"
66

77
dependencyResolutionManagement {
88
repositories {
9+
google {
10+
content {
11+
includeGroupByRegex("com\\.android.*")
12+
includeGroupByRegex("com\\.google.*")
13+
includeGroupByRegex("androidx.*")
14+
}
15+
}
16+
917
mavenCentral()
10-
google()
1118
}
1219

1320
versionCatalogs {

javascript-build-logic/src/main/kotlin/android-base-convention.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ configure<BaseExtension> {
88
compileSdkVersion(36)
99

1010
defaultConfig {
11-
minSdk = 21
11+
minSdk = 24
1212
targetSdk = 36
1313
}
1414

javascript-build-logic/src/main/kotlin/detekt-convention.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ plugins {
77
}
88

99
detekt {
10-
input.setFrom("src/commonMain/kotlin", "src/androidMain/kotlin", "src/iosMain/kotlin", "src/main/kotlin")
10+
source.setFrom("src/commonMain/kotlin", "src/androidMain/kotlin", "src/iosMain/kotlin", "src/main/kotlin")
1111
}
1212

1313
dependencies {
14-
"detektPlugins"("io.gitlab.arturbosch.detekt:detekt-formatting:1.15.0")
14+
detektPlugins(libs.safeLibrary("detekt-formatting"))
1515
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2025 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
import org.gradle.api.GradleException
6+
import org.gradle.api.Project
7+
import org.gradle.api.artifacts.ExternalModuleDependencyBundle
8+
import org.gradle.api.artifacts.MinimalExternalModuleDependency
9+
import org.gradle.api.artifacts.VersionCatalog
10+
import org.gradle.api.artifacts.VersionCatalogsExtension
11+
import org.gradle.api.provider.Provider
12+
13+
internal val Project.libs: VersionCatalog
14+
get() = this.extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
15+
16+
internal fun VersionCatalog.safeLibrary(alias: String): Provider<MinimalExternalModuleDependency> {
17+
try {
18+
return findLibrary(alias).get()
19+
} catch (_: Exception) {
20+
throw GradleException("library $alias not found in libs.versions.toml")
21+
}
22+
}
23+
24+
internal fun VersionCatalog.safeBundle(alias: String): Provider<ExternalModuleDependencyBundle> {
25+
try {
26+
return findBundle(alias).get()
27+
} catch (_: Exception) {
28+
throw GradleException("bundle $alias not found in libs.versions.toml")
29+
}
30+
}

sample/android-app/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
plugins {
66
id("android-app-convention")
7-
id("kotlin-android")
87
}
98

109
android {

settings.gradle.kts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
/*
2-
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2025 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33
*/
4-
rootProject.name = "moko-javascript"
54

65
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
76

87
dependencyResolutionManagement {
98
repositories {
9+
google {
10+
content {
11+
includeGroupByRegex("com\\.android.*")
12+
includeGroupByRegex("com\\.google.*")
13+
includeGroupByRegex("androidx.*")
14+
}
15+
}
1016
mavenCentral()
11-
google()
12-
13-
includeBuild("javascript-build-logic")
1417
}
1518

1619
versionCatalogs {
@@ -20,6 +23,8 @@ dependencyResolutionManagement {
2023
}
2124
}
2225

26+
rootProject.name = "moko-javascript"
27+
2328
if (gradle.parent == null) {
2429
includeBuild("javascript-build-logic")
2530
}

0 commit comments

Comments
 (0)