2
0

javaprojects.gradle 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. apply plugin: 'java'
  2. apply plugin: 'eclipse'
  3. sourceCompatibility = 1.5
  4. targetCompatibility = 1.5
  5. ext.springVersion = '3.0.7.RELEASE'
  6. ext.springLdapVersion = '1.3.1.RELEASE'
  7. ext.ehcacheVersion = '1.6.2'
  8. ext.aspectjVersion = '1.6.10'
  9. ext.apacheDsVersion = '1.5.5'
  10. ext.jstlVersion = '1.2'
  11. ext.jettyVersion = '6.1.26'
  12. ext.hsqlVersion = '1.8.0.10'
  13. ext.slf4jVersion = '1.6.1'
  14. ext.logbackVersion = '0.9.29'
  15. ext.cglibVersion = '2.2'
  16. ext.powerMockVersion = '1.4.12'
  17. ext.bundlorProperties = [
  18. version: version,
  19. secRange: "[$version, 3.1.0)",
  20. springRange: "[$springVersion, 3.1.0)",
  21. aspectjRange: '[1.6.0, 1.7.0)',
  22. casRange: '[3.1.1, 3.2.0)',
  23. cloggingRange: '[1.0.4, 2.0.0)',
  24. ehcacheRange: '[1.4.1, 2.5.0)',
  25. openid4javaRange: '[0.9.5, 1.0.0)',
  26. springLdapRange: '[1.3.0,1.4.0)',
  27. apacheDSRange: '[1.5.5, 1.6)',
  28. apacheDSSharedRange: '[0.9.15, 1.0)',
  29. ldapSdkRange: '[4.1, 5.0)',
  30. aopAllianceRange: '[1.0.0, 2.0.0)'
  31. ]
  32. configurations {
  33. // Configuration which is ONLY used for compileJava and will not be inherited by any others
  34. // Revisit post Gradle 1.0
  35. compileOnly
  36. // Used to identify deps which should be marked as "provided" in maven poms
  37. provided
  38. testCompile.extendsFrom provided
  39. compile.transitive = false
  40. testCompile.transitive = false
  41. }
  42. // Integration test setup
  43. configurations {
  44. integrationTestCompile {
  45. extendsFrom testCompile
  46. }
  47. integrationTestRuntime {
  48. extendsFrom integrationTestCompile, testRuntime
  49. }
  50. }
  51. sourceSets {
  52. integrationTest {
  53. java.srcDir file('src/integration-test/java')
  54. resources.srcDir file('src/integration-test/resources')
  55. compileClasspath = sourceSets.main.output + sourceSets.test.output + configurations.integrationTestCompile
  56. runtimeClasspath = output + compileClasspath + configurations.integrationTestRuntime
  57. }
  58. }
  59. task integrationTest(type: Test, dependsOn: jar) {
  60. testClassesDir = sourceSets.integrationTest.output.classesDir
  61. logging.captureStandardOutput(LogLevel.INFO)
  62. classpath = sourceSets.integrationTest.runtimeClasspath
  63. maxParallelForks = 1
  64. // testReport = false
  65. }
  66. dependencies {
  67. compileOnly 'commons-logging:commons-logging:1.1.1'
  68. compile ("org.springframework:spring-core:$springVersion") {
  69. exclude(group: 'commons-logging', module: 'commons-logging')
  70. }
  71. testCompile 'junit:junit:4.7',
  72. 'org.mockito:mockito-core:1.8.3',
  73. 'org.jmock:jmock:2.5.1',
  74. 'org.jmock:jmock-junit4:2.5.1',
  75. 'org.hamcrest:hamcrest-core:1.1',
  76. 'org.hamcrest:hamcrest-library:1.1',
  77. "org.springframework:spring-test:$springVersion"
  78. // Use slf4j/logback for logging
  79. testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion",
  80. "ch.qos.logback:logback-classic:$logbackVersion"
  81. }
  82. [configurations.runtime, configurations.default]*.exclude(module: 'commons-logging')
  83. sourceSets.main.compileClasspath += configurations.compileOnly
  84. sourceSets.main.compileClasspath += configurations.provided
  85. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  86. test {
  87. jvmArgs = ['-ea', '-Xmx500m']
  88. maxParallelForks = guessMaxForks()
  89. logging.captureStandardOutput(LogLevel.INFO)
  90. testReport = false
  91. }
  92. def guessMaxForks() {
  93. int processors = Runtime.runtime.availableProcessors()
  94. return Math.max(2, (int) (processors / 2))
  95. }
  96. javadoc {
  97. title = "Spring Security $version API"
  98. source = sourceSets.main.allJava
  99. classpath += configurations.compileOnly + configurations.provided
  100. options {
  101. memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
  102. author = true
  103. header = project.name
  104. outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
  105. links = [
  106. "http://static.springframework.org/spring/docs/3.0.x/javadoc-api",
  107. "http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/",
  108. "http://download.oracle.com/javase/6/docs/api/"
  109. ]
  110. groups = [
  111. 'Spring Security Core':[
  112. 'org.springframework.security.core*',
  113. 'org.springframework.security.authentication*',
  114. 'org.springframework.security.access*',
  115. 'org.springframework.security.remoting*',
  116. 'org.springframework.security.provisioning*',
  117. 'org.springframework.security.util*'],
  118. 'Spring Security Web':['org.springframework.security.web*'],
  119. 'Spring Security LDAP':['org.springframework.security.ldap*'],
  120. 'Spring Security Crypto':['org.springframework.security.crypto*'],
  121. 'Spring Security OpenID':['org.springframework.security.openid*'],
  122. 'Spring Security CAS':['org.springframework.security.cas*'],
  123. 'Spring Security ACL':['org.springframework.security.acls*'],
  124. 'Spring Security Config':['org.springframework.security.config*'],
  125. 'Spring Security Taglibs':['org.springframework.security.taglibs*'],
  126. ]
  127. }
  128. }
  129. task javadocJar(type: Jar) {
  130. classifier = 'javadoc'
  131. from javadoc
  132. }