javaprojects.gradle 5.9 KB

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