You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
description = "Spring Beans" |
|
|
|
apply plugin: "groovy" |
|
apply plugin: "kotlin" |
|
|
|
dependencies { |
|
api(project(":spring-core")) |
|
optional("javax.inject:javax.inject") |
|
optional("org.yaml:snakeyaml") |
|
optional("org.codehaus.groovy:groovy-xml") |
|
optional("org.jetbrains.kotlin:kotlin-reflect") |
|
optional("org.jetbrains.kotlin:kotlin-stdlib") |
|
testImplementation(testFixtures(project(":spring-core"))) |
|
testImplementation("javax.annotation:javax.annotation-api") |
|
testFixturesApi("org.junit.jupiter:junit-jupiter-api") |
|
testFixturesImplementation("org.assertj:assertj-core") |
|
} |
|
|
|
// This module does joint compilation for Java and Groovy code with the compileGroovy task. |
|
sourceSets { |
|
main.groovy.srcDirs += "src/main/java" |
|
main.java.srcDirs = [] |
|
} |
|
|
|
compileGroovy { |
|
// Groovy generates Java code with "new Boolean" usage which is deprecated on JDK 17 |
|
// options.compilerArgs += "-Werror" |
|
} |
|
|
|
// This module also builds Kotlin code and the compileKotlin task naturally depends on |
|
// compileJava. We need to redefine dependencies to break task cycles. |
|
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) |
|
}
|
|
|