Files
kotlin-fork/libraries/stdlib/jdk7/build.gradle
T
Alexander Udalov 2d41c7d462 Add module-info.java for standard Kotlin libraries
Using the new multi-release jar feature, store compiled
module-info.class files into META-INF/versions/9 instead of the artifact
root. Hopefully, this will break fewer tools which do not support
module-info.class files because any sane tool should not do anything
with files in META-INF because before Java 9 that directory only
contained resources.

Upgrade some Maven plugins to newer versions which do not fail on
module-info.class files

 #KT-21266 In Progress
2018-04-03 21:22:14 +02:00

93 lines
1.8 KiB
Groovy

description = 'Kotlin Standard Library JDK 7 extension'
apply plugin: 'kotlin'
configureJvm6Project(project)
configureDist(project)
configurePublishing(project)
ext.javaHome = JDK_17
dependencies {
compile project(':kotlin-stdlib')
testCompile project(':kotlin-test:kotlin-test-junit')
}
sourceSets {
main {
kotlin {
srcDir 'src'
}
}
test {
kotlin {
srcDir 'test'
if(!System.properties.'idea.active') {
srcDir '../test'
}
}
}
java9 {
java {
srcDirs = ['java9']
}
}
}
createCompileJava9Task(project, "compileJava9", "kotlin.stdlib.jdk7")
jar {
manifestAttributes(manifest, project, 'Main', true)
from compileJava9.outputs
}
artifacts {
archives sourcesJar
archives javadocJar
}
dist {
from (jar, sourcesJar)
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions.jdkHome = JDK_17
}
compileKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xnormalize-constructor-calls=enable",
"-Xdump-declarations-to=${buildDir}/stdlib-jdk7-declarations.json",
"-module-name", project.name
]
}
compileTestKotlin {
kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"]
}
kotlin.experimental.coroutines 'enable'
test {
executable = "$JDK_17/bin/java"
}
task testJdk6Tests(type: Test) {
dependsOn(':kotlin-stdlib:testClasses')
group = "verification"
executable = "$JDK_17/bin/java"
doFirst {
testClassesDirs = project(':kotlin-stdlib').sourceSets.test.output
classpath = files(
testClassesDirs,
configurations.testCompile
)
}
}
check.dependsOn testJdk6Tests