2013-08-08 17:29:43 -04:00
|
|
|
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
|
|
|
|
2010-03-28 18:54:41 -04:00
|
|
|
apply plugin: 'java'
|
2013-08-05 17:20:50 -04:00
|
|
|
apply plugin: 'eclipse-wtp'
|
2013-07-16 16:15:42 -04:00
|
|
|
apply plugin: 'propdeps'
|
|
|
|
apply plugin: 'propdeps-maven'
|
|
|
|
apply plugin: 'propdeps-idea'
|
|
|
|
apply plugin: 'propdeps-eclipse'
|
2010-03-03 10:40:57 -05:00
|
|
|
|
2012-07-08 16:55:21 -04:00
|
|
|
sourceCompatibility = 1.5
|
|
|
|
targetCompatibility = 1.5
|
|
|
|
|
2013-08-31 12:25:28 -04:00
|
|
|
ext.springVersion = '3.2.4.RELEASE'
|
2013-08-31 11:44:44 -04:00
|
|
|
ext.springLdapVersion = '1.3.2.RELEASE'
|
2012-06-29 13:59:22 -04:00
|
|
|
ext.ehcacheVersion = '1.6.2'
|
|
|
|
ext.aspectjVersion = '1.6.10'
|
|
|
|
ext.apacheDsVersion = '1.5.5'
|
|
|
|
ext.jstlVersion = '1.2'
|
|
|
|
ext.jettyVersion = '6.1.26'
|
|
|
|
ext.hsqlVersion = '1.8.0.10'
|
2013-07-16 16:59:06 -04:00
|
|
|
ext.slf4jVersion = '1.7.5'
|
2012-06-29 13:59:22 -04:00
|
|
|
ext.logbackVersion = '0.9.29'
|
|
|
|
ext.cglibVersion = '2.2'
|
|
|
|
ext.powerMockVersion = '1.4.12'
|
2012-11-28 18:56:03 -05:00
|
|
|
ext.servletApiVersion = '7.0.33'
|
2013-07-12 18:11:46 -04:00
|
|
|
ext.seleniumVersion = '2.33.0'
|
|
|
|
ext.groovyVersion = '2.0.5'
|
|
|
|
ext.spockVersion = '0.7-groovy-2.0'
|
|
|
|
ext.gebVersion = '0.9.0'
|
2010-03-03 10:40:57 -05:00
|
|
|
|
2012-11-08 23:25:18 -05:00
|
|
|
ext.powerMockDependencies = [
|
|
|
|
"org.powermock:powermock-core:$powerMockVersion",
|
|
|
|
"org.powermock:powermock-api-support:$powerMockVersion",
|
|
|
|
"org.powermock:powermock-module-junit4-common:$powerMockVersion",
|
|
|
|
"org.powermock:powermock-module-junit4:$powerMockVersion",
|
|
|
|
"org.powermock:powermock-api-mockito:$powerMockVersion",
|
|
|
|
"org.powermock:powermock-reflect:$powerMockVersion"
|
|
|
|
]
|
|
|
|
|
2013-06-30 18:26:57 -04:00
|
|
|
ext.apacheds_libs = [
|
|
|
|
"org.apache.directory.server:apacheds-core:$apacheDsVersion",
|
|
|
|
"org.apache.directory.server:apacheds-core-entry:$apacheDsVersion",
|
|
|
|
"org.apache.directory.server:apacheds-protocol-shared:$apacheDsVersion",
|
|
|
|
"org.apache.directory.server:apacheds-protocol-ldap:$apacheDsVersion",
|
|
|
|
"org.apache.directory.server:apacheds-server-jndi:$apacheDsVersion",
|
|
|
|
'org.apache.directory.shared:shared-ldap:0.9.15'
|
|
|
|
]
|
|
|
|
|
2012-06-29 13:59:22 -04:00
|
|
|
ext.bundlorProperties = [
|
2011-02-07 11:06:23 -05:00
|
|
|
version: version,
|
2013-02-14 10:29:35 -05:00
|
|
|
secRange: "[$version, 3.3.0)",
|
|
|
|
springRange: "[$springVersion, 3.3.0)",
|
|
|
|
aspectjRange: '[1.6.0, 1.8.0)',
|
2011-02-07 11:06:23 -05:00
|
|
|
casRange: '[3.1.1, 3.2.0)',
|
|
|
|
cloggingRange: '[1.0.4, 2.0.0)',
|
2011-03-10 14:38:04 -05:00
|
|
|
ehcacheRange: '[1.4.1, 2.5.0)',
|
2011-02-07 11:06:23 -05:00
|
|
|
openid4javaRange: '[0.9.5, 1.0.0)',
|
|
|
|
springLdapRange: '[1.3.0,1.4.0)',
|
|
|
|
apacheDSRange: '[1.5.5, 1.6)',
|
|
|
|
apacheDSSharedRange: '[0.9.15, 1.0)',
|
|
|
|
ldapSdkRange: '[4.1, 5.0)',
|
2011-08-11 19:22:42 -04:00
|
|
|
aopAllianceRange: '[1.0.0, 2.0.0)'
|
2011-02-07 11:06:23 -05:00
|
|
|
]
|
|
|
|
|
2011-02-14 09:57:30 -05:00
|
|
|
// Integration test setup
|
|
|
|
configurations {
|
|
|
|
integrationTestCompile {
|
2013-07-16 16:59:06 -04:00
|
|
|
extendsFrom testCompile, optional, provided
|
2011-02-14 09:57:30 -05:00
|
|
|
}
|
|
|
|
integrationTestRuntime {
|
|
|
|
extendsFrom integrationTestCompile, testRuntime
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
integrationTest {
|
|
|
|
java.srcDir file('src/integration-test/java')
|
|
|
|
resources.srcDir file('src/integration-test/resources')
|
2012-06-29 13:59:22 -04:00
|
|
|
compileClasspath = sourceSets.main.output + sourceSets.test.output + configurations.integrationTestCompile
|
|
|
|
runtimeClasspath = output + compileClasspath + configurations.integrationTestRuntime
|
2011-02-14 09:57:30 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task integrationTest(type: Test, dependsOn: jar) {
|
2012-06-29 13:59:22 -04:00
|
|
|
testClassesDir = sourceSets.integrationTest.output.classesDir
|
2011-02-14 09:57:30 -05:00
|
|
|
logging.captureStandardOutput(LogLevel.INFO)
|
|
|
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
2011-02-14 14:01:27 -05:00
|
|
|
maxParallelForks = 1
|
2011-02-14 09:57:30 -05:00
|
|
|
}
|
2013-07-15 23:13:15 -04:00
|
|
|
project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 1, project.configurations.getByName("integrationTestCompile"), Conf2ScopeMappingContainer.TEST)
|
|
|
|
project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 2, project.configurations.getByName("integrationTestRuntime"), Conf2ScopeMappingContainer.TEST)
|
2013-07-15 23:16:52 -04:00
|
|
|
check.dependsOn integrationTest
|
2013-07-15 23:13:15 -04:00
|
|
|
|
2010-03-03 10:40:57 -05:00
|
|
|
dependencies {
|
2013-07-16 16:15:42 -04:00
|
|
|
optional 'commons-logging:commons-logging:1.1.1'
|
2010-03-03 10:40:57 -05:00
|
|
|
|
2010-03-07 16:58:25 -05:00
|
|
|
compile ("org.springframework:spring-core:$springVersion") {
|
|
|
|
exclude(group: 'commons-logging', module: 'commons-logging')
|
|
|
|
}
|
|
|
|
|
2010-03-03 10:40:57 -05:00
|
|
|
testCompile 'junit:junit:4.7',
|
2010-08-17 21:32:43 -04:00
|
|
|
'org.mockito:mockito-core:1.8.5',
|
2012-11-07 12:21:05 -05:00
|
|
|
"org.springframework:spring-test:$springVersion",
|
|
|
|
'org.easytesting:fest-assert:1.4'
|
2010-07-12 07:30:21 -04:00
|
|
|
|
|
|
|
// Use slf4j/logback for logging
|
2010-07-26 21:16:39 -04:00
|
|
|
testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
2010-07-12 07:30:21 -04:00
|
|
|
"ch.qos.logback:logback-classic:$logbackVersion"
|
2010-03-03 10:40:57 -05:00
|
|
|
}
|
|
|
|
|
2010-07-12 07:30:21 -04:00
|
|
|
[configurations.runtime, configurations.default]*.exclude(module: 'commons-logging')
|
|
|
|
|
2010-08-16 21:16:12 -04:00
|
|
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
|
|
|
|
2010-03-03 10:40:57 -05:00
|
|
|
test {
|
2013-08-28 14:30:25 -04:00
|
|
|
jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=128M']
|
2010-08-04 21:11:00 -04:00
|
|
|
maxParallelForks = guessMaxForks()
|
2011-02-16 10:57:22 -05:00
|
|
|
logging.captureStandardOutput(LogLevel.INFO)
|
2010-08-04 21:11:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
def guessMaxForks() {
|
|
|
|
int processors = Runtime.runtime.availableProcessors()
|
|
|
|
return Math.max(2, (int) (processors / 2))
|
2010-03-03 10:40:57 -05:00
|
|
|
}
|
|
|
|
|
2012-08-09 23:44:01 -04:00
|
|
|
javadoc {
|
|
|
|
title = "Spring Security $version API"
|
|
|
|
source = sourceSets.main.allJava
|
|
|
|
options {
|
|
|
|
memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
|
|
|
|
author = true
|
|
|
|
header = project.name
|
|
|
|
outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
|
|
|
|
links = [
|
2012-12-13 11:04:01 -05:00
|
|
|
"http://static.springsource.org/spring/docs/3.2.x/javadoc-api/",
|
2012-08-09 23:44:01 -04:00
|
|
|
"http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/",
|
|
|
|
"http://download.oracle.com/javase/6/docs/api/"
|
|
|
|
]
|
|
|
|
groups = [
|
|
|
|
'Spring Security Core':[
|
|
|
|
'org.springframework.security.core*',
|
|
|
|
'org.springframework.security.authentication*',
|
|
|
|
'org.springframework.security.access*',
|
|
|
|
'org.springframework.security.remoting*',
|
|
|
|
'org.springframework.security.provisioning*',
|
|
|
|
'org.springframework.security.util*'],
|
|
|
|
'Spring Security Web':['org.springframework.security.web*'],
|
|
|
|
'Spring Security LDAP':['org.springframework.security.ldap*'],
|
|
|
|
'Spring Security Crypto':['org.springframework.security.crypto*'],
|
|
|
|
'Spring Security OpenID':['org.springframework.security.openid*'],
|
|
|
|
'Spring Security CAS':['org.springframework.security.cas*'],
|
|
|
|
'Spring Security ACL':['org.springframework.security.acls*'],
|
|
|
|
'Spring Security Config':['org.springframework.security.config*'],
|
|
|
|
'Spring Security Taglibs':['org.springframework.security.taglibs*'],
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-08 17:29:43 -04:00
|
|
|
eclipse.classpath.downloadSources = true
|
|
|
|
|
|
|
|
// http://forums.gradle.org/gradle/topics/eclipse_wtp_deploys_testcode_to_server_example_provided
|
|
|
|
eclipse.classpath {
|
|
|
|
defaultOutputDir = file('bin/main')
|
|
|
|
file.whenMerged { cp ->
|
|
|
|
cp.entries.findAll { it instanceof SourceFolder && (it.path.contains("test") || it.path.contains("Test")) }*.output = "bin/test"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-13 10:13:02 -04:00
|
|
|
// GRADLE-1116
|
|
|
|
project.eclipse.classpath.file.whenMerged { classpath ->
|
|
|
|
classpath.entries.removeAll { entry -> entry.path.endsWith('/build/resources/test') }
|
|
|
|
classpath.entries.removeAll { entry -> entry.path.endsWith('/build/classes/test') }
|
|
|
|
classpath.entries.removeAll { entry -> entry.path.endsWith('/build/resources/main') }
|
|
|
|
classpath.entries.removeAll { entry -> entry.path.endsWith('/build/classes/main') }
|
|
|
|
}
|
|
|
|
|
2013-08-08 17:29:43 -04:00
|
|
|
// GRADLE-1422
|
|
|
|
project.eclipseClasspath.doFirst {
|
|
|
|
// delay adding whenMerged till the entryAttributes are added (must be the last whenMerged)
|
|
|
|
project.eclipse.classpath.file.whenMerged { classpath ->
|
|
|
|
def includeDeps = project.configurations.getByName('runtime').collect {f -> f.absolutePath } as Set
|
|
|
|
classpath.entries.each { cp ->
|
|
|
|
if(cp instanceof org.gradle.plugins.ide.eclipse.model.Library) {
|
|
|
|
def include = includeDeps.contains(cp.path)
|
|
|
|
def attr = 'org.eclipse.jst.component.dependency'
|
|
|
|
if(!include) {
|
|
|
|
cp.entryAttributes.remove(attr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-09 23:44:01 -04:00
|
|
|
task javadocJar(type: Jar) {
|
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc
|
|
|
|
}
|