2013-06-20 12:40:54 -04:00
|
|
|
import groovy.text.SimpleTemplateEngine
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
maven { url "http://repo.springsource.org/plugins-release" }
|
|
|
|
}
|
|
|
|
dependencies {
|
2013-11-25 18:00:34 -05:00
|
|
|
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.5")
|
2013-06-20 12:40:54 -04:00
|
|
|
classpath("org.springframework.build.gradle:bundlor-plugin:0.1.2")
|
2013-08-05 17:22:33 -04:00
|
|
|
classpath("org.gradle.api.plugins:gradle-tomcat-plugin:0.9.8")
|
2013-09-11 18:30:50 -04:00
|
|
|
classpath('me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1')
|
2013-10-30 17:56:00 -04:00
|
|
|
classpath('org.asciidoctor:asciidoctor-gradle-plugin:0.7.0')
|
2013-12-06 12:12:07 -05:00
|
|
|
classpath('org.asciidoctor:asciidoctor-java-integration:0.1.4.preview.1')
|
2013-06-20 12:40:54 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-15 12:00:01 -04:00
|
|
|
apply plugin: 'sonar-runner'
|
2010-03-28 18:54:41 -04:00
|
|
|
apply plugin: 'base'
|
2010-01-19 23:14:48 -05:00
|
|
|
|
2011-04-21 06:57:18 -04:00
|
|
|
description = 'Spring Security'
|
|
|
|
|
2009-12-04 16:33:17 -05:00
|
|
|
allprojects {
|
2013-08-08 17:29:43 -04:00
|
|
|
apply plugin: 'idea'
|
|
|
|
apply plugin: 'eclipse'
|
|
|
|
|
2012-06-29 13:59:22 -04:00
|
|
|
ext.releaseBuild = version.endsWith('RELEASE')
|
|
|
|
ext.snapshotBuild = version.endsWith('SNAPSHOT')
|
2013-12-04 13:38:45 -05:00
|
|
|
ext.springVersion = '3.2.4.RELEASE'
|
|
|
|
ext.spring4Version = '4.0.0.BUILD-SNAPSHOT'
|
2010-01-21 00:28:17 -05:00
|
|
|
|
2010-01-12 19:44:05 -05:00
|
|
|
group = 'org.springframework.security'
|
|
|
|
|
2009-12-04 16:33:17 -05:00
|
|
|
repositories {
|
2013-08-27 09:47:04 -04:00
|
|
|
maven { url "http://repo.springsource.org/libs-snapshot" }
|
2013-07-16 15:34:46 -04:00
|
|
|
maven { url "http://repo.springsource.org/plugins-release" }
|
2013-08-27 09:47:04 -04:00
|
|
|
maven { url "http://repo.terracotta.org/maven2/" }
|
2009-12-04 16:33:17 -05:00
|
|
|
}
|
2013-08-08 17:29:43 -04:00
|
|
|
|
|
|
|
eclipse.project.name = "${project.name}-3.2.x"
|
2009-12-04 16:33:17 -05:00
|
|
|
}
|
|
|
|
|
2013-07-15 12:00:01 -04:00
|
|
|
sonarRunner {
|
|
|
|
sonarProperties {
|
|
|
|
property "sonar.java.coveragePlugin", "jacoco"
|
|
|
|
property "sonar.projectName", "Spring Security"
|
|
|
|
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
|
|
|
|
property "sonar.links.homepage", 'https://www.springsource.org/spring-security'
|
|
|
|
property "sonar.links.ci", 'https://build.springsource.org/browse/SEC-B32X'
|
|
|
|
property "sonar.links.issue", 'https://jira.springsource.org/browse/SEC'
|
|
|
|
property "sonar.links.scm", 'https://github.com/SpringSource/spring-security'
|
|
|
|
property "sonar.links.scm_dev", 'https://github.com/SpringSource/spring-security.git'
|
|
|
|
property "sonar.java.coveragePlugin", "jacoco"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-04 16:35:57 -04:00
|
|
|
// Set up different subproject lists for individual configuration
|
2013-12-09 16:51:49 -05:00
|
|
|
ext.javaProjects = subprojects.findAll { project -> project.name != 'docs' && project.name != 'manual' && project.name != 'guides' && project.name != 'spring-security-bom' }
|
2012-06-29 13:59:22 -04:00
|
|
|
ext.sampleProjects = subprojects.findAll { project -> project.name.startsWith('spring-security-samples') }
|
|
|
|
ext.itestProjects = subprojects.findAll { project -> project.name.startsWith('itest') }
|
|
|
|
ext.coreModuleProjects = javaProjects - sampleProjects - itestProjects
|
2013-08-01 15:14:18 -04:00
|
|
|
ext.aspectjProjects = [project(':spring-security-aspects'), project(':spring-security-samples-aspectj-xml')]
|
2010-08-03 21:04:40 -04:00
|
|
|
|
2013-08-05 11:37:37 -04:00
|
|
|
configure(allprojects - javaProjects) {
|
|
|
|
task afterEclipseImport {
|
|
|
|
ext.srcFile = file('.classpath')
|
|
|
|
inputs.file srcFile
|
|
|
|
outputs.dir srcFile
|
|
|
|
|
|
|
|
onlyIf { !srcFile.exists() }
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
srcFile << """<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<classpath>
|
|
|
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
|
|
|
<classpathentry kind="output" path="bin"/>
|
|
|
|
</classpath>
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-09 17:25:00 -05:00
|
|
|
configure(subprojects - coreModuleProjects - project(':spring-security-samples-messages-jc') - project(':spring-security-bom')) {
|
2012-12-12 19:04:10 -05:00
|
|
|
tasks.findByPath("artifactoryPublish")?.enabled = false
|
2013-07-15 12:00:01 -04:00
|
|
|
sonarRunner {
|
|
|
|
skipProject = true
|
|
|
|
}
|
2012-12-12 19:04:10 -05:00
|
|
|
}
|
|
|
|
|
2010-08-03 21:04:40 -04:00
|
|
|
configure(javaProjects) {
|
2013-08-05 17:22:33 -04:00
|
|
|
ext.TOMCAT_GRADLE = "$rootDir/gradle/tomcat.gradle"
|
|
|
|
ext.WAR_SAMPLE_GRADLE = "$rootDir/gradle/war-sample.gradle"
|
2010-08-03 21:04:40 -04:00
|
|
|
apply from: "$rootDir/gradle/javaprojects.gradle"
|
2012-12-13 11:04:52 -05:00
|
|
|
apply from: "$rootDir/gradle/release-checks.gradle"
|
2013-07-16 15:34:46 -04:00
|
|
|
apply from: "$rootDir/gradle/maven-deployment.gradle"
|
2010-08-03 21:04:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
configure(coreModuleProjects) {
|
2011-02-16 10:57:22 -05:00
|
|
|
apply plugin: 'bundlor'
|
|
|
|
apply plugin: 'emma'
|
2010-08-03 21:04:40 -04:00
|
|
|
|
2013-06-20 12:40:54 -04:00
|
|
|
bundlor.doFirst {
|
|
|
|
def templateText = file("template.mf").text
|
|
|
|
bundlor.manifestTemplate = new SimpleTemplateEngine().createTemplate(templateText).make(bundlorProperties).toString()
|
|
|
|
}
|
2013-07-15 12:00:01 -04:00
|
|
|
configurations {
|
|
|
|
jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
|
2013-08-27 09:47:04 -04:00
|
|
|
spring4TestRuntime.extendsFrom testRuntime
|
2013-07-15 12:00:01 -04:00
|
|
|
}
|
2013-08-27 09:47:04 -04:00
|
|
|
configurations.spring4TestRuntime {
|
|
|
|
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
|
|
|
if (details.requested.group == 'org.springframework') {
|
2013-12-04 13:38:45 -05:00
|
|
|
details.useVersion spring4Version
|
2013-08-27 09:47:04 -04:00
|
|
|
}
|
|
|
|
if (details.requested.name == 'ehcache') {
|
|
|
|
details.useVersion '2.6.5'
|
|
|
|
}
|
|
|
|
if (details.requested.name == 'ehcache-terracotta') {
|
|
|
|
details.useVersion '2.1.1'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-15 12:00:01 -04:00
|
|
|
dependencies {
|
|
|
|
jacoco "org.jacoco:org.jacoco.agent:0.6.2.201302030002:runtime"
|
|
|
|
}
|
|
|
|
test {
|
|
|
|
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=${project.group}.*"
|
|
|
|
}
|
|
|
|
integrationTest {
|
|
|
|
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=${project.group}.*"
|
|
|
|
}
|
2013-08-27 09:47:04 -04:00
|
|
|
task spring4Test(type: Test) {
|
|
|
|
jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=128M']
|
|
|
|
exclude "**/EhCacheBasedAclCacheTests.class", "**/Issue55Tests.class"
|
|
|
|
classpath = sourceSets.test.output + sourceSets.main.output + configurations.spring4TestRuntime
|
|
|
|
testResultsDir = file("$buildDir/spring4-test-results/")
|
|
|
|
testReportDir = file("$buildDir/reports/spring4-tests/")
|
|
|
|
}
|
|
|
|
check.dependsOn spring4Test
|
2010-08-24 13:27:44 -04:00
|
|
|
}
|
|
|
|
|
2010-08-03 21:04:40 -04:00
|
|
|
configure (aspectjProjects) {
|
2013-06-20 12:40:54 -04:00
|
|
|
apply plugin: 'java'
|
2011-02-16 10:57:22 -05:00
|
|
|
apply plugin: 'aspectj'
|
2010-08-03 21:04:40 -04:00
|
|
|
}
|
|
|
|
|
2013-06-20 12:40:54 -04:00
|
|
|
task coreBuild {
|
|
|
|
dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'build' }
|
|
|
|
}
|
|
|
|
|
2011-04-21 06:57:18 -04:00
|
|
|
// Task for creating the distro zip
|
2010-08-03 21:04:40 -04:00
|
|
|
|
2011-04-21 06:57:18 -04:00
|
|
|
task dist(type: Zip) {
|
2013-07-16 15:34:46 -04:00
|
|
|
dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' || task.name.endsWith('Zip') || task.name.endsWith('generatePom') }
|
2012-08-08 15:16:37 -04:00
|
|
|
classifier = 'dist'
|
2010-08-24 17:36:42 -04:00
|
|
|
|
2011-04-21 06:57:18 -04:00
|
|
|
evaluationDependsOn(':docs')
|
2013-08-06 12:35:48 -04:00
|
|
|
evaluationDependsOn(':docs:manual')
|
2011-04-21 06:57:18 -04:00
|
|
|
|
|
|
|
def zipRootDir = "${project.name}-$version"
|
|
|
|
into(zipRootDir) {
|
|
|
|
from(rootDir) {
|
|
|
|
include '*.txt'
|
2011-03-07 22:11:23 -05:00
|
|
|
}
|
2011-04-21 06:57:18 -04:00
|
|
|
into('docs') {
|
|
|
|
with(project(':docs').apiSpec)
|
|
|
|
with(project(':docs:manual').spec)
|
2013-08-06 12:35:48 -04:00
|
|
|
with(project(':docs:guides').spec)
|
2011-03-06 13:49:47 -05:00
|
|
|
}
|
2011-04-21 06:57:18 -04:00
|
|
|
into('dist') {
|
|
|
|
from coreModuleProjects.collect {project -> project.libsDir }
|
2013-07-16 15:34:46 -04:00
|
|
|
}
|
|
|
|
sampleProjects.each { project->
|
|
|
|
into("$zipRootDir/samples/$project.name") {
|
|
|
|
from(project.projectDir) {
|
|
|
|
include "src/main/**"
|
|
|
|
include "pom.xml"
|
|
|
|
}
|
|
|
|
}
|
2011-03-06 19:34:40 -05:00
|
|
|
}
|
|
|
|
}
|
2010-07-07 17:40:17 -04:00
|
|
|
}
|
|
|
|
|
2012-08-08 15:16:37 -04:00
|
|
|
artifacts {
|
|
|
|
archives dist
|
|
|
|
archives project(':docs').docsZip
|
|
|
|
archives project(':docs').schemaZip
|
2010-07-07 17:40:17 -04:00
|
|
|
}
|
|
|
|
|
2010-08-04 16:35:57 -04:00
|
|
|
task wrapper(type: Wrapper) {
|
2013-12-11 18:52:41 -05:00
|
|
|
gradleVersion = '1.10-rc-2'
|
2010-08-04 16:35:57 -04:00
|
|
|
}
|