123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- buildscript {
- repositories {
- maven {
- url = 'https://repo.spring.io/plugins-snapshot'
- if (project.hasProperty('artifactoryUsername')) {
- credentials {
- username "$artifactoryUsername"
- password "$artifactoryPassword"
- }
- }
- }
- }
- dependencies {
- classpath "com.github.ben-manes:gradle-versions-plugin:0.17.0"
- classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
- classpath("io.spring.gradle:spring-io-plugin:0.0.8.RELEASE")
- classpath("com.bmuschko:gradle-tomcat-plugin:2.2.4")
- classpath('me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1')
- classpath('org.asciidoctor:asciidoctor-gradle-plugin:1.5.7')
- classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
- classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.22.RELEASE")
- classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.12.0"
- classpath 'org.hidetake:gradle-ssh-plugin:2.10.1'
- classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.10.0'
- }
- }
- plugins {
- id "org.sonarqube" version "2.1-rc1"
- }
- apply plugin: 'base'
- apply from: "$rootDir/gradle/finalize-deploy.gradle"
- description = 'Spring Security'
- allprojects {
- apply plugin: 'idea'
- apply plugin: 'eclipse'
- apply plugin: "com.github.ben-manes.versions"
- ext.releaseBuild = version.endsWith('RELEASE')
- ext.snapshotBuild = version.endsWith('SNAPSHOT')
- ext.springVersion = '4.3.30.RELEASE'
- ext.springLdapVersion = '2.3.3.RELEASE'
- group = 'org.springframework.security'
- repositories {
- mavenCentral()
- maven { url "https://repo.spring.io/libs-snapshot" }
- maven { url "https://repo.spring.io/plugins-release" }
- maven { url "https://repo.terracotta.org/maven2/" }
- }
- }
- sonarqube {
- properties {
- 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 != 'manual' && project.name != 'guides' && project.name != 'spring-security-bom' }
- ext.sampleProjects = subprojects.findAll { project -> project.name.startsWith('spring-security-samples') }
- ext.sampleBootProjects = subprojects.findAll { project -> project.name.startsWith('spring-security-samples-boot') }
- ext.itestProjects = subprojects.findAll { project -> project.name.startsWith('itest') }
- ext.coreModuleProjects = javaProjects - sampleProjects - itestProjects
- ext.aspectjProjects = [project(':spring-security-aspects'), project(':spring-security-samples-xml-aspectj'), project(':spring-security-samples-javaconfig-aspectj')]
- 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>
- """
- }
- }
- }
- configure(subprojects - coreModuleProjects - project(':spring-security-samples-javaconfig-messages') - project(':spring-security-bom')) {
- sonarqube {
- skipProject = true
- }
- }
- configure(javaProjects) {
- ext.TOMCAT_GRADLE = "$rootDir/gradle/tomcat.gradle"
- ext.WAR_SAMPLE_GRADLE = "$rootDir/gradle/war-sample.gradle"
- ext.BOOT_SAMPLE_GRADLE = "$rootDir/gradle/boot-sample.gradle"
- apply from: "$rootDir/gradle/javaprojects.gradle"
- if(!project.name.contains('gae')) {
- apply from: "$rootDir/gradle/checkstyle.gradle"
- }
- apply from: "$rootDir/gradle/ide.gradle"
- apply from: "$rootDir/gradle/release-checks.gradle"
- }
- configure(coreModuleProjects) {
- apply from: "$rootDir/gradle/maven-deployment.gradle"
- apply from: "$rootDir/gradle/artifactory.gradle"
- apply from: "$rootDir/gradle/ossrh.gradle"
- apply from: "$rootDir/gradle/deploy-artifacts.gradle"
- apply plugin: 'emma'
- apply plugin: 'spring-io'
- ext.springIoVersion = project.hasProperty('platformVersion') ? platformVersion : 'Brussels-SR9'
- configurations {
- jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
- }
- dependencyManagement {
- imports {
- mavenBom("org.springframework:spring-framework-bom:${springVersion}")
- }
- springIoTestRuntime {
- imports {
- mavenBom("io.spring.platform:platform-bom:${springIoVersion}") {
- bomProperties([
- 'assertj.version': '2.6.0',
- 'mockito.version': '1.10.19'
- ])
- }
- }
- }
- }
- dependencies {
- jacoco "org.jacoco:org.jacoco.agent:0.7.9: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 coreInstall {
- dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'install' }
- }
- // Task for creating the distro zip
- task dist(type: Zip) {
- dependsOn { subprojects*.tasks*.matching { task -> task.name.endsWith('generatePom') } }
- classifier = 'dist'
- evaluationDependsOn(':docs')
- evaluationDependsOn(':docs:manual')
- def zipRootDir = "${project.name}-$version"
- into(zipRootDir) {
- from(rootDir) {
- include '*.adoc'
- include '*.txt'
- }
- into('docs') {
- with(project(':docs').apiSpec)
- with(project(':docs:manual').spec)
- with(project(':docs:guides').spec)
- }
- project.coreModuleProjects*.tasks*.withType(AbstractArchiveTask).flatten().each{ archiveTask ->
- if(archiveTask!=dist){
- into("$zipRootDir/dist") {
- from archiveTask.outputs.files
- }
- }
- }
- sampleProjects.each { project->
- into("$zipRootDir/samples/$project.name") {
- from(project.projectDir) {
- include "src/main/**"
- include "pom.xml"
- }
- }
- }
- }
- }
- artifacts {
- archives dist
- archives project(':docs').docsZip
- archives project(':docs').schemaZip
- }
- if (project.hasProperty('artifactoryUsername')) {
- allprojects { project ->
- project.repositories { repos ->
- all { repo ->
- if (!repo.url.toString().startsWith("https://repo.spring.io/")) {
- return;
- }
- repo.credentials {
- username = artifactoryUsername
- password = artifactoryPassword
- }
- }
- }
- }
- }
|