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:
Ilya Gorbunov
2018-08-31 20:53:08 +03:00
parent 0fa2d29779
commit e22ca022d4
31 changed files with 25 additions and 30 deletions
+5 -2
View File
@@ -19,6 +19,8 @@ sourceSets {
srcDir 'src' srcDir 'src'
srcDir commonSrcDir srcDir commonSrcDir
srcDir '../unsigned/src' srcDir '../unsigned/src'
srcDir '../coroutines/common/src'
srcDir '../coroutines/src'
} }
} }
test { test {
@@ -29,8 +31,7 @@ sourceSets {
} }
coroutines { coroutines {
kotlin { kotlin {
srcDir '../coroutines/common/src' srcDir '../coroutines-experimental/src'
srcDir '../coroutines/src'
} }
} }
} }
@@ -57,6 +58,7 @@ compileKotlinCommon {
"-Xuse-experimental=kotlin.ExperimentalUnsignedTypes", "-Xuse-experimental=kotlin.ExperimentalUnsignedTypes",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts", "-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-XXLanguage:+InlineClasses", "-XXLanguage:+InlineClasses",
"-XXLanguage:+ReleaseCoroutines",
"-Xallow-kotlin-package" "-Xallow-kotlin-package"
] ]
} }
@@ -69,6 +71,7 @@ compileCoroutinesKotlinCommon {
freeCompilerArgs = [ freeCompilerArgs = [
"-module-name", project.name+"-coroutines", "-module-name", project.name+"-coroutines",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts", "-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-XXLanguage:-ReleaseCoroutines",
"-Xallow-kotlin-package" "-Xallow-kotlin-package"
] ]
} }
@@ -17,7 +17,6 @@ import kotlin.*
import kotlin.text.* import kotlin.text.*
import kotlin.comparisons.* import kotlin.comparisons.*
import kotlin.random.* import kotlin.random.*
import kotlin.coroutines.experimental.*
/** /**
* Returns `true` if [element] is found in the sequence. * Returns `true` if [element] is found in the sequence.
@@ -3,6 +3,8 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
package kotlin.coroutines.experimental.intrinsics package kotlin.coroutines.experimental.intrinsics
import kotlin.coroutines.experimental.Continuation import kotlin.coroutines.experimental.Continuation
@@ -5,6 +5,7 @@
@file:kotlin.jvm.JvmName("IntrinsicsKt") @file:kotlin.jvm.JvmName("IntrinsicsKt")
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
package kotlin.coroutines.experimental.intrinsics package kotlin.coroutines.experimental.intrinsics
@@ -4,6 +4,7 @@
*/ */
@file:kotlin.jvm.JvmName("CoroutinesKt") @file:kotlin.jvm.JvmName("CoroutinesKt")
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package kotlin.coroutines.experimental package kotlin.coroutines.experimental
@@ -5,7 +5,7 @@
@file:kotlin.jvm.JvmName("IntrinsicsKt") @file:kotlin.jvm.JvmName("IntrinsicsKt")
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package kotlin.coroutines.experimental.intrinsics package kotlin.coroutines.experimental.intrinsics
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -3,8 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "UNCHECKED_CAST")
package kotlin.coroutines.intrinsics package kotlin.coroutines.intrinsics
import kotlin.coroutines.* import kotlin.coroutines.*
@@ -121,6 +119,7 @@ private inline fun <T> createCoroutineFromSuspendFunction(
completion: Continuation<T>, completion: Continuation<T>,
crossinline block: () -> Any? crossinline block: () -> Any?
): Continuation<Unit> { ): Continuation<Unit> {
@Suppress("UNCHECKED_CAST")
return object : CoroutineImpl(completion as Continuation<Any?>) { return object : CoroutineImpl(completion as Continuation<Any?>) {
override fun doResume(): Any? { override fun doResume(): Any? {
exception?.let { throw it } exception?.let { throw it }
@@ -5,7 +5,7 @@
@file:kotlin.jvm.JvmName("IntrinsicsKt") @file:kotlin.jvm.JvmName("IntrinsicsKt")
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "UNCHECKED_CAST") @file:Suppress("UNCHECKED_CAST")
package kotlin.coroutines.intrinsics package kotlin.coroutines.intrinsics
@@ -8,10 +8,7 @@
"UNCHECKED_CAST", "UNCHECKED_CAST",
"RedundantVisibilityModifier", "RedundantVisibilityModifier",
"NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS", "NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS",
"UNSUPPORTED_FEATURE", "UNSUPPORTED_FEATURE"
"INVISIBLE_REFERENCE",
"INVISIBLE_MEMBER",
"CANNOT_OVERRIDE_INVISIBLE_MEMBER"
) )
package kotlin package kotlin
@@ -3,8 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
package kotlin.coroutines package kotlin.coroutines
import kotlin.coroutines.intrinsics.* import kotlin.coroutines.intrinsics.*
@@ -3,8 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
package kotlin.coroutines package kotlin.coroutines
import kotlin.coroutines.CoroutineContext.* import kotlin.coroutines.CoroutineContext.*
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:kotlin.jvm.JvmName("IntrinsicsKt") @file:kotlin.jvm.JvmName("IntrinsicsKt")
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@@ -3,7 +3,6 @@
* that can be found in the license/LICENSE.txt file. * that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:kotlin.jvm.JvmMultifileClass @file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("SequenceBuilderKt") @file:kotlin.jvm.JvmName("SequenceBuilderKt")
+6 -3
View File
@@ -16,6 +16,7 @@ def builtinsSrcDir2 = "${buildDir}/builtin-sources-for-builtins"
def commonSrcDir = "${projectDir}/../src/kotlin" def commonSrcDir = "${projectDir}/../src/kotlin"
def commonSrcDir2 = "${projectDir}/../common/src" def commonSrcDir2 = "${projectDir}/../common/src"
def coroutinesJsSrcDir = "${projectDir}/../coroutines/js/src" def coroutinesJsSrcDir = "${projectDir}/../coroutines/js/src"
def coroutinesExpJsSrcDir = "${projectDir}/../coroutines-experimental/js/src"
def builtinsDir = "${rootDir}/core/builtins" def builtinsDir = "${rootDir}/core/builtins"
def experimentalSrcDir = "${rootDir}/libraries/stdlib/experimental" def experimentalSrcDir = "${rootDir}/libraries/stdlib/experimental"
@@ -46,6 +47,7 @@ sourceSets {
kotlin { kotlin {
srcDir builtinsSrcDir srcDir builtinsSrcDir
srcDir jsSrcDir srcDir jsSrcDir
srcDir coroutinesJsSrcDir
} }
} }
@@ -64,7 +66,7 @@ sourceSets {
coroutines { coroutines {
kotlin { kotlin {
srcDir coroutinesJsSrcDir srcDir coroutinesExpJsSrcDir
} }
} }
} }
@@ -152,7 +154,7 @@ compileKotlin2Js {
"-Xuse-experimental=kotlin.ExperimentalMultiplatform", "-Xuse-experimental=kotlin.ExperimentalMultiplatform",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts", "-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-XXLanguage:+InlineClasses", "-XXLanguage:+InlineClasses",
"-XXLanguage:-ReleaseCoroutines" "-XXLanguage:+ReleaseCoroutines"
] ]
} }
} }
@@ -177,7 +179,8 @@ compileCoroutinesKotlin2Js {
sourceMap = true sourceMap = true
sourceMapPrefix = "./" sourceMapPrefix = "./"
freeCompilerArgs += [ freeCompilerArgs += [
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts" "-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-XXLanguage:-ReleaseCoroutines"
] ]
} }
} }
+6 -3
View File
@@ -30,6 +30,7 @@ sourceSets {
srcDir "${rootDir}/core/builtins/src" srcDir "${rootDir}/core/builtins/src"
srcDir 'runtime' srcDir 'runtime'
srcDir 'src' srcDir 'src'
srcDir '../coroutines/jvm/src'
} }
} }
experimental { experimental {
@@ -39,7 +40,7 @@ sourceSets {
} }
coroutines { coroutines {
kotlin { kotlin {
srcDir '../coroutines/jvm/src' srcDir '../coroutines-experimental/jvm/src'
} }
} }
coroutinesTest { coroutinesTest {
@@ -183,7 +184,7 @@ compileKotlin {
"-Xuse-experimental=kotlin.Experimental", "-Xuse-experimental=kotlin.Experimental",
"-Xuse-experimental=kotlin.ExperimentalMultiplatform", "-Xuse-experimental=kotlin.ExperimentalMultiplatform",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts", "-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-XXLanguage:-ReleaseCoroutines", "-XXLanguage:+ReleaseCoroutines",
"-XXLanguage:+InlineClasses" "-XXLanguage:+InlineClasses"
] ]
} }
@@ -214,6 +215,7 @@ compileCoroutinesKotlin {
"-Xallow-kotlin-package", "-Xallow-kotlin-package",
"-Xmultifile-parts-inherit", "-Xmultifile-parts-inherit",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts", "-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-XXLanguage:-ReleaseCoroutines",
"-module-name", "kotlin-stdlib-coroutines" "-module-name", "kotlin-stdlib-coroutines"
] ]
} }
@@ -254,7 +256,8 @@ compileUnsignedKotlin {
compileTestKotlin { compileTestKotlin {
kotlinOptions { kotlinOptions {
freeCompilerArgs += [ freeCompilerArgs += [
"-Xuse-experimental=kotlin.ExperimentalUnsignedTypes" "-Xuse-experimental=kotlin.ExperimentalUnsignedTypes",
"-XXLanguage:-ReleaseCoroutines"
] ]
} }
} }
@@ -16,7 +16,6 @@ package kotlin.sequences
import kotlin.* import kotlin.*
import kotlin.text.* import kotlin.text.*
import kotlin.comparisons.* import kotlin.comparisons.*
import kotlin.coroutines.experimental.*
/** /**
* Returns a sequence containing all elements that are instances of specified class. * Returns a sequence containing all elements that are instances of specified class.
@@ -9,7 +9,6 @@
package kotlin.sequences package kotlin.sequences
import kotlin.* import kotlin.*
import kotlin.coroutines.experimental.buildSequence
/** /**
* Given an [iterator] function constructs a [Sequence] that returns values through the [Iterator] * Given an [iterator] function constructs a [Sequence] that returns values through the [Iterator]
@@ -6,7 +6,6 @@
package kotlin.collections package kotlin.collections
import kotlin.* import kotlin.*
import kotlin.coroutines.experimental.buildIterator
internal fun checkWindowSizeStep(size: Int, step: Int) { internal fun checkWindowSizeStep(size: Int, step: Int) {
require(size > 0 && step > 0) { require(size > 0 && step > 0) {
@@ -101,10 +101,6 @@ fun List<MemberBuilder>.writeTo(file: File, platformSource: PlatformSourceFile)
writer.appendln("import kotlin.random.*") writer.appendln("import kotlin.random.*")
} }
if (sourceFile == SourceFile.Sequences) {
writer.appendln("import kotlin.coroutines.experimental.*")
}
writer.appendln() writer.appendln()
for (f in this) { for (f in this) {