Files
kotlin-fork/libraries/stdlib/jdk7/build.gradle
T
Alexander Udalov 0a9498f7e2 Build: suppress deprecated JVM target warning globally
There seems to be no point in configuring the compiler argument per
project. This argument will be deleted soon anyway, when we remove
support for JDK 1.6 & 1.7.

Also remove `disableDeprecatedJvmTargetWarning`. It didn't have any
effect in all modules where it was applied because these modules
reassign `freeCompilerArgs` anyway, with
`-Xsuppress-deprecated-jvm-target-warning` in it.
2021-07-27 13:35:39 +02:00

119 lines
2.7 KiB
Groovy

description = 'Kotlin Standard Library JDK 7 extension'
apply plugin: 'kotlin'
JvmToolchain.configureJvmToolchain(project, JdkMajorVersion.JDK_1_7)
JvmToolchain.updateJvmTarget(project, "1.6")
configurePublishing(project)
configureSourcesJar()
configureJavadocJar()
sourceSets {
main {
kotlin {
srcDir 'src'
}
}
test {
kotlin {
srcDir 'test'
if(!BuildPropertiesKt.getKotlinBuildProperties(project).inIdeaSync) {
srcDir '../jvm/test'
srcDir '../common/test'
srcDir '../test'
}
}
}
noJdk7Test {
kotlin {
srcDir 'testNoJdk7'
}
}
java9 {
java {
srcDir 'java9'
}
}
}
configurations {
noJdk7TestCompile.extendsFrom(testCompile)
}
dependencies {
compile project(':kotlin-stdlib')
testCompile project(':kotlin-test:kotlin-test-junit')
}
jar {
manifestAttributes(manifest, project, 'Main', true)
from sourceSets.java9.output
}
configureModularJar {
dependsOn(jar)
manifestAttributes(manifest, project, 'Main', true)
from zipTree(jar.outputs.files.singleFile)
}
artifacts {
archives sourcesJar
sources sourcesJar
archives modularJar
}
compileKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xsuppress-deprecated-jvm-target-warning",
]
kotlinOptions.moduleName = project.name
}
compileTestKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmulti-platform",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-Xopt-in=kotlin.io.path.ExperimentalPathApi",
"-Xcommon-sources=${fileTree('../test').join(',')}",
"-Xsuppress-deprecated-jvm-target-warning",
]
}
configureJvmIrBackend(project)
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk7')
task testJdk6Tests(type: Test) {
dependsOn(':kotlin-stdlib:testClasses')
group = "verification"
doFirst {
testClassesDirs = project(':kotlin-stdlib').sourceSets.test.output
classpath = files(
testClassesDirs,
sourceSets.test.compileClasspath
)
}
}
task testNoJdk7(type: Test, dependsOn: noJdk7TestClasses) {
group = "verification"
testClassesDirs = sourceSets.noJdk7Test.output.classesDirs
classpath = sourceSets.noJdk7Test.runtimeClasspath
}
check.dependsOn testJdk6Tests, testNoJdk7