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'
|
2014-05-20 23:51:29 -04:00
|
|
|
apply plugin: 'groovy'
|
2013-09-11 18:30:50 -04:00
|
|
|
apply plugin: 'javadocHotfix'
|
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
|
|
|
|
|
2012-06-29 13:59:22 -04:00
|
|
|
ext.apacheDsVersion = '1.5.5'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.aspectjVersion = '1.8.4'
|
2015-12-02 14:25:52 -05:00
|
|
|
ext.casClientVersion = '3.4.1'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.cglibVersion = '3.1'
|
|
|
|
ext.commonsCodecVersion = '1.10'
|
2016-03-07 17:12:48 -05:00
|
|
|
ext.commonsCollectionsVersion = '3.2.2'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.commonsLoggingVersion = '1.2'
|
|
|
|
ext.ehcacheVersion = '2.9.0'
|
|
|
|
ext.gebVersion = '0.10.0'
|
2015-08-18 14:58:15 -04:00
|
|
|
ext.groovyVersion = '2.4.4'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.hsqlVersion = '2.3.2'
|
|
|
|
ext.jacksonDatavindVersion = '2.4.4'
|
2012-06-29 13:59:22 -04:00
|
|
|
ext.jettyVersion = '6.1.26'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.jstlVersion = '1.2.1'
|
2015-12-21 14:03:23 -05:00
|
|
|
ext.junitVersion = '4.12'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.logbackVersion = '1.1.2'
|
2015-07-13 16:00:07 -04:00
|
|
|
ext.powerMockVersion = '1.6.2'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.seleniumVersion = '2.44.0'
|
2014-04-02 09:48:55 -04:00
|
|
|
ext.servletApiVersion = '3.0.1'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.slf4jVersion = '1.7.7'
|
2013-07-12 18:11:46 -04:00
|
|
|
ext.spockVersion = '0.7-groovy-2.0'
|
2014-12-10 11:07:32 -05:00
|
|
|
ext.springDataCommonsVersion = '1.9.1.RELEASE'
|
|
|
|
ext.springDataJpaVersion = '1.7.1.RELEASE'
|
2015-01-27 12:46:24 -05:00
|
|
|
ext.springDataRedisVersion = '1.4.1.RELEASE'
|
|
|
|
ext.springSessionVersion = '1.0.0.RELEASE'
|
2015-04-20 16:53:26 -04:00
|
|
|
ext.thymeleafVersion = '2.1.4.RELEASE'
|
2010-03-03 10:40:57 -05:00
|
|
|
|
2014-04-01 14:42:21 -04:00
|
|
|
ext.spockDependencies = [
|
2015-03-23 12:14:26 -04:00
|
|
|
dependencies.create("org.spockframework:spock-spring:$spockVersion") {
|
|
|
|
exclude group: 'junit', module: 'junit-dep'
|
|
|
|
},
|
|
|
|
dependencies.create("org.spockframework:spock-core:$spockVersion") {
|
|
|
|
exclude group: 'junit', module: 'junit-dep'
|
|
|
|
}
|
2014-04-01 14:42:21 -04:00
|
|
|
]
|
|
|
|
|
2014-06-12 13:01:16 -04:00
|
|
|
ext.gebDependencies = spockDependencies + [
|
2015-03-23 12:14:26 -04:00
|
|
|
"org.seleniumhq.selenium:selenium-htmlunit-driver:$seleniumVersion",
|
|
|
|
"org.gebish:geb-spock:$gebVersion",
|
|
|
|
'commons-httpclient:commons-httpclient:3.1',
|
2015-08-18 14:58:15 -04:00
|
|
|
"org.codehaus.groovy:groovy:$groovyVersion",
|
|
|
|
"org.codehaus.groovy:groovy-all:$groovyVersion"
|
2014-06-12 13:01:16 -04:00
|
|
|
]
|
|
|
|
|
2012-11-08 23:25:18 -05:00
|
|
|
ext.powerMockDependencies = [
|
2015-03-23 12:14:26 -04:00
|
|
|
"org.powermock:powermock-core:$powerMockVersion",
|
|
|
|
"org.powermock:powermock-api-support:$powerMockVersion",
|
|
|
|
"org.powermock:powermock-module-junit4-common:$powerMockVersion",
|
|
|
|
"org.powermock:powermock-module-junit4:$powerMockVersion",
|
|
|
|
dependencies.create("org.powermock:powermock-api-mockito:$powerMockVersion") {
|
|
|
|
exclude group: 'org.mockito', module: 'mockito-all'
|
|
|
|
},
|
|
|
|
"org.powermock:powermock-reflect:$powerMockVersion"
|
2012-11-08 23:25:18 -05:00
|
|
|
]
|
|
|
|
|
2014-11-20 17:16:22 -05:00
|
|
|
ext.springCoreDependency = [
|
2015-03-23 12:14:26 -04:00
|
|
|
dependencies.create("org.springframework:spring-core:$springVersion") {
|
|
|
|
exclude(group: 'commons-logging', module: 'commons-logging')
|
|
|
|
}
|
2014-11-20 17:16:22 -05:00
|
|
|
]
|
|
|
|
|
2014-06-12 13:01:04 -04:00
|
|
|
ext.jstlDependencies = [
|
2015-03-23 12:14:26 -04:00
|
|
|
"javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
|
|
|
|
"org.apache.taglibs:taglibs-standard-jstlel:1.2.1"
|
2014-06-12 13:01:04 -04:00
|
|
|
]
|
|
|
|
|
2014-04-30 17:39:23 -04:00
|
|
|
ext.apachedsDependencies = [
|
2015-03-23 12:14:26 -04:00
|
|
|
"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'
|
2013-06-30 18:26:57 -04:00
|
|
|
]
|
|
|
|
|
2011-02-14 09:57:30 -05:00
|
|
|
// Integration test setup
|
|
|
|
configurations {
|
2015-03-23 12:14:26 -04:00
|
|
|
integrationTestCompile {
|
|
|
|
extendsFrom testCompile, optional, provided
|
|
|
|
}
|
|
|
|
integrationTestRuntime {
|
|
|
|
extendsFrom integrationTestCompile, testRuntime
|
|
|
|
}
|
2015-07-07 15:03:51 -04:00
|
|
|
springSnapshotTestRuntime.extendsFrom testRuntime
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations.springSnapshotTestRuntime {
|
|
|
|
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
|
|
|
if (details.requested.group == 'org.springframework') {
|
|
|
|
details.useVersion 'latest.integration'
|
|
|
|
}
|
|
|
|
}
|
2011-02-14 09:57:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
2015-03-23 12:14:26 -04:00
|
|
|
integrationTest {
|
|
|
|
java.srcDir file('src/integration-test/java')
|
|
|
|
groovy.srcDirs file('src/integration-test/groovy')
|
|
|
|
resources.srcDir file('src/integration-test/resources')
|
|
|
|
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) {
|
2015-03-23 12:14:26 -04:00
|
|
|
testClassesDir = sourceSets.integrationTest.output.classesDir
|
|
|
|
logging.captureStandardOutput(LogLevel.INFO)
|
|
|
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
|
|
|
maxParallelForks = 1
|
|
|
|
reports {
|
|
|
|
html.destination = project.file("$project.buildDir/reports/integration-tests/")
|
|
|
|
junitXml.destination = project.file("$project.buildDir/integration-test-results/")
|
|
|
|
}
|
2011-02-14 09:57:30 -05:00
|
|
|
}
|
2014-09-16 10:54:45 -04:00
|
|
|
|
|
|
|
eclipse {
|
2015-03-23 12:14:26 -04:00
|
|
|
classpath {
|
|
|
|
plusConfigurations += [ configurations.integrationTestCompile ]
|
|
|
|
}
|
2014-09-16 10:54:45 -04: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
|
|
|
|
2015-07-07 15:03:51 -04:00
|
|
|
task springSnapshotTest(type: Test) {
|
|
|
|
jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=128M']
|
|
|
|
classpath = sourceSets.test.output + sourceSets.main.output + configurations.springSnapshotTestRuntime
|
|
|
|
reports {
|
|
|
|
html.destination = project.file("$buildDir/spring-snapshot-test-results/")
|
|
|
|
junitXml.destination = project.file("$buildDir/reports/spring-snapshot-tests/")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-03 10:40:57 -05:00
|
|
|
dependencies {
|
2015-03-23 12:14:26 -04:00
|
|
|
optional "commons-logging:commons-logging:$commonsLoggingVersion"
|
2010-03-03 10:40:57 -05:00
|
|
|
|
2015-03-23 12:14:26 -04:00
|
|
|
testCompile "junit:junit:$junitVersion",
|
2015-07-13 16:00:07 -04:00
|
|
|
'org.mockito:mockito-core:1.10.19',
|
2015-03-23 12:14:26 -04:00
|
|
|
"org.springframework:spring-test:$springVersion",
|
2016-03-03 15:05:26 -05:00
|
|
|
'org.easytesting:fest-assert:1.4',
|
|
|
|
"org.assertj:assertj-core:2.3.0"
|
2010-07-12 07:30:21 -04:00
|
|
|
|
2015-03-23 12:14:26 -04:00
|
|
|
// Use slf4j/logback for logging
|
|
|
|
testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
|
|
|
"ch.qos.logback:logback-classic:$logbackVersion"
|
2010-03-03 10:40:57 -05:00
|
|
|
}
|
|
|
|
|
2014-04-02 09:48:55 -04:00
|
|
|
[configurations.runtime, configurations.default, configurations.testCompile]*.exclude(module: 'commons-logging')
|
2010-07-12 07:30:21 -04:00
|
|
|
|
2013-09-18 17:13:03 -04:00
|
|
|
configurations.all {
|
2015-03-23 12:14:26 -04:00
|
|
|
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
|
|
|
if (details.requested.group == 'org.slf4j') {
|
|
|
|
details.useVersion slf4jVersion
|
|
|
|
}
|
|
|
|
}
|
2013-09-18 17:13:03 -04:00
|
|
|
}
|
|
|
|
|
2010-08-16 21:16:12 -04:00
|
|
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
|
|
|
|
2014-04-11 10:57:18 -04:00
|
|
|
project.tasks.matching { it instanceof Test && it.name != 'integrationTest' }.all {
|
2015-03-23 12:14:26 -04:00
|
|
|
jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=256M']
|
|
|
|
maxParallelForks = guessMaxForks()
|
|
|
|
logging.captureStandardOutput(LogLevel.INFO)
|
2010-08-04 21:11:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
def guessMaxForks() {
|
2015-03-23 12:14:26 -04:00
|
|
|
int processors = Runtime.runtime.availableProcessors()
|
|
|
|
return Math.max(2, (int) (processors / 2))
|
2010-03-03 10:40:57 -05:00
|
|
|
}
|
|
|
|
|
2015-04-20 17:39:53 -04:00
|
|
|
jar {
|
|
|
|
manifest.attributes["Created-By"] = 'Spring Security Team'
|
|
|
|
manifest.attributes["Implementation-Title"] = project.name
|
|
|
|
manifest.attributes["Implementation-Version"] = project.version
|
|
|
|
manifest.attributes["Premain-Class"] =
|
|
|
|
manifest.attributes["Agent-Class"] =
|
|
|
|
manifest.attributes["Can-Redefine-Classes"] = "true"
|
|
|
|
manifest.attributes["Can-Retransform-Classes"] = "true"
|
|
|
|
manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
|
|
|
|
}
|
|
|
|
|
2012-08-09 23:44:01 -04:00
|
|
|
javadoc {
|
2015-03-23 12:14:26 -04:00
|
|
|
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 = [
|
|
|
|
"http://static.springsource.org/spring/docs/3.2.x/javadoc-api/",
|
|
|
|
"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*'],
|
|
|
|
]
|
|
|
|
}
|
2012-08-09 23:44:01 -04:00
|
|
|
}
|
|
|
|
|
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 {
|
2015-03-23 12:14:26 -04:00
|
|
|
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-08 17:29:43 -04:00
|
|
|
}
|
|
|
|
|
2013-08-13 10:13:02 -04:00
|
|
|
// GRADLE-1116
|
|
|
|
project.eclipse.classpath.file.whenMerged { classpath ->
|
2015-03-23 12:14:26 -04:00
|
|
|
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-13 10:13:02 -04:00
|
|
|
}
|
|
|
|
|
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 ->
|
2015-03-23 12:14:26 -04:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-08-08 17:29:43 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-11 15:00:18 -04:00
|
|
|
project.idea.module {
|
2015-03-23 12:14:26 -04:00
|
|
|
scopes.TEST.plus += [project.configurations.integrationTestRuntime]
|
|
|
|
testSourceDirs += sourceSets.integrationTest.resources.srcDirs
|
2014-06-11 15:00:18 -04:00
|
|
|
}
|
|
|
|
|
2012-08-09 23:44:01 -04:00
|
|
|
task javadocJar(type: Jar) {
|
2015-03-23 12:14:26 -04:00
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc
|
2012-08-09 23:44:01 -04:00
|
|
|
}
|
2013-12-09 16:51:49 -05:00
|
|
|
|
|
|
|
artifacts {
|
2015-03-23 12:14:26 -04:00
|
|
|
archives javadocJar
|
2013-12-09 16:51:49 -05:00
|
|
|
}
|