stdlib-jvm: build as multiplatform, move project to jvm subfolder
Fix path with stdlib-jvm artifacts for public api test
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
description = 'Kotlin Standard Library for JVM'
|
||||
|
||||
apply plugin: 'kotlin-platform-jvm'
|
||||
|
||||
archivesBaseName = 'kotlin-stdlib'
|
||||
|
||||
configureJvm6Project(project)
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
|
||||
project.ext["jpsLibraryPath"] = rootProject.distLibDir
|
||||
|
||||
sourceSets {
|
||||
annotations {
|
||||
if(!System.properties.'idea.active') {
|
||||
java {
|
||||
srcDir "${rootDir}/core/runtime.jvm/src"
|
||||
include 'org/jetbrains/annotations/**'
|
||||
}
|
||||
kotlin {
|
||||
exclude '**/*'
|
||||
}
|
||||
}
|
||||
}
|
||||
main {
|
||||
java {
|
||||
srcDir "${rootDir}/core/builtins/src"
|
||||
srcDir 'runtime'
|
||||
srcDir 'src'
|
||||
}
|
||||
}
|
||||
experimental {
|
||||
kotlin {
|
||||
srcDir "../experimental"
|
||||
}
|
||||
}
|
||||
test {
|
||||
kotlin {
|
||||
srcDir 'test'
|
||||
}
|
||||
}
|
||||
java9 {
|
||||
java {
|
||||
srcDir 'java9'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
expectedBy project(":kotlin-stdlib-common")
|
||||
|
||||
compile group: 'org.jetbrains', name: 'annotations', version:'13.0'
|
||||
|
||||
testCompile project(':kotlin-test:kotlin-test-junit')
|
||||
}
|
||||
|
||||
jar {
|
||||
manifestAttributes(manifest, project, 'Main', true)
|
||||
from("${rootDir}/dist/builtins")
|
||||
from sourceSets.experimental.output
|
||||
// TODO: enable as soon as this doesn't cause D8/DX to crash
|
||||
// from sourceSets.java9.output
|
||||
}
|
||||
|
||||
task distJar(type: Jar) {
|
||||
baseName = 'dist-kotlin-stdlib'
|
||||
version = null
|
||||
manifestAttributes(manifest, project, 'Main', true)
|
||||
from("${rootDir}/dist/builtins")
|
||||
from sourceSets.annotations.output
|
||||
from sourceSets.main.output
|
||||
from sourceSets.experimental.output
|
||||
// TODO: enable as soon as this doesn't cause D8/DX to crash
|
||||
// from sourceSets.java9.output
|
||||
}
|
||||
|
||||
|
||||
sourcesJar {
|
||||
from "${rootDir}/core/builtins/native"
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
dist {
|
||||
[distJar, sourcesJar].forEach {
|
||||
from(it) {
|
||||
rename('dist-', '')
|
||||
}
|
||||
// legacy
|
||||
from(it) {
|
||||
rename('dist-', '')
|
||||
rename('kotlin-stdlib', 'kotlin-runtime')
|
||||
}
|
||||
}
|
||||
from (configurations.compile) {
|
||||
include 'annotations*.jar'
|
||||
}
|
||||
}
|
||||
|
||||
task dexMethodCount(type: DexMethodCount) {
|
||||
from jar
|
||||
ownPackages = ['kotlin']
|
||||
}
|
||||
check.dependsOn(dexMethodCount)
|
||||
|
||||
compileKotlin {
|
||||
dependsOn(":core:builtins:serialize")
|
||||
dependsOn(":prepare:build.version:writeStdlibVersion")
|
||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesMain")
|
||||
classpath += files("${rootDir}/dist/builtins")
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = [
|
||||
"-version",
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xmultifile-parts-inherit",
|
||||
"-Xnormalize-constructor-calls=enable",
|
||||
"-Xdump-declarations-to=${buildDir}/stdlib-declarations.json",
|
||||
"-module-name", "kotlin-stdlib"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
compileTestKotlin {
|
||||
dependsOn(":kotlin-stdlib-common:preprocessSourcesTest")
|
||||
}
|
||||
|
||||
|
||||
compileExperimentalKotlin {
|
||||
kotlinOptions {
|
||||
languageVersion = "1.3"
|
||||
apiVersion = "1.3"
|
||||
freeCompilerArgs = [
|
||||
"-version",
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xmultifile-parts-inherit",
|
||||
"-Xdump-declarations-to=${buildDir}/stdlib-experimental-declarations.json",
|
||||
"-module-name", "kotlin-stdlib-experimental"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
compileJava9Sources(project, 'kotlin.stdlib')
|
||||
|
||||
kotlin.experimental.coroutines 'enable'
|
||||
Reference in New Issue
Block a user