2010-01-11 19:35:20 -05:00
|
|
|
import java.util.jar.Manifest
|
|
|
|
import org.gradle.api.tasks.bundling.GradleManifest
|
2009-12-21 12:32:38 -05:00
|
|
|
|
2010-01-19 23:14:48 -05:00
|
|
|
apply id: 'base'
|
|
|
|
|
2009-12-04 16:33:17 -05:00
|
|
|
allprojects {
|
2010-01-15 13:15:19 -05:00
|
|
|
version = '3.0.2.CI-SNAPSHOT'
|
2010-01-17 21:02:28 -05:00
|
|
|
releaseBuild = version.endsWith('RELEASE')
|
2010-01-12 19:44:05 -05:00
|
|
|
group = 'org.springframework.security'
|
|
|
|
|
2009-12-04 16:33:17 -05:00
|
|
|
repositories {
|
2010-01-11 19:35:20 -05:00
|
|
|
mavenRepo name:'Local', urls:'file:///Users/luke/.m2/repository'
|
2009-12-04 16:33:17 -05:00
|
|
|
mavenCentral()
|
2010-01-11 19:35:20 -05:00
|
|
|
mavenRepo name:'SpringSource Milestone Repo', urls:'http://repository.springsource.com/maven/bundles/milestone'
|
2009-12-04 16:33:17 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-01-19 23:14:48 -05:00
|
|
|
configure(javaProjects()) {
|
2010-01-10 18:31:23 -05:00
|
|
|
apply id: 'java'
|
|
|
|
|
2009-12-21 12:32:38 -05:00
|
|
|
springVersion = '3.0.0.RELEASE'
|
|
|
|
springLdapVersion = '1.3.0.RELEASE'
|
2009-12-07 20:54:15 -05:00
|
|
|
ehcacheVersion = '1.6.2'
|
2009-12-21 12:32:38 -05:00
|
|
|
aspectjVersion = '1.6.5'
|
2010-01-10 18:31:23 -05:00
|
|
|
apacheDsVersion = '1.5.5'
|
|
|
|
jstlVersion = '1.1.2'
|
2009-12-21 12:32:38 -05:00
|
|
|
|
2010-01-10 18:31:23 -05:00
|
|
|
configurations {
|
2010-01-11 19:35:20 -05:00
|
|
|
bundlor
|
2010-01-10 18:31:23 -05:00
|
|
|
provided
|
|
|
|
}
|
|
|
|
|
2009-12-04 16:33:17 -05:00
|
|
|
dependencies {
|
|
|
|
compile 'commons-logging:commons-logging:1.1.1'
|
|
|
|
|
2009-12-21 12:32:38 -05:00
|
|
|
testCompile 'junit:junit:4.7',
|
2009-12-04 16:33:17 -05:00
|
|
|
'org.mockito:mockito-core:1.7',
|
|
|
|
'org.jmock:jmock:2.5.1',
|
|
|
|
'org.jmock:jmock-junit4:2.5.1',
|
|
|
|
'org.hamcrest:hamcrest-core:1.1',
|
|
|
|
'org.hamcrest:hamcrest-library:1.1',
|
|
|
|
"org.springframework:spring-test:$springVersion"
|
2010-01-11 19:35:20 -05:00
|
|
|
bundlor 'com.springsource.bundlor:com.springsource.bundlor.ant:1.0.0.RC1',
|
|
|
|
'com.springsource.bundlor:com.springsource.bundlor:1.0.0.RC1',
|
|
|
|
'com.springsource.bundlor:com.springsource.bundlor.blint:1.0.0.RC1'
|
2009-12-04 16:33:17 -05:00
|
|
|
}
|
2010-01-10 18:31:23 -05:00
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
compileClasspath = compileClasspath + configurations.provided
|
|
|
|
}
|
|
|
|
test {
|
|
|
|
compileClasspath = compileClasspath + configurations.provided
|
2010-01-17 21:02:28 -05:00
|
|
|
runtimeClasspath = runtimeClasspath + configurations.provided
|
2010-01-10 18:31:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-04 16:33:17 -05:00
|
|
|
test {
|
2010-01-17 21:02:28 -05:00
|
|
|
options.fork(forkMode: ForkMode.ONCE, jvmArgs: ["-ea", '-Xms128m', '-Xmx500m', '-XX:MaxPermSize=128m', '-XX:+HeapDumpOnOutOfMemoryError'])
|
2009-12-04 16:33:17 -05:00
|
|
|
}
|
2010-01-11 19:35:20 -05:00
|
|
|
|
2010-01-17 21:02:28 -05:00
|
|
|
task bundlor (dependsOn: compileJava) << {
|
|
|
|
if (!dependsOnTaskDidWork()) {
|
|
|
|
return
|
|
|
|
}
|
2010-01-11 19:35:20 -05:00
|
|
|
ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath)
|
|
|
|
File template = new File(projectDir, 'template.mf')
|
2010-01-17 21:02:28 -05:00
|
|
|
mkdir(buildDir, 'bundlor')
|
2010-01-11 19:35:20 -05:00
|
|
|
if (template.exists()) {
|
2010-01-17 21:02:28 -05:00
|
|
|
ant.bundlor(inputPath: "$buildDir/classes/main", outputPath: "$buildDir/bundlor", manifestTemplatePath: template) {
|
2010-01-12 19:44:05 -05:00
|
|
|
property(name: 'version', value: "$version")
|
|
|
|
property(name: 'spring.version', value: "$springVersion")
|
2010-01-11 19:35:20 -05:00
|
|
|
}
|
|
|
|
// See GRADLE-395 for support for using an existing manifest
|
2010-01-17 21:02:28 -05:00
|
|
|
jar.manifest = new GradleManifest(new Manifest(new File("$buildDir/bundlor/META-INF/MANIFEST.MF").newInputStream()))
|
2010-01-11 19:35:20 -05:00
|
|
|
}
|
|
|
|
}
|
2010-01-17 21:02:28 -05:00
|
|
|
|
|
|
|
jar.dependsOn bundlor
|
2009-12-04 16:33:17 -05:00
|
|
|
}
|
|
|
|
|
2010-01-19 23:14:48 -05:00
|
|
|
configure(javaProjects()) {
|
2010-01-12 19:44:05 -05:00
|
|
|
apply id: 'maven'
|
|
|
|
|
|
|
|
// Create a source jar for uploading
|
|
|
|
task sourceJar(type: Jar) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.java
|
|
|
|
}
|
|
|
|
|
2010-01-17 21:02:28 -05:00
|
|
|
configurations {
|
|
|
|
deployerJars
|
|
|
|
}
|
|
|
|
|
2010-01-12 19:44:05 -05:00
|
|
|
artifacts {
|
|
|
|
archives sourceJar
|
|
|
|
}
|
|
|
|
|
2010-01-17 21:02:28 -05:00
|
|
|
dependencies {
|
|
|
|
deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:2.0.1.BUILD-SNAPSHOT"
|
|
|
|
}
|
|
|
|
|
2010-01-12 19:44:05 -05:00
|
|
|
uploadArchives {
|
2010-01-17 21:02:28 -05:00
|
|
|
repositories.mavenDeployer {
|
|
|
|
configuration = configurations.deployerJars
|
|
|
|
if (releaseBuild) {
|
|
|
|
// "mavenSyncRepoDir" should be set in properties
|
|
|
|
repository(url: mavenSyncRepoDir)
|
|
|
|
} else {
|
|
|
|
s3credentials = [userName: s3AccessKey, passphrase: s3SecretAccessKey]
|
|
|
|
repository(url: "s3://maven.springframework.org/milestone") {
|
|
|
|
authentication(s3credentials)
|
|
|
|
}
|
|
|
|
snapshotRepository(url: "s3://maven.springframework.org/snapshot") {
|
|
|
|
authentication(s3credentials)
|
|
|
|
}
|
2010-01-12 19:44:05 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
conf2ScopeMappings.addMapping(1, configurations.provided, "provided")
|
|
|
|
}
|
2010-01-19 23:14:48 -05:00
|
|
|
|
|
|
|
task apidocs(type: Javadoc) {
|
|
|
|
destinationDir = new File(buildDir, 'apidocs')
|
|
|
|
optionsFile = file("$buildDir/tmp/javadoc.options")
|
|
|
|
|
|
|
|
source coreModuleProjects().collect { project ->
|
|
|
|
project.sourceSets.main.allJava
|
|
|
|
}
|
|
|
|
|
|
|
|
classpath = files(coreModuleProjects().collect { project ->
|
|
|
|
project.sourceSets.main.compileClasspath })
|
|
|
|
}
|
|
|
|
|
|
|
|
task dist (type: Zip) {
|
|
|
|
def docsDir = new File(project(':manual').buildDir, 'docs')
|
|
|
|
into('docs/apidocs') {
|
|
|
|
from apidocs.destinationDir
|
|
|
|
}
|
|
|
|
into('docs/reference') {
|
|
|
|
from docsDir
|
|
|
|
}
|
|
|
|
|
|
|
|
into('dist') {
|
|
|
|
from coreModuleProjects().collect { project -> project.libsDir }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dist.dependsOn apidocs, ':manual:doc'
|
|
|
|
dist.dependsOn subprojects.collect { "$it.path:assemble" }
|
|
|
|
|
|
|
|
def javaProjects() {
|
|
|
|
subprojects.findAll { project -> project.name != 'faq' && project.name != 'manual' }
|
|
|
|
}
|
|
|
|
|
|
|
|
def sampleProjects() {
|
|
|
|
subprojects.findAll { project -> project.name.startsWith('spring-security-samples') }
|
|
|
|
}
|
|
|
|
|
|
|
|
def coreModuleProjects() {
|
|
|
|
javaProjects() - sampleProjects()
|
|
|
|
}
|