Switch sourcesets of experimental and release coroutines
- Move experimental coroutines out of the main source root. - Include experimental coroutines into the coroutines source set. - Include release coroutines into the main source set.
This commit is contained in:
@@ -19,6 +19,8 @@ sourceSets {
|
||||
srcDir 'src'
|
||||
srcDir commonSrcDir
|
||||
srcDir '../unsigned/src'
|
||||
srcDir '../coroutines/common/src'
|
||||
srcDir '../coroutines/src'
|
||||
}
|
||||
}
|
||||
test {
|
||||
@@ -29,8 +31,7 @@ sourceSets {
|
||||
}
|
||||
coroutines {
|
||||
kotlin {
|
||||
srcDir '../coroutines/common/src'
|
||||
srcDir '../coroutines/src'
|
||||
srcDir '../coroutines-experimental/src'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,6 +58,7 @@ compileKotlinCommon {
|
||||
"-Xuse-experimental=kotlin.ExperimentalUnsignedTypes",
|
||||
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
|
||||
"-XXLanguage:+InlineClasses",
|
||||
"-XXLanguage:+ReleaseCoroutines",
|
||||
"-Xallow-kotlin-package"
|
||||
]
|
||||
}
|
||||
@@ -69,6 +71,7 @@ compileCoroutinesKotlinCommon {
|
||||
freeCompilerArgs = [
|
||||
"-module-name", project.name+"-coroutines",
|
||||
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
|
||||
"-XXLanguage:-ReleaseCoroutines",
|
||||
"-Xallow-kotlin-package"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import kotlin.*
|
||||
import kotlin.text.*
|
||||
import kotlin.comparisons.*
|
||||
import kotlin.random.*
|
||||
import kotlin.coroutines.experimental.*
|
||||
|
||||
/**
|
||||
* Returns `true` if [element] is found in the sequence.
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin.coroutines.experimental
|
||||
|
||||
@PublishedApi
|
||||
internal expect class SafeContinuation<in T> : Continuation<T> {
|
||||
internal constructor(delegate: Continuation<T>, initialResult: Any?)
|
||||
|
||||
@PublishedApi
|
||||
internal constructor(delegate: Continuation<T>)
|
||||
|
||||
@PublishedApi
|
||||
internal fun getResult(): Any?
|
||||
|
||||
override val context: CoroutineContext
|
||||
override fun resume(value: T): Unit
|
||||
override fun resumeWithException(exception: Throwable): Unit
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin.coroutines.experimental.intrinsics
|
||||
|
||||
import kotlin.coroutines.experimental.Continuation
|
||||
|
||||
/**
|
||||
* Starts unintercepted coroutine without receiver and with result type [T] and executes it until its first suspension.
|
||||
* Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends.
|
||||
* In the later case, the [completion] continuation is invoked when coroutine completes with result or exception.
|
||||
* This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of suspended
|
||||
* coroutine using a reference to the suspending function.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public expect inline fun <T> (suspend () -> T).startCoroutineUninterceptedOrReturn(
|
||||
completion: Continuation<T>
|
||||
): Any?
|
||||
|
||||
/**
|
||||
* Starts unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension.
|
||||
* Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends.
|
||||
* In the later case, the [completion] continuation is invoked when coroutine completes with result or exception.
|
||||
* This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of suspended
|
||||
* coroutine using a reference to the suspending function.
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public expect inline fun <R, T> (suspend R.() -> T).startCoroutineUninterceptedOrReturn(
|
||||
receiver: R,
|
||||
completion: Continuation<T>
|
||||
): Any?
|
||||
|
||||
@SinceKotlin("1.1")
|
||||
public expect fun <T> (suspend () -> T).createCoroutineUnchecked(
|
||||
completion: Continuation<T>
|
||||
): Continuation<Unit>
|
||||
|
||||
@SinceKotlin("1.1")
|
||||
public expect fun <R, T> (suspend R.() -> T).createCoroutineUnchecked(
|
||||
receiver: R,
|
||||
completion: Continuation<T>
|
||||
): Continuation<Unit>
|
||||
Reference in New Issue
Block a user