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

Commit 2cacf9a

Browse files
authored
Merge pull request #285 from icerockdev/#284-update-kotlin-1.4.10
#284 Kotlin 1.4
2 parents 6ac144a + ac87e14 commit 2cacf9a

File tree

54 files changed

+472
-801
lines changed

Some content is hidden

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

54 files changed

+472
-801
lines changed

build.gradle.kts

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ buildscript {
1111
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
1212
maven { url = uri("https://plugins.gradle.org/m2/") }
1313
maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
14-
15-
maven { url = uri("https://dl.bintray.com/icerockdev/plugins-dev") }
1614
}
1715
dependencies {
18-
Deps.plugins.values.forEach { classpath(it) }
16+
plugin(Deps.Plugins.mokoResources)
17+
plugin(Deps.Plugins.mokoWidgets)
1918
}
2019
}
2120

@@ -34,20 +33,6 @@ allprojects {
3433
maven { url = uri("https://dl.bintray.com/icerockdev/plugins-dev") }
3534
}
3635

37-
// Workaround for https://youtrack.jetbrains.com/issue/KT-36721.
38-
pluginManager.withPlugin("kotlin-multiplatform") {
39-
val kotlinExtension = project.extensions.getByName("kotlin")
40-
as org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
41-
val uniqueName = "${project.group}.${project.name}"
42-
43-
kotlinExtension.targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget::class.java) {
44-
compilations["main"].kotlinOptions.freeCompilerArgs += listOf(
45-
"-module-name",
46-
uniqueName
47-
)
48-
}
49-
}
50-
5136
configurations
5237
.matching { it.name == "compileOnly" }
5338
.configureEach {
@@ -56,6 +41,25 @@ allprojects {
5641
"compileOnly"("javax.annotation:jsr250-api:1.0")
5742
}
5843
}
44+
45+
configurations.all {
46+
resolutionStrategy.dependencySubstitution {
47+
substitute(module("com.nbsp:library"))
48+
.using(module("com.nbsp:materialfilepicker:1.9.1"))
49+
.because("androidx support in new artifact")
50+
}
51+
}
52+
53+
plugins.withType<com.android.build.gradle.LibraryPlugin> {
54+
configure<com.android.build.gradle.LibraryExtension> {
55+
compileSdkVersion(Deps.Android.compileSdk)
56+
57+
defaultConfig {
58+
minSdkVersion(Deps.Android.minSdk)
59+
targetSdkVersion(Deps.Android.targetSdk)
60+
}
61+
}
62+
}
5963

6064
val project = this
6165
val bintrayPath: Pair<String, String>?
@@ -64,18 +68,7 @@ allprojects {
6468
bintrayPath = "moko" to "moko-widgets"
6569

6670
this.group = "dev.icerock.moko"
67-
this.version = Versions.Libs.MultiPlatform.mokoWidgets
68-
69-
this.plugins.withType<com.android.build.gradle.LibraryPlugin> {
70-
this@allprojects.configure<com.android.build.gradle.LibraryExtension> {
71-
compileSdkVersion(Versions.Android.compileSdk)
72-
73-
defaultConfig {
74-
minSdkVersion(Versions.Android.minSdk)
75-
targetSdkVersion(Versions.Android.targetSdk)
76-
}
77-
}
78-
}
71+
this.version = Deps.mokoWidgetsVersion
7972
}
8073
else -> {
8174
bintrayPath = null

buildSrc/build.gradle.kts

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
22
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33
*/
4+
45
import java.io.ByteArrayOutputStream
5-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
66

77
plugins {
8-
kotlin("jvm") version "1.3.72"
8+
id("org.jetbrains.kotlin.jvm") version "1.4.30-M1"
99
id("com.github.kukuhyoniatmoko.buildconfigkotlin") version "1.0.5"
1010
}
1111

@@ -16,10 +16,22 @@ repositories {
1616
maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
1717
}
1818

19-
val devPublishing: Boolean = properties.containsKey("devPublish")
20-
val mokoWidgetsVersion: String = when (devPublishing) {
19+
dependencies {
20+
api(gradleApi())
21+
api("dev.icerock:mobile-multiplatform:0.9.0")
22+
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30-M1")
23+
api("com.android.tools.build:gradle:4.1.1")
24+
}
25+
26+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java).all {
27+
kotlinOptions {
28+
jvmTarget = "1.8"
29+
}
30+
}
31+
32+
val mokoWidgetsVersion: String = when (properties.containsKey("devPublish")) {
2133
true -> getGitCommit()
22-
false -> "0.1.0-dev-20"
34+
false -> "0.1.0-dev-21"
2335
}
2436

2537
buildConfigKotlin {
@@ -28,12 +40,6 @@ buildConfigKotlin {
2840
}
2941
}
3042

31-
dependencies {
32-
implementation("dev.icerock:mobile-multiplatform:0.6.1")
33-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")
34-
implementation("com.android.tools.build:gradle:3.6.4")
35-
}
36-
3743
fun getGitCommit(): String {
3844
val stdout = ByteArrayOutputStream()
3945
exec {
@@ -42,12 +48,3 @@ fun getGitCommit(): String {
4248
}
4349
return stdout.toString().trim()
4450
}
45-
46-
val compileKotlin: KotlinCompile by tasks
47-
compileKotlin.kotlinOptions {
48-
jvmTarget = "1.8"
49-
}
50-
val compileTestKotlin: KotlinCompile by tasks
51-
compileTestKotlin.kotlinOptions {
52-
jvmTarget = "1.8"
53-
}

0 commit comments

Comments
 (0)