javaprojects.gradle 5.8 KB

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