130 lines
4.2 KiB
Groovy
130 lines
4.2 KiB
Groovy
import groovy.text.SimpleTemplateEngine
|
|
|
|
buildscript {
|
|
repositories {
|
|
maven { url "http://repo.springsource.org/plugins-release" }
|
|
}
|
|
dependencies {
|
|
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.3")
|
|
classpath("org.springframework.build.gradle:bundlor-plugin:0.1.2")
|
|
}
|
|
}
|
|
|
|
apply plugin: 'sonar-runner'
|
|
apply plugin: 'base'
|
|
|
|
description = 'Spring Security'
|
|
|
|
allprojects {
|
|
ext.releaseBuild = version.endsWith('RELEASE')
|
|
ext.snapshotBuild = version.endsWith('SNAPSHOT')
|
|
|
|
group = 'org.springframework.security'
|
|
|
|
repositories {
|
|
maven { url "http://repo.springsource.org/plugins-release" }
|
|
}
|
|
}
|
|
|
|
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"
|
|
}
|
|
}
|
|
|
|
// Set up different subproject lists for individual configuration
|
|
ext.javaProjects = subprojects.findAll { project -> project.name != 'docs' && project.name != 'faq' && project.name != 'manual' }
|
|
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
|
|
ext.aspectjProjects = [project(':spring-security-aspects'), project(':spring-security-samples-aspectj')]
|
|
|
|
configure(subprojects - coreModuleProjects) {
|
|
tasks.findByPath("artifactoryPublish")?.enabled = false
|
|
sonarRunner {
|
|
skipProject = true
|
|
}
|
|
}
|
|
|
|
configure(javaProjects) {
|
|
apply from: "$rootDir/gradle/javaprojects.gradle"
|
|
apply from: "$rootDir/gradle/release-checks.gradle"
|
|
apply from: "$rootDir/gradle/maven-deployment.gradle"
|
|
}
|
|
|
|
configure(coreModuleProjects) {
|
|
apply plugin: 'bundlor'
|
|
apply plugin: 'emma'
|
|
|
|
bundlor.doFirst {
|
|
def templateText = file("template.mf").text
|
|
bundlor.manifestTemplate = new SimpleTemplateEngine().createTemplate(templateText).make(bundlorProperties).toString()
|
|
}
|
|
configurations {
|
|
jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
|
|
}
|
|
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}.*"
|
|
}
|
|
}
|
|
|
|
configure (aspectjProjects) {
|
|
apply plugin: 'java'
|
|
apply plugin: 'aspectj'
|
|
}
|
|
|
|
task coreBuild {
|
|
dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'build' }
|
|
}
|
|
|
|
// Task for creating the distro zip
|
|
|
|
task dist(type: Zip) {
|
|
dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' || task.name.endsWith('Zip') }
|
|
classifier = 'dist'
|
|
|
|
evaluationDependsOn(':docs')
|
|
|
|
def zipRootDir = "${project.name}-$version"
|
|
into(zipRootDir) {
|
|
from(rootDir) {
|
|
include '*.txt'
|
|
}
|
|
into('docs') {
|
|
with(project(':docs').apiSpec)
|
|
with(project(':docs:manual').spec)
|
|
}
|
|
into('dist') {
|
|
from coreModuleProjects.collect {project -> project.libsDir }
|
|
from project(':spring-security-samples-tutorial').libsDir
|
|
from project(':spring-security-samples-contacts').libsDir
|
|
}
|
|
}
|
|
}
|
|
|
|
artifacts {
|
|
archives dist
|
|
archives project(':docs').docsZip
|
|
archives project(':docs').schemaZip
|
|
}
|
|
|
|
apply from: "$rootDir/gradle/ide-integration.gradle"
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = '1.6'
|
|
}
|