Split kotlin-stdlib-coroutines into common and java jars

#KT-24532: Fixed
This commit is contained in:
Ilmir Usmanov
2018-05-23 17:47:12 +03:00
parent 9c5256434c
commit 0cb73e55d0
3 changed files with 31 additions and 3 deletions
@@ -83,7 +83,7 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
val commonLibs = Files.newDirectoryStream(Paths.get(stdlibCommonLibsDir)).use(Iterable<Path>::toList)
return commonLibs.sorted().findLast {
val name = it.toFile().name
!name.endsWith("-javadoc.jar") && !name.endsWith("-sources.jar")
!name.endsWith("-javadoc.jar") && !name.endsWith("-sources.jar") && !name.contains("coroutines")
}?.toFile() ?: error("kotlin-stdlib-common is not found in $stdlibCommonLibsDir")
}
+30
View File
@@ -31,6 +31,12 @@ sourceSets {
srcDir '../unsigned/src'
}
}
coroutines {
kotlin {
srcDir '../coroutines/common/src'
srcDir '../coroutines/src'
}
}
}
dependencies {
@@ -38,6 +44,7 @@ dependencies {
testCompile project(":kotlin-test:kotlin-test-annotations-common")
unsignedCompile sourceSets.main.output
coroutinesCompile sourceSets.main.output
}
compileKotlinCommon {
@@ -63,6 +70,15 @@ compileUnsignedKotlinCommon {
}
}
compileCoroutinesKotlinCommon {
kotlinOptions {
languageVersion = "1.3"
apiVersion = "1.3"
freeCompilerArgs = [
"-module-name", project.name
]
}
}
kotlin.experimental.coroutines 'enable'
@@ -70,6 +86,13 @@ jar {
manifestAttributes(manifest, project, 'Main')
}
task coroutinesCommonJar(type: Jar) {
classifier = 'coroutines'
version = null
manifestAttributes(manifest, project, 'Main')
project.configure(manifest) { attributes 'Kotlin-Version': '1.3' }
from sourceSets.coroutines.output
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
@@ -95,4 +118,11 @@ task distCommon(type: Copy) {
dist.dependsOn distCommon
task experimentalCommonJarsDist(type: Copy) {
from coroutinesCommonJar
into distDir
}
dist.dependsOn experimentalCommonJarsDist
classes.setDependsOn(classes.dependsOn.findAll { it != "compileJava" })
-2
View File
@@ -40,8 +40,6 @@ sourceSets {
coroutines {
kotlin {
srcDir '../coroutines/jvm/src'
srcDir '../coroutines/common/src'
srcDir '../coroutines/src'
}
compileClasspath += sourceSets.main.output
}