spring-security/build.gradle

130 lines
4.5 KiB
Groovy

apply plugin: 'base'
allprojects {
version = '3.1.0.CI-SNAPSHOT'
releaseBuild = version.endsWith('RELEASE')
snapshotBuild = version.endsWith('SNAPSHOT')
group = 'org.springframework.security'
repositories {
mavenLocal()
mavenCentral()
}
}
// Set up different subproject lists for individual configuration
javaProjects = subprojects.findAll { project -> project.name != 'docs' && project.name != 'faq' && project.name != 'manual' }
sampleProjects = subprojects.findAll { project -> project.name.startsWith('spring-security-samples') }
itestProjects = subprojects.findAll { project -> project.name.startsWith('itest') }
coreModuleProjects = javaProjects - sampleProjects - itestProjects
aspectjProjects = [project(':spring-security-aspects'), project(':spring-security-samples-aspectj')]
configure(javaProjects) {
apply from: "$rootDir/gradle/javaprojects.gradle"
}
configure(coreModuleProjects) {
// Gives better names in structure101 jar diagram
sourceSets.main.classesDir = new File(buildDir, "classes/" + project.name.substring("spring-security".length() + 1))
apply plugin: 'bundlor'
bundlor.expansions = bundlorProperties
apply from: "$rootDir/gradle/maven-deployment.gradle"
apply plugin: 'emma'
}
task coreBuild {
dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'build' }
}
configure (aspectjProjects) {
apply plugin: 'aspectj'
}
apply from: "$rootDir/gradle/dist.gradle"
apply plugin: 'idea'
configure(javaProjects) {
apply plugin: 'idea'
apply plugin: 'eclipse'
ideaModule {
downloadJavadoc=false
excludeDirs.add(buildDir)
gradleCacheVariable = 'GRADLE_CACHE'
outputDir = "$rootProject.projectDir/intellij/out" as File
testOutputDir = "$rootProject.projectDir/intellij/testOut" as File
whenConfigured { module ->
def allClasses = module.dependencies.findAll() { dep ->
if (dep instanceof org.gradle.plugins.idea.model.ModuleLibrary
&& dep.classes.find { path ->
path.url.matches('.*jcl-over-slf4j.*') ||
path.url.matches('.*servlet-api.*') ||
path.url.matches('.*jsp-api.*')
}) {
dep.scope = 'COMPILE'
dep.exported = false
}
}
}
}
// GRADLE-1116
eclipseClasspath.whenConfigured { classpath ->
classpath.entries.removeAll { entry -> entry.path.endsWith('/build/classes/test') }
}
eclipseClasspath.doFirst {
eclipseClasspath.whenConfigured { classpath ->
def includeDeps = project.configurations.getByName('runtime')?.collect { f-> f.absolutePath } as Set
classpath.entries.each { cp ->
if(cp instanceof org.gradle.plugins.eclipse.model.Library) {
def include = includeDeps.contains(cp.path)
def attr = 'org.eclipse.jst.component.dependency'
if(include && project.hasProperty('war')) {
// GRADLE-1426 (part a)
cp.entryAttributes.put(attr,'/WEB-INF/lib')
} else if(!include) {
// GRADLE-1422
cp.entryAttributes.remove(attr)
}
}
}
}
}
// GRADLE-1426 (part b)
project.plugins.withType(org.gradle.api.plugins.WarPlugin.class).all {
eclipseWtpComponent.whenConfigured { wtpComp ->
wtpComp.wbModuleEntries.findAll { it instanceof org.gradle.plugins.eclipse.model.WbDependentModule }.each { e ->
if(!e.handle.startsWith('module:/resource/')) {
wtpComp.wbModuleEntries.remove(e)
}
}
}
}
tasks.withType(org.gradle.plugins.eclipse.EclipseWtpComponent) {
whenConfigured { wtpComponent ->
wtpComponent.contextPath = project.tasks.findByName('jettyRun')?.contextPath?.replaceFirst('/','')
}
}
}
ideaModule {
excludeDirs += file('.gradle')
excludeDirs += file('buildSrc/build')
excludeDirs += file('buildSrc/.gradle')
}
ideaProject {
javaVersion = '1.6'
subprojects = [rootProject] + javaProjects
withXml { node ->
// Use git
def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
vcsConfig.mapping[0].'@vcs' = 'Git'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-1'
}