Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
333 lines (282 sloc) 11.564 kb
buildscript {
repositories {
maven { url "http://repo.spring.io/plugins-release" }
}
dependencies {
classpath("org.springframework.build.gradle:docbook-reference-plugin:0.2.8")
classpath("me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1")
classpath('org.asciidoctor:asciidoctor-gradle-plugin:0.7.0')
classpath('org.asciidoctor:asciidoctor-java-integration:0.1.4.preview.1')
classpath('org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE')
}
}
// Set up different subproject lists for individual configuration
ext.javaProjects = subprojects.findAll { project -> project.name != 'docs' && project.name != 'manual' }
ext.coreModuleProjects = javaProjects
configure(allprojects) {
group = "org.springframework.social"
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "javadocHotfix"
compileJava {
sourceCompatibility=1.5
targetCompatibility=1.5
}
compileTestJava {
sourceCompatibility=1.7
targetCompatibility=1.7
}
[compileJava, compileTestJava]*.options*.compilerArgs = [
"-Xlint:serial",
"-Xlint:varargs",
"-Xlint:cast",
"-Xlint:classfile",
"-Xlint:dep-ann",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:finally",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:static",
"-Xlint:try",
"-Xlint:-options", // intentionally disabled
"-Xlint:-fallthrough", // intentionally disabled
"-Xlint:rawtypes",
"-Xlint:deprecation",
"-Xlint:unchecked"
]
sourceSets.test.resources.srcDirs = [
"src/test/resources",
"src/test/java"
]
test.systemProperty("java.awt.headless", "true")
repositories {
maven { url "http://repo.spring.io/libs-snapshot" }
mavenLocal()
}
dependencies {
testCompile("org.springframework:spring-test:${springVersion}")
testCompile("junit:junit-dep:${junitVersion}")
testCompile("org.hamcrest:hamcrest-library:${hamcrestVersion}")
testCompile("org.mockito:mockito-core:${mockitoVersion}")
}
ext.javadocLinks = [
"http://docs.oracle.com/javase/7/docs/api/",
"http://docs.oracle.com/javaee/7/api/",
"http://docs.spring.io/spring/docs/${springVersion}/javadoc-api/",
"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/"
] as String[]
// servlet-api (2.5) and tomcat-servlet-api (3.0) classpath entries should not be
// exported to dependent projects in Eclipse to avoid false compilation errors due
// to changing APIs across these versions
eclipse.classpath.file.whenMerged { classpath ->
classpath.entries.findAll { entry -> entry.path.contains("servlet-api") }*.exported = false
}
}
configure(subprojects) { subproject ->
apply from: "${rootProject.projectDir}/publish-maven.gradle"
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
repositories {
maven { url "https://repo.spring.io/libs-snapshot" }
}
dependencies {
springIoVersions "io.spring.platform:platform-versions:${platformVersion}@properties"
}
}
jar {
manifest.attributes["Implementation-Title"] = subproject.name
manifest.attributes["Implementation-Version"] = subproject.version
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.links(project.ext.javadocLinks)
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
//options.overview = "${projectDir}/src/main/java/overview.html"
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
configurations {
springReleaseTestRuntime.extendsFrom testRuntime
springSnapshotTestRuntime.extendsFrom testRuntime
}
// Test against latest Spring Framework release
configurations.springReleaseTestRuntime {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.springframework') {
details.useVersion springReleaseVersion
}
}
}
// Test against latest Spring Framework snapshot
configurations.springSnapshotTestRuntime {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.springframework') {
details.useVersion springSnapshotVersion
}
}
}
task springReleaseTest(type: Test) {
classpath = sourceSets.test.output + sourceSets.main.output + configurations.springReleaseTestRuntime
getReports().getJunitXml().setDestination(file("$buildDir/spring-release-test-results/"))
getReports().getHtml().setDestination(file("$buildDir/reports/spring-release-tests/"))
}
check.dependsOn springReleaseTest
task springSnapshotTest(type: Test) {
classpath = sourceSets.test.output + sourceSets.main.output + configurations.springSnapshotTestRuntime
getReports().getJunitXml().setDestination(file("$buildDir/spring-snapshot-test-results/"))
getReports().getHtml().setDestination(file("$buildDir/reports/spring-snapshot-tests/"))
}
check.dependsOn springSnapshotTest
configure([test, springReleaseTest, springSnapshotTest]) {
systemProperties['springVersion'] = springVersion
}
}
project("spring-social-core") {
description = "Foundational module containing the ServiceProvider Connect Framework and Service API invocation support."
dependencies {
compile("org.springframework:spring-jdbc:$springVersion", optional)
compile("org.springframework:spring-web:$springVersion")
compile("org.springframework.security:spring-security-crypto:$springSecurityVersion", optional)
compile("org.apache.httpcomponents:httpclient:$httpComponentsVersion", optional)
testCompile("com.h2database:h2:$h2Version")
testCompile("org.springframework:spring-test:$springVersion")
testCompile("javax.servlet:javax.servlet-api:$servletApiVersion", provided)
testCompile("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
}
}
project("spring-social-web") {
description = "Spring Web Integration"
dependencies {
compile project(":spring-social-core")
compile("javax.inject:javax.inject:$javaxInjectVersion")
compile("org.springframework:spring-web:$springVersion")
compile("org.springframework:spring-webmvc:$springVersion")
compile("javax.servlet:javax.servlet-api:$servletApiVersion", provided)
compile("javax.servlet.jsp:javax.servlet.jsp-api:$jspApiVersion", provided)
compile("org.thymeleaf:thymeleaf:$thymeleafVersion", optional)
compile("org.thymeleaf:thymeleaf-spring4:$thymeleafVersion", optional)
testCompile("org.springframework:spring-test:$springVersion")
testCompile("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
}
metaInf << files("src/main/resources/tld/spring-social.tld")
}
project("spring-social-config") {
description = "Spring Social Config"
dependencies {
compile project(":spring-social-core")
compile project(":spring-social-security"), optional
compile project(":spring-social-web")
compile("org.springframework.security:spring-security-core:$springSecurityVersion", optional)
testCompile("javax.servlet:javax.servlet-api:$servletApiVersion", provided)
testCompile("com.h2database:h2:$h2Version")
testCompile("org.springframework:spring-jdbc:$springVersion")
}
}
project("spring-social-security") {
description = "Spring Security Integration"
dependencies {
compile project(":spring-social-core")
compile project(":spring-social-web")
compile("org.springframework:spring-web:$springVersion")
compile("org.springframework:spring-webmvc:$springVersion")
compile("org.springframework.security:spring-security-config:$springSecurityVersion", optional)
compile("org.springframework.security:spring-security-web:$springSecurityVersion")
compile("javax.servlet:javax.servlet-api:$servletApiVersion", provided)
}
}
configure(rootProject) {
description = "Spring Social"
// don"t publish the default jar for the root project
configurations.archives.artifacts.clear()
dependencies { // for integration tests
}
task api(type: Javadoc) {
group = "Documentation"
description = "Generates aggregated Javadoc API documentation."
title = "${rootProject.description} ${version} API"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.overview = "src/api/overview.html"
options.links(project.ext.javadocLinks)
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
maxMemory = "1024m"
destinationDir = new File(buildDir, "api")
}
// Task for creating the distro zip
task dist(type: Zip) {
dependsOn subprojects*.tasks*.matching { task -> task.name == 'assemble' || task.name.endsWith('Zip') || task.name.endsWith('generatePom') }
classifier = 'dist'
evaluationDependsOn(':docs')
evaluationDependsOn(':docs:manual')
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 }
}
}
}
artifacts {
archives dist
archives project(':docs').docsZip
archives project(':docs').schemaZip
}
task wrapper(type: Wrapper) {
gradleVersion = "1.12"
}
}
task updateRootDocs << {
copy {
from "src/dist"
into "${rootProject.projectDir}"
include "notice.txt"
expand(copyright: new Date().format("yyyy"), version: project.version)
rename { filename -> "NOTICE" }
}
copy {
from "src/dist"
into "${rootProject.projectDir}"
include "license.txt"
rename { filename -> "LICENSE" }
}
}
build.dependsOn("updateRootDocs")
Jump to Line
Something went wrong with that request. Please try again.