| description = 'Kotlin Test' |
| |
| apply plugin: 'kotlin-platform-jvm' |
| |
| configureJvm6Project(project) |
| configurePublishing(project) |
| |
| def includeJava9 = BuildPropertiesExtKt.getIncludeJava9(project.kotlinBuildProperties) |
| |
| sourceSets { |
| if (includeJava9) { |
| java9 |
| } |
| } |
| |
| dependencies { |
| expectedBy project(':kotlin-test:kotlin-test-common') |
| compile kotlinStdlib() |
| testCompile project(":kotlin-test:kotlin-test-junit") |
| testCompile('junit:junit:4.12') |
| } |
| |
| archivesBaseName = 'kotlin-test' |
| |
| jar { |
| manifestAttributes(manifest, project, 'Test' /*true*/) |
| // TODO: enable as soon as this doesn't cause D8/DX to crash |
| // from sourceSets.java9.output |
| } |
| |
| task modularJar(type: Jar) { |
| dependsOn(jar) |
| manifestAttributes(manifest, project, 'Test', true) |
| classifier = 'modular' |
| |
| from zipTree(jar.outputs.files.singleFile) |
| if (includeJava9) { |
| from sourceSets.java9.output |
| } |
| } |
| |
| artifacts { |
| archives sourcesJar |
| sources sourcesJar |
| archives modularJar |
| } |
| |
| javadocJar() |
| |
| compileKotlin { |
| kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-Xnormalize-constructor-calls=enable", |
| "-Xopt-in=kotlin.contracts.ExperimentalContracts", |
| "-module-name", project.archivesBaseName, ] |
| } |
| |
| compileTestKotlin { |
| kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package"] |
| } |
| |
| if (includeJava9) { |
| compileJava9Sources(project, 'kotlin.test') |
| } |