2017-08-21 20:41:46 +08:00
|
|
|
description = "Spring Beans"
|
|
|
|
|
|
|
|
apply plugin: "groovy"
|
2019-08-21 02:26:43 +08:00
|
|
|
apply plugin: "kotlin"
|
2017-08-21 20:41:46 +08:00
|
|
|
|
|
|
|
dependencies {
|
2018-08-16 21:32:44 +08:00
|
|
|
compile(project(":spring-core"))
|
2019-08-27 03:13:12 +08:00
|
|
|
optional("javax.inject:javax.inject")
|
2019-09-26 05:49:15 +08:00
|
|
|
optional("org.yaml:snakeyaml")
|
2019-08-27 03:13:12 +08:00
|
|
|
optional("org.codehaus.groovy:groovy-xml")
|
2019-07-19 16:20:35 +08:00
|
|
|
optional("org.jetbrains.kotlin:kotlin-reflect")
|
|
|
|
optional("org.jetbrains.kotlin:kotlin-stdlib")
|
2019-12-28 18:44:40 +08:00
|
|
|
testCompile(testFixtures(project(":spring-core")))
|
2019-12-13 00:21:41 +08:00
|
|
|
testCompile("javax.annotation:javax.annotation-api")
|
2019-12-29 00:13:39 +08:00
|
|
|
testFixturesApi("org.junit.jupiter:junit-jupiter-api")
|
|
|
|
testFixturesImplementation("org.assertj:assertj-core")
|
2017-08-21 20:41:46 +08:00
|
|
|
}
|
|
|
|
|
2018-08-16 18:08:26 +08:00
|
|
|
// This module does joint compilation for Java and Groovy code with the compileGroovy task.
|
2017-08-21 20:41:46 +08:00
|
|
|
sourceSets {
|
|
|
|
main.groovy.srcDirs += "src/main/java"
|
|
|
|
main.java.srcDirs = []
|
|
|
|
}
|
|
|
|
|
|
|
|
compileGroovy {
|
2020-10-16 21:18:48 +08:00
|
|
|
options.compilerArgs += "-Werror"
|
2017-08-21 20:41:46 +08:00
|
|
|
}
|
|
|
|
|
2018-08-16 18:08:26 +08:00
|
|
|
// This module also builds Kotlin code and the compileKotlin task naturally depends on
|
|
|
|
// compileJava. We need to redefine dependencies to break task cycles.
|
2020-01-02 17:29:55 +08:00
|
|
|
tasks.named('compileGroovy') {
|
|
|
|
// Groovy only needs the declared dependencies (and not the result of Java compilation)
|
|
|
|
classpath = sourceSets.main.compileClasspath
|
|
|
|
}
|
|
|
|
tasks.named('compileKotlin') {
|
|
|
|
// Kotlin also depends on the result of Groovy compilation
|
|
|
|
classpath += files(sourceSets.main.groovy.classesDirectory)
|
|
|
|
}
|