-
Notifications
You must be signed in to change notification settings - Fork 5.8k
/
build.gradle
88 lines (73 loc) · 2.1 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
description = 'Kotlin Standard Library JDK 8 extension'
apply plugin: 'kotlin'
RepoArtifacts.publish(project)
RepoArtifacts.sourcesJar(project)
RepoArtifacts.javadocJar(project)
dependencies {
api project(':kotlin-stdlib')
api project(':kotlin-stdlib-jdk7')
}
sourceSets {
main {
kotlin {
}
}
test {
kotlin {
}
}
java9 {
java {
srcDir 'java9'
}
}
moduleTest {
java {
srcDir 'moduleTest'
}
}
}
dependencies {
moduleTestApi project(':kotlin-stdlib')
moduleTestApi project(':kotlin-stdlib-jdk7')
moduleTestCompileOnly project
moduleTestApi RepoDependencies.kotlinTest(project, "junit")
moduleTestApi "org.ow2.asm:asm:9.0"
}
jar {
LibrariesCommon.manifestAttributes(project, manifest, 'Main', true)
from sourceSets.java9.output
}
sourcesJar {
from sourceSets.java9.allSource
}
artifacts {
archives sourcesJar
sources sourcesJar
}
compileKotlin {
kotlinOptions.moduleName = project.name
}
compileTestKotlin {
}
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk8')
tasks.named("compileModuleTestJava", JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
}
compileModuleTestKotlin {
kotlinJavaToolchain.toolchain.use(JvmToolchain.getToolchainLauncherFor(project, JdkMajorVersion.JDK_11_0))
compilerOptions.jvmTarget = JvmTarget.JVM_9
compilerOptions.freeCompilerArgs = [ "-Xjdk-release=9" ]
}
check.dependsOn(tasks.register("moduleInfoTest", Test) {test ->
test.dependsOn(moduleTestClasses)
test.group = "verification"
test.testClassesDirs = sourceSets.moduleTest.output.classesDirs
test.classpath = files(sourceSets.moduleTest.runtimeClasspath, tasks.jar)
test.javaLauncher.set(JvmToolchain.getToolchainLauncherFor(project, JdkMajorVersion.JDK_9_0))
doFirst {
test.systemProperty("stdlibJars", test.classpath.filter { it.name.contains('kotlin-stdlib') }.join(File.pathSeparator))
}
})