Setup separate sourceset for unsigned integer types

Build jar with unsigned types and put it to dist
This commit is contained in:
Ilya Gorbunov
2018-04-25 16:20:14 +03:00
parent e886460130
commit e57e3971b6
2 changed files with 39 additions and 3 deletions
+15
View File
@@ -26,11 +26,18 @@ sourceSets {
srcDir 'test' srcDir 'test'
} }
} }
unsigned {
kotlin {
srcDir '../unsigned/src'
}
}
} }
dependencies { dependencies {
testCompile project(":kotlin-test:kotlin-test-common") testCompile project(":kotlin-test:kotlin-test-common")
testCompile project(":kotlin-test:kotlin-test-annotations-common") testCompile project(":kotlin-test:kotlin-test-annotations-common")
unsignedCompile sourceSets.main.output
} }
compileKotlinCommon { compileKotlinCommon {
@@ -47,6 +54,14 @@ compileKotlinCommon {
} }
} }
compileUnsignedKotlinCommon {
kotlinOptions {
freeCompilerArgs += [
"-XXLanguage:+InlineClasses"
]
}
}
kotlin.experimental.coroutines 'enable' kotlin.experimental.coroutines 'enable'
+24 -3
View File
@@ -55,6 +55,8 @@ sourceSets {
srcDir 'java9' srcDir 'java9'
} }
} }
unsigned {
}
} }
configurations { configurations {
@@ -69,6 +71,8 @@ dependencies {
compile group: 'org.jetbrains', name: 'annotations', version:'13.0' compile group: 'org.jetbrains', name: 'annotations', version:'13.0'
testCompile project(':kotlin-test:kotlin-test-junit') testCompile project(':kotlin-test:kotlin-test-junit')
unsignedCompile sourceSets.main.output
} }
jar { jar {
@@ -92,13 +96,21 @@ task distJar(type: Jar) {
} }
task coroutinesJar(type: Jar) { task coroutinesJar(type: Jar) {
baseName = 'kotlin-stdlib-coroutines'
version = null version = null
classifier = 'coroutines'
manifestAttributes(manifest, project, 'Main', true) manifestAttributes(manifest, project, 'Main', true)
project.configure(manifest) { attributes 'Kotlin-Version': '1.3' } project.configure(manifest) { attributes 'Kotlin-Version': '1.3' }
from sourceSets.coroutines.output from sourceSets.coroutines.output
} }
task unsignedJar(type: Jar) {
version = null
classifier = 'unsigned'
manifestAttributes(manifest, project, 'Main', true)
project.configure(manifest) { attributes 'Kotlin-Version': '1.3' }
from sourceSets.unsigned.output
}
sourcesJar { sourcesJar {
from "${rootDir}/core/builtins/native" from "${rootDir}/core/builtins/native"
} }
@@ -139,12 +151,13 @@ dist {
} }
} }
task coroutinesDist(type: Copy) { task experimentalJarsDist(type: Copy) {
from coroutinesJar from coroutinesJar
from unsignedJar
into distDir into distDir
} }
dist.dependsOn coroutinesDist dist.dependsOn experimentalJarsDist
task dexMethodCount(type: DexMethodCount) { task dexMethodCount(type: DexMethodCount) {
from jar from jar
@@ -198,4 +211,12 @@ compileCoroutinesKotlin {
} }
} }
compileUnsignedKotlin {
kotlinOptions {
freeCompilerArgs += [
"-XXLanguage:+InlineClasses"
]
}
}
kotlin.experimental.coroutines 'enable' kotlin.experimental.coroutines 'enable'