spring-beans.gradle 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. description = "Spring Beans"
  2. apply plugin: "groovy"
  3. apply plugin: "kotlin"
  4. dependencies {
  5. compile(project(":spring-core"))
  6. optional("javax.inject:javax.inject")
  7. optional("org.yaml:snakeyaml")
  8. optional("org.codehaus.groovy:groovy-xml")
  9. optional("org.jetbrains.kotlin:kotlin-reflect")
  10. optional("org.jetbrains.kotlin:kotlin-stdlib")
  11. testCompile(testFixtures(project(":spring-core")))
  12. testCompile("javax.annotation:javax.annotation-api")
  13. testFixturesApi("org.junit.jupiter:junit-jupiter-api")
  14. testFixturesImplementation("org.assertj:assertj-core")
  15. }
  16. // This module does joint compilation for Java and Groovy code with the compileGroovy task.
  17. sourceSets {
  18. main.groovy.srcDirs += "src/main/java"
  19. main.java.srcDirs = []
  20. }
  21. compileGroovy {
  22. sourceCompatibility = 1.8
  23. targetCompatibility = 1.8
  24. options.compilerArgs += "-Werror"
  25. }
  26. // This module also builds Kotlin code and the compileKotlin task naturally depends on
  27. // compileJava. We need to redefine dependencies to break task cycles.
  28. def deps = compileGroovy.taskDependencies.immutableValues + compileGroovy.taskDependencies.mutableValues
  29. compileGroovy.dependsOn = deps - "compileJava"
  30. compileKotlin.dependsOn(compileGroovy)
  31. compileKotlin.classpath += files(compileGroovy.destinationDir)