Skip to content

Update Kotlin to 1.6.0-RC #2980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 12, 2021
Merged
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Kotlin
version=1.5.2-SNAPSHOT
group=org.jetbrains.kotlinx
kotlin_version=1.5.30
kotlin_version=1.6.0-RC

# Dependencies
junit_version=4.12
Expand Down
1 change: 1 addition & 0 deletions kotlinx-coroutines-core/common/src/flow/operators/Delay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import kotlin.time.*
----- INCLUDE .*
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.time.Duration.Companion.milliseconds

fun main() = runBlocking {
----- SUFFIX .*
Expand Down
2 changes: 2 additions & 0 deletions kotlinx-coroutines-core/common/test/DelayDurationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package kotlinx.coroutines

import kotlin.test.*
import kotlin.time.*
import kotlin.time.Duration.Companion.seconds
import kotlin.time.Duration.Companion.nanoseconds

@ExperimentalTime
class DelayDurationTest : TestBase() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package kotlinx.coroutines.flow
import kotlinx.coroutines.*
import kotlin.test.*
import kotlin.time.*
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.seconds

class SharingStartedWhileSubscribedTest : TestBase() {
@Test // make sure equals works properly, or otherwise other tests don't make sense
Expand All @@ -30,14 +32,15 @@ class SharingStartedWhileSubscribedTest : TestBase() {
@Test
fun testDurationParams() {
assertEquals(SharingStarted.WhileSubscribed(0), SharingStarted.WhileSubscribed(Duration.ZERO))
assertEquals(SharingStarted.WhileSubscribed(10), SharingStarted.WhileSubscribed(Duration.milliseconds(10)))
assertEquals(SharingStarted.WhileSubscribed(10), SharingStarted.WhileSubscribed(10.milliseconds))
assertEquals(SharingStarted.WhileSubscribed(1000), SharingStarted.WhileSubscribed(1.seconds))
assertEquals(SharingStarted.WhileSubscribed(Long.MAX_VALUE), SharingStarted.WhileSubscribed(Duration.INFINITE))
assertEquals(SharingStarted.WhileSubscribed(replayExpirationMillis = 0), SharingStarted.WhileSubscribed(replayExpiration = Duration.ZERO))
assertEquals(SharingStarted.WhileSubscribed(replayExpirationMillis = 3), SharingStarted.WhileSubscribed(
replayExpiration = Duration.milliseconds(3)
))
assertEquals(SharingStarted.WhileSubscribed(replayExpirationMillis = 7000), SharingStarted.WhileSubscribed(replayExpiration = 7.seconds))
assertEquals(SharingStarted.WhileSubscribed(replayExpirationMillis = 7000),
SharingStarted.WhileSubscribed(replayExpiration = 7.seconds))
assertEquals(SharingStarted.WhileSubscribed(replayExpirationMillis = Long.MAX_VALUE), SharingStarted.WhileSubscribed(replayExpiration = Duration.INFINITE))
}

Expand Down
Binary file modified kotlinx-coroutines-core/jvm/resources/DebugProbesKt.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package kotlinx.coroutines.examples.exampleDelay01

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.time.Duration.Companion.milliseconds

fun main() = runBlocking {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package kotlinx.coroutines.examples.exampleDelay02

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.time.Duration.Companion.milliseconds

fun main() = runBlocking {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package kotlinx.coroutines.examples.exampleDelay03

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.time.Duration.Companion.milliseconds

fun main() = runBlocking {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package kotlinx.coroutines.examples.exampleDelayDuration01
import kotlin.time.*
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.time.Duration.Companion.milliseconds

fun main() = runBlocking {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package kotlinx.coroutines.examples.exampleDelayDuration02
import kotlin.time.*
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.time.Duration.Companion.milliseconds

fun main() = runBlocking {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package kotlinx.coroutines.examples.exampleDelayDuration03
import kotlin.time.*
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.time.Duration.Companion.milliseconds

fun main() = runBlocking {

Expand Down
4 changes: 2 additions & 2 deletions kotlinx-coroutines-core/jvm/test/flow/SharedFlowStressTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class SharedFlowStressTest : TestBase() {
var lastProduced = 0L
var lastConsumed = 0L
for (sec in 1..nSeconds) {
delay(1.seconds)
delay(Duration.seconds(1))
val produced = totalProduced.value
val consumed = totalConsumed.value
println("$sec sec: produced = $produced; consumed = $consumed")
Expand All @@ -84,4 +84,4 @@ class SharedFlowStressTest : TestBase() {
jobs.forEach { it.join() }
println("total: produced = ${totalProduced.value}; consumed = ${totalConsumed.value}")
}
}
}
19 changes: 11 additions & 8 deletions ui/kotlinx-coroutines-javafx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ plugins {
id("org.openjfx.javafxplugin") version "0.0.9"
}

configurations {
register("javafx")
named("compileOnly") {
extendsFrom(configurations["javafx"])
}
named("testImplementation") {
extendsFrom(configurations["javafx"])
}
}

javafx {
version = version("javafx")
modules = listOf("javafx.controls")
configuration = "compileOnly"
}

sourceSets {
test.configure {
compileClasspath += configurations.compileOnly
runtimeClasspath += configurations.compileOnly
}
configuration = "javafx"
}

val JDK_18: String? by lazy {
Expand Down