Skip to content

Commit bc35cd8

Browse files
authored
Update Kotlin to 1.9.0 (#3814)
* Update Kotlin to 1.9.0 * Get rid of legacy JS post 1.9.0 * Stop publishing into NPM * Stop testing on exotic JS targets * Update DebugProbesKt.bin Fixes #3812
1 parent 47f0a46 commit bc35cd8

15 files changed

+27
-296
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
[![JetBrains official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
55
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
66
[![Download](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.7.2)](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.7.2)
7-
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
7+
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
88
[![Slack channel](https://img.shields.io/badge/chat-slack-green.svg?logo=slack)](https://kotlinlang.slack.com/messages/coroutines/)
99

1010
Library support for Kotlin coroutines with [multiplatform](#multiplatform) support.
11-
This is a companion version for the Kotlin `1.8.20` release.
11+
This is a companion version for the Kotlin `1.9.0` release.
1212

1313
```kotlin
1414
suspend fun main() = coroutineScope {
@@ -93,7 +93,7 @@ And make sure that you use the latest Kotlin version:
9393

9494
```xml
9595
<properties>
96-
<kotlin.version>1.8.20</kotlin.version>
96+
<kotlin.version>1.9.0</kotlin.version>
9797
</properties>
9898
```
9999

@@ -112,10 +112,10 @@ And make sure that you use the latest Kotlin version:
112112
```kotlin
113113
plugins {
114114
// For build.gradle.kts (Kotlin DSL)
115-
kotlin("jvm") version "1.8.20"
115+
kotlin("jvm") version "1.9.0"
116116

117117
// For build.gradle (Groovy DSL)
118-
id "org.jetbrains.kotlin.jvm" version "1.8.20"
118+
id "org.jetbrains.kotlin.jvm" version "1.9.0"
119119
}
120120
```
121121

build.gradle

+1-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ buildscript {
6363
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
6464
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version"
6565
classpath "org.jetbrains.kotlinx:kotlinx-knit:$knit_version"
66-
classpath "com.github.node-gradle:gradle-node-plugin:$gradle_node_version"
6766
classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$binary_compatibility_validator_version"
6867
classpath "ru.vyarus:gradle-animalsniffer-plugin:1.5.4" // Android API check
6968
classpath "org.jetbrains.kotlin:atomicfu:$kotlin_version"
@@ -161,7 +160,6 @@ configure(subprojects.findAll { !sourceless.contains(it.name) && it.name != core
161160
}
162161

163162
apply from: rootProject.file("gradle/compile-js-multiplatform.gradle")
164-
apply from: rootProject.file("gradle/publish-npm-js.gradle")
165163
kotlin.sourceSets.commonMain.dependencies {
166164
api project(":$coreModule")
167165
}
@@ -303,7 +301,7 @@ allprojects {
303301

304302
// --------------- Configure sub-projects that are published ---------------
305303

306-
def publishTasks = getTasksByName("publish", true) + getTasksByName("publishNpm", true)
304+
def publishTasks = getTasksByName("publish", true)
307305

308306
task deploy(dependsOn: publishTasks)
309307

buildSrc/src/main/kotlin/configure-compilation-conventions.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ configure(subprojects) {
2828
}
2929

3030
val KotlinCommonOptions.versionsAreNotOverridden: Boolean
31-
get() = languageVersion == null && apiVersion == null
31+
get() = languageVersion == null && apiVersion == null

buildSrc/src/main/kotlin/kotlin-js-conventions.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Platform-specific configuration to compile JS modules
66

77
import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile
8+
import org.jetbrains.kotlin.gradle.targets.js.*
89

910
plugins {
1011
kotlin("js")
@@ -15,7 +16,7 @@ dependencies {
1516
}
1617

1718
kotlin {
18-
js(LEGACY) {
19+
js(IR) {
1920
moduleName = project.name.removeSuffix("-js")
2021
}
2122

gradle.properties

+1-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Kotlin
66
version=1.7.2-SNAPSHOT
77
group=org.jetbrains.kotlinx
8-
kotlin_version=1.8.20
8+
kotlin_version=1.9.0
99

1010
# Dependencies
1111
junit_version=4.12
@@ -33,18 +33,6 @@ androidx_annotation_version=1.1.0
3333
robolectric_version=4.9
3434
baksmali_version=2.2.7
3535

36-
# JS
37-
kotlin.js.compiler=both
38-
gradle_node_version=3.1.1
39-
node_version=10.0.0
40-
npm_version=5.7.1
41-
mocha_version=6.2.2
42-
mocha_headless_chrome_version=1.8.2
43-
mocha_teamcity_reporter_version=3.0.0
44-
source_map_support_version=0.5.16
45-
jsdom_version=15.2.1
46-
jsdom_global_version=3.0.2
47-
4836
# Settings
4937
kotlin.incremental.multiplatform=true
5038
kotlin.native.ignoreDisabledTargets=true

gradle/compile-js-multiplatform.gradle

+3-64
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
apply from: rootProject.file('gradle/node-js.gradle')
6-
75
kotlin {
86
js {
97
moduleName = project.name
10-
11-
// In 1.4.x it has in `both` and `legacy` mode and js() is of type `KotlinJsTarget`
12-
// `irTarget` is non-null in `both` mode
13-
// and contains appropriate `irTarget` with type `KotlinJsIrTarget`
14-
// `irTarget` is null in `legacy` mode
15-
if (it.irTarget != null) {
16-
irTarget.nodejs()
17-
irTarget.compilations['main']?.dependencies {
18-
api "org.jetbrains.kotlinx:atomicfu-js:$atomicfu_version"
19-
}
8+
nodejs()
9+
compilations['main']?.dependencies {
10+
api "org.jetbrains.kotlinx:atomicfu-js:$atomicfu_version"
2011
}
2112
}
2213

@@ -26,55 +17,3 @@ kotlin {
2617
}
2718
}
2819
}
29-
30-
// When source sets are configured
31-
apply from: rootProject.file('gradle/test-mocha-js.gradle')
32-
33-
def compileJsLegacy = tasks.hasProperty("compileKotlinJsLegacy")
34-
? compileKotlinJsLegacy
35-
: compileKotlinJs
36-
37-
def compileTestJsLegacy = tasks.hasProperty("compileTestKotlinJsLegacy")
38-
? compileTestKotlinJsLegacy
39-
: compileTestKotlinJs
40-
41-
compileJsLegacy.configure {
42-
kotlinOptions.metaInfo = true
43-
kotlinOptions.sourceMap = true
44-
kotlinOptions.moduleKind = 'umd'
45-
46-
kotlinOptions {
47-
// drop -js suffix from outputFile
48-
def baseName = project.name - "-js"
49-
outputFile = new File(outputFileProperty.get().parent, baseName + ".js")
50-
}
51-
}
52-
53-
compileTestJsLegacy.configure {
54-
kotlinOptions.metaInfo = true
55-
kotlinOptions.sourceMap = true
56-
kotlinOptions.moduleKind = 'umd'
57-
}
58-
59-
60-
task populateNodeModules(type: Copy, dependsOn: compileTestJsLegacy) {
61-
// we must copy output that is transformed by atomicfu
62-
from(kotlin.js().compilations.main.output.allOutputs)
63-
into node.nodeProjectDir.dir("node_modules")
64-
65-
def configuration = configurations.hasProperty("jsLegacyTestRuntimeClasspath")
66-
? configurations.jsLegacyTestRuntimeClasspath
67-
: configurations.jsTestRuntimeClasspath
68-
69-
from(files {
70-
configuration.collect { File file ->
71-
file.name.endsWith(".jar") ?
72-
zipTree(file.absolutePath).matching {
73-
include '*.js'
74-
include '*.js.map'
75-
} : files()
76-
}
77-
}.builtBy(configuration))
78-
}
79-
80-
npmInstall.dependsOn populateNodeModules

gradle/node-js.gradle

-40
This file was deleted.

gradle/publish-npm-js.gradle

-54
This file was deleted.

gradle/test-mocha-js.gradle

-105
This file was deleted.

0 commit comments

Comments
 (0)