javaprojects.gradle 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. apply plugin: 'java'
  2. apply plugin: 'eclipse'
  3. apply plugin: 'propdeps'
  4. apply plugin: 'propdeps-maven'
  5. apply plugin: 'propdeps-idea'
  6. apply plugin: 'propdeps-eclipse'
  7. sourceCompatibility = 1.5
  8. targetCompatibility = 1.5
  9. ext.springVersion = '3.2.3.RELEASE'
  10. ext.springLdapVersion = '1.3.1.RELEASE'
  11. ext.ehcacheVersion = '1.6.2'
  12. ext.aspectjVersion = '1.6.10'
  13. ext.apacheDsVersion = '1.5.5'
  14. ext.jstlVersion = '1.2'
  15. ext.jettyVersion = '6.1.26'
  16. ext.hsqlVersion = '1.8.0.10'
  17. ext.slf4jVersion = '1.7.5'
  18. ext.logbackVersion = '0.9.29'
  19. ext.cglibVersion = '2.2'
  20. ext.powerMockVersion = '1.4.12'
  21. ext.servletApiVersion = '7.0.33'
  22. ext.seleniumVersion = '2.33.0'
  23. ext.groovyVersion = '2.0.5'
  24. ext.spockVersion = '0.7-groovy-2.0'
  25. ext.gebVersion = '0.9.0'
  26. ext.powerMockDependencies = [
  27. "org.powermock:powermock-core:$powerMockVersion",
  28. "org.powermock:powermock-api-support:$powerMockVersion",
  29. "org.powermock:powermock-module-junit4-common:$powerMockVersion",
  30. "org.powermock:powermock-module-junit4:$powerMockVersion",
  31. "org.powermock:powermock-api-mockito:$powerMockVersion",
  32. "org.powermock:powermock-reflect:$powerMockVersion"
  33. ]
  34. ext.apacheds_libs = [
  35. "org.apache.directory.server:apacheds-core:$apacheDsVersion",
  36. "org.apache.directory.server:apacheds-core-entry:$apacheDsVersion",
  37. "org.apache.directory.server:apacheds-protocol-shared:$apacheDsVersion",
  38. "org.apache.directory.server:apacheds-protocol-ldap:$apacheDsVersion",
  39. "org.apache.directory.server:apacheds-server-jndi:$apacheDsVersion",
  40. 'org.apache.directory.shared:shared-ldap:0.9.15'
  41. ]
  42. ext.bundlorProperties = [
  43. version: version,
  44. secRange: "[$version, 3.3.0)",
  45. springRange: "[$springVersion, 3.3.0)",
  46. aspectjRange: '[1.6.0, 1.8.0)',
  47. casRange: '[3.1.1, 3.2.0)',
  48. cloggingRange: '[1.0.4, 2.0.0)',
  49. ehcacheRange: '[1.4.1, 2.5.0)',
  50. openid4javaRange: '[0.9.5, 1.0.0)',
  51. springLdapRange: '[1.3.0,1.4.0)',
  52. apacheDSRange: '[1.5.5, 1.6)',
  53. apacheDSSharedRange: '[0.9.15, 1.0)',
  54. ldapSdkRange: '[4.1, 5.0)',
  55. aopAllianceRange: '[1.0.0, 2.0.0)'
  56. ]
  57. // Integration test setup
  58. configurations {
  59. integrationTestCompile {
  60. extendsFrom testCompile, optional, provided
  61. }
  62. integrationTestRuntime {
  63. extendsFrom integrationTestCompile, testRuntime
  64. }
  65. }
  66. sourceSets {
  67. integrationTest {
  68. java.srcDir file('src/integration-test/java')
  69. resources.srcDir file('src/integration-test/resources')
  70. compileClasspath = sourceSets.main.output + sourceSets.test.output + configurations.integrationTestCompile
  71. runtimeClasspath = output + compileClasspath + configurations.integrationTestRuntime
  72. }
  73. }
  74. task integrationTest(type: Test, dependsOn: jar) {
  75. testClassesDir = sourceSets.integrationTest.output.classesDir
  76. logging.captureStandardOutput(LogLevel.INFO)
  77. classpath = sourceSets.integrationTest.runtimeClasspath
  78. maxParallelForks = 1
  79. }
  80. project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 1, project.configurations.getByName("integrationTestCompile"), Conf2ScopeMappingContainer.TEST)
  81. project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 2, project.configurations.getByName("integrationTestRuntime"), Conf2ScopeMappingContainer.TEST)
  82. check.dependsOn integrationTest
  83. dependencies {
  84. optional '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. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  98. test {
  99. jvmArgs = ['-ea', '-Xmx500m']
  100. maxParallelForks = guessMaxForks()
  101. logging.captureStandardOutput(LogLevel.INFO)
  102. }
  103. def guessMaxForks() {
  104. int processors = Runtime.runtime.availableProcessors()
  105. return Math.max(2, (int) (processors / 2))
  106. }
  107. javadoc {
  108. title = "Spring Security $version API"
  109. source = sourceSets.main.allJava
  110. options {
  111. memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
  112. author = true
  113. header = project.name
  114. outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
  115. links = [
  116. "http://static.springsource.org/spring/docs/3.2.x/javadoc-api/",
  117. "http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/",
  118. "http://download.oracle.com/javase/6/docs/api/"
  119. ]
  120. groups = [
  121. 'Spring Security Core':[
  122. 'org.springframework.security.core*',
  123. 'org.springframework.security.authentication*',
  124. 'org.springframework.security.access*',
  125. 'org.springframework.security.remoting*',
  126. 'org.springframework.security.provisioning*',
  127. 'org.springframework.security.util*'],
  128. 'Spring Security Web':['org.springframework.security.web*'],
  129. 'Spring Security LDAP':['org.springframework.security.ldap*'],
  130. 'Spring Security Crypto':['org.springframework.security.crypto*'],
  131. 'Spring Security OpenID':['org.springframework.security.openid*'],
  132. 'Spring Security CAS':['org.springframework.security.cas*'],
  133. 'Spring Security ACL':['org.springframework.security.acls*'],
  134. 'Spring Security Config':['org.springframework.security.config*'],
  135. 'Spring Security Taglibs':['org.springframework.security.taglibs*'],
  136. ]
  137. }
  138. }
  139. task javadocJar(type: Jar) {
  140. classifier = 'javadoc'
  141. from javadoc
  142. }