javaprojects.gradle 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. apply plugin: 'java'
  2. apply plugin: 'eclipse'
  3. springVersion = '3.0.3.RELEASE'
  4. springLdapVersion = '1.3.0.RELEASE'
  5. ehcacheVersion = '1.6.2'
  6. aspectjVersion = '1.6.9'
  7. apacheDsVersion = '1.5.5'
  8. jstlVersion = '1.2'
  9. jettyVersion = '6.1.22'
  10. hsqlVersion = '1.8.0.10'
  11. slf4jVersion = '1.6.1'
  12. logbackVersion = '0.9.24'
  13. configurations {
  14. // Configuration which is ONLY used for compileJava and will not be inherited by any others
  15. // Revisit post Gradle 1.0
  16. compileOnly
  17. // Used to identify deps whcih should be marked as "provided" in maven poms
  18. provided
  19. compile.extendsFrom provided
  20. compile.transitive = false
  21. testCompile.transitive = false
  22. }
  23. dependencies {
  24. compileOnly 'commons-logging:commons-logging:1.1.1'
  25. compile ("org.springframework:spring-core:$springVersion") {
  26. exclude(group: 'commons-logging', module: 'commons-logging')
  27. }
  28. testCompile 'junit:junit:4.7',
  29. 'org.mockito:mockito-core:1.8.3',
  30. 'org.jmock:jmock:2.5.1',
  31. 'org.jmock:jmock-junit4:2.5.1',
  32. 'org.hamcrest:hamcrest-core:1.1',
  33. 'org.hamcrest:hamcrest-library:1.1',
  34. "org.springframework:spring-test:$springVersion"
  35. // Use slf4j/logback for logging
  36. testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion",
  37. "ch.qos.logback:logback-classic:$logbackVersion"
  38. }
  39. [configurations.runtime, configurations.default]*.exclude(module: 'commons-logging')
  40. sourceSets.main.compileClasspath += configurations.compileOnly
  41. System.setProperty('apacheDSWorkDir', "${buildDir}/apacheDSWork")
  42. test {
  43. jvmArgs = ['-ea', '-Xmx500m']
  44. maxParallelForks = guessMaxForks()
  45. testReport = false
  46. }
  47. def guessMaxForks() {
  48. int processors = Runtime.runtime.availableProcessors()
  49. return Math.max(2, (int) (processors / 2))
  50. }