Skip to content

Commit 57b2729

Browse files
authored
Merge pull request #138 from arkivanov/update-kotlin-to-1.4.0
Update Kotlin to 1.4.0
2 parents f07272f + 0181d1d commit 57b2729

File tree

6 files changed

+26
-53
lines changed

6 files changed

+26
-53
lines changed

buildSrc/buildSrc/src/main/kotlin/Deps.kt renamed to buildSrc/buildSrc/src/main/kotlin/dependencies/Deps.kt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ object Deps {
22

33
object Jetbrains {
44
object Kotlin : Group(name = "org.jetbrains.kotlin") {
5-
private const val version = "1.3.72"
5+
private const val version = "1.4.0"
66

77
object Plugin {
88
object Gradle : Dependency(group = Kotlin, name = "kotlin-gradle-plugin", version = version)
@@ -14,8 +14,6 @@ object Deps {
1414
object Js : Dependency(group = Kotlin, name = "kotlin-stdlib-js", version = version)
1515
}
1616

17-
object Reflect : Dependency(group = Kotlin, name = "kotlin-reflect", version = version)
18-
1917
object Test {
2018
object Common : Dependency(group = Kotlin, name = "kotlin-test-common", version = version)
2119
object Js : Dependency(group = Kotlin, name = "kotlin-test-js", version = version)
@@ -29,14 +27,9 @@ object Deps {
2927

3028
object Kotlinx : Group(name = "org.jetbrains.kotlinx") {
3129
object Coroutines {
32-
private const val version = "1.3.5"
33-
34-
object Core : Dependency(group = Kotlinx, name = "kotlinx-coroutines-core", version = version) {
35-
object Common : Dependency(group = Kotlinx, name = "kotlinx-coroutines-core-common", version = version)
36-
object Native : Dependency(group = Kotlinx, name = "kotlinx-coroutines-core-native", version = version)
37-
object Js : Dependency(group = Kotlinx, name = "kotlinx-coroutines-core-js", version = version)
38-
}
30+
private const val version = "1.3.9"
3931

32+
object Core : Dependency(group = Kotlinx, name = "kotlinx-coroutines-core", version = version)
4033
object Android : Dependency(group = Kotlinx, name = "kotlinx-coroutines-android", version = version)
4134
}
4235
}
@@ -81,7 +74,7 @@ object Deps {
8174

8275
object Badoo {
8376
object Reaktive : Group(name = "com.badoo.reaktive") {
84-
private const val version = "1.1.16"
77+
private const val version = "1.1.17"
8578

8679
object Reaktive : Dependency(group = Badoo.Reaktive, name = "reaktive", version = version)
8780
object ReaktiveAnnotations : Dependency(group = Badoo.Reaktive, name = "reaktive-annotations", version = version)

buildSrc/src/main/kotlin/Config.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,22 @@ inline fun <reified T : BuildTarget> ExtensionAware.doIfBuildTargetAvailable(blo
9595
}
9696
}
9797

98+
val Project.isAnyTargetAvailable: Boolean
99+
get() = buildType.buildTargets.any { it in buildTargets }
100+
98101
fun Project.setupMultiplatform() {
99-
plugins.apply("kotlin-multiplatform")
102+
if (!isAnyTargetAvailable) {
103+
return
104+
}
100105

101106
doIfBuildTargetAvailable<BuildTarget.Android> {
102107
plugins.apply("com.android.library")
103108

104109
setupAndroidSdkVersions()
105110
}
106111

112+
plugins.apply("kotlin-multiplatform")
113+
107114
kotlin {
108115
doIfBuildTargetAvailable<BuildTarget.Js> {
109116
js {
@@ -367,7 +374,9 @@ fun Project.android(block: BaseExtension.() -> Unit) {
367374
}
368375

369376
fun Project.kotlin(block: KotlinMultiplatformExtension.() -> Unit) {
370-
extensions.getByType<KotlinMultiplatformExtension>().block()
377+
if (isAnyTargetAvailable) {
378+
extensions.getByType<KotlinMultiplatformExtension>().block()
379+
}
371380
}
372381

373382
fun Project.setupXcodeSync() {

mvikotlin-extensions-coroutines/build.gradle.kts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,8 @@ kotlin {
99
implementation(project(":rx"))
1010
implementation(project(":utils-internal"))
1111
implementation(Deps.Badoo.Reaktive.Utils)
12-
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core.Common)
13-
}
14-
}
15-
16-
jvmCommonMain {
17-
dependencies {
1812
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core)
1913
}
2014
}
21-
22-
nativeCommonMain {
23-
dependencies {
24-
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core.Native)
25-
}
26-
}
27-
28-
jsMain {
29-
dependencies {
30-
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core.Js)
31-
}
32-
}
3315
}
3416
}

mvikotlin-timetravel-proto-internal/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ kotlin {
99
}
1010
}
1111
}
12-
}
12+
}

sample/todo-app-js/build.gradle.kts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ val muirwik_version = "0.4.1"
1414

1515
dependencies {
1616
implementation(Deps.Jetbrains.Kotlin.StdLib.Js)
17-
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core.Js)
17+
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core)
1818

1919
implementation("org.jetbrains:kotlin-react:$kotlin_react_version")
2020
implementation("org.jetbrains:kotlin-react-dom:$kotlin_react_version")
@@ -44,5 +44,12 @@ dependencies {
4444
implementation(npm("@material-ui/icons", "4.9.1"))
4545
}
4646

47-
kotlin.target.useCommonJs()
48-
kotlin.target.browser {}
47+
kotlin.withGroovyBuilder {
48+
"js" {
49+
"useCommonJs"()
50+
"browser"()
51+
"binaries" {
52+
"executable"()
53+
}
54+
}
55+
}

sample/todo-coroutines/build.gradle.kts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,8 @@ kotlin {
1010
implementation(project(":mvikotlin-extensions-coroutines"))
1111
api(project(":sample:todo-common"))
1212
implementation(project(":sample:todo-common-internal"))
13-
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core.Common)
14-
}
15-
}
16-
17-
jvmCommonMain {
18-
dependencies {
1913
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core)
2014
}
2115
}
22-
23-
nativeCommonMain {
24-
dependencies {
25-
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core.Native)
26-
}
27-
}
28-
29-
jsMain {
30-
dependencies {
31-
implementation(Deps.Jetbrains.Kotlinx.Coroutines.Core.Js)
32-
}
33-
}
3416
}
3517
}

0 commit comments

Comments
 (0)