Files
kotlin-fork/libraries/stdlib/common/build.gradle
T
Alexander Udalov bf3419c3bd Introduce OptionalExpectation for annotations missing on some platforms
This commits adds a new annotation OptionalExpectation to the standard
library, which is experimental. To enable its usage, either pass
'-Xuse-experimental=kotlin.ExperimentalMultiplatform' as a compiler
argument, or '-Xuse-experimental=kotlin.Experimental' and also annotate
each usage with `@UseExperimental(ExperimentalMultiplatform::class)`

 #KT-18882 Fixed
2018-05-24 13:14:51 +02:00

99 lines
2.0 KiB
Groovy

description = 'Kotlin Common Standard Library'
apply plugin: 'kotlin-platform-common'
apply plugin: 'pill-configurable'
configureDist(project)
configurePublishing(project)
def commonSrcDir = "../src"
def commonTestSrcDir = "../test"
pill {
importAsLibrary = true
}
sourceSets {
main {
kotlin {
srcDir 'src'
srcDir commonSrcDir
}
}
test {
kotlin {
srcDir commonTestSrcDir
srcDir 'test'
}
}
unsigned {
kotlin {
srcDir '../unsigned/src'
}
}
}
dependencies {
testCompile project(":kotlin-test:kotlin-test-common")
testCompile project(":kotlin-test:kotlin-test-annotations-common")
unsignedCompile sourceSets.main.output
}
compileKotlinCommon {
dependsOn(":prepare:build.version:writeStdlibVersion")
// dependsOn ":prepare:compiler:prepare-compiler-with-bootstrap-runtime"
// compilerJarFile = compilerJarWithBootstrapRuntime
}
compileKotlinCommon {
kotlinOptions {
freeCompilerArgs = [
"-module-name", project.name,
"-Xuse-experimental=kotlin.Experimental"
]
}
}
compileUnsignedKotlinCommon {
kotlinOptions {
freeCompilerArgs += [
"-XXLanguage:+InlineClasses"
]
}
}
kotlin.experimental.coroutines 'enable'
jar {
manifestAttributes(manifest, project, 'Main')
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.kotlin
}
configurations {
sources
}
artifacts {
archives sourcesJar
sources sourcesJar
archives javadocJar
}
// TODO: call the "dist" task instead, once we need to publish kotlin-stdlib-common.jar with the compiler distribution
task distCommon(type: Copy) {
from(jar)
into "$distDir/common"
rename "-${java.util.regex.Pattern.quote(version)}", ''
}
dist.dependsOn distCommon
classes.setDependsOn(classes.dependsOn.findAll { it != "compileJava" })