Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
499 lines (426 sloc) 14.8 KB
description = 'Spring Nanotrader'
apply plugin: 'base'
apply plugin: 'idea'
buildscript {
repositories {
maven { url 'http://repo.springsource.org/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.5'
}
}
allprojects {
group = 'org.springframework.nanotrader'
repositories {
flatDir dirs: ["${gradle.gradleHomeDir}/lib"]
maven { url 'http://repo.springsource.org' }
maven { url 'http://maven.springframework.org/release' }
maven { url 'http://repo.springsource.org/libs-milestone' }
maven { url 'http://spring-roo-repository.springsource.org/release' }
mavenCentral()
maven { url 'http://maven.springframework.org/snapshot' }
}
}
subprojects { subproject ->
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin:'eclipse-wtp'
// ensure JDK 6 compatibility (GRADLE-18; INT-1578)
sourceCompatibility=1.6
targetCompatibility=1.6
ext.aspectjVersion = '1.6.12.M2'
ext.cglibVersion = '2.2'
ext.commonsNetVersion = '3.0.1'
ext.commonsLangVersion = '3.0.1'
ext.easymockVersion = '2.3'
ext.groovyVersion = '1.8.5'
ext.jacksonVersion = '1.9.2'
ext.javaxActivationVersion = '1.1.1'
ext.junitVersion = '4.8.2'
ext.log4jVersion = '1.2.12'
ext.mockitoVersion = '1.9.0'
ext.springVersion = '3.1.2.RELEASE'
ext.springAmqpVersion = '1.0.0.RELEASE'
ext.springDataMongoVersion = '1.0.0.RELEASE'
ext.springDataRedisVersion = '1.0.0.RELEASE'
ext.springGemfireVersion = '1.1.0.RELEASE'
ext.springSecurityVersion = '3.1.0.RELEASE'
ext.springSocialTwitterVersion = '1.0.1.RELEASE'
ext.springWsVersion = '2.0.3.RELEASE'
ext.springIntegrationVersion = '2.1.0.RELEASE'
ext.springRooVersion = '1.2.0.RELEASE'
ext.javaxInjectVersion = '1'
ext.servletApiVersion = '2.5'
ext.dozerVersion='5.3.2'
ext.h2Version="1.3.166"
ext.webAppDirName = 'src/main/webapp'
// add the natures and builders to your project
eclipse.project {
natures 'org.eclipse.wst.common.project.facet.core.nature', 'org.eclipse.wst.common.modulecore.ModuleCoreNature'
natures += 'org.springframework.ide.eclipse.core.springnature'
buildCommand 'org.eclipse.wst.common.project.facet.core.builder'
buildCommand 'org.eclipse.wst.validation.validationbuilder'
}
sourceSets {
test {
resources {
srcDirs = [
'src/test/resources',
'src/test/java'
]
}
}
}
// See http://www.gradle.org/docs/current/userguide/dependency_management.html#sub:configurations
// and http://www.gradle.org/docs/current/dsl/org.gradle.api.artifacts.ConfigurationContainer.html
configurations { jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
}
// dependencies that are common across all java projects
dependencies {
compile "org.slf4j:slf4j-log4j12:1.6.4"
testCompile "cglib:cglib-nodep:$cglibVersion"
testCompile "junit:junit-dep:$junitVersion"
testCompile "log4j:log4j:$log4jVersion"
testCompile "org.easymock:easymock:$easymockVersion"
testCompile "org.easymock:easymockclassextension:$easymockVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"
testCompile "org.springframework:spring-test:$springVersion"
jacoco group: "org.jacoco", name: "org.jacoco.agent", version: "0.5.3.201107060350", classifier: "runtime"
}
// enable all compiler warnings; individual projects may customize further
ext.xLintArg = '-Xlint:all'
[compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg]
test {
// suppress all console output during testing unless running `gradle -i`
logging.captureStandardOutput(LogLevel.INFO)
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.nanotrader.*"
// jvmArgs '-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
install {
repositories.mavenInstaller { customizePom(pom, subproject) }
}
}
task cleanDist(type: Delete) {
description "Deletes $rootDir/dist directory"
delete file("$rootDir/dist")
}
project('spring-nanotrader-chaos') {
description = 'Spring Nanotrader Chaos Utilities'
}
project('spring-nanotrader-service-support') {
description = 'Spring Nanotrader Data Service Support'
dependencies {
compile project(":spring-nanotrader-data")
compile "org.springframework.integration:spring-integration-amqp:$springIntegrationVersion"
compile "net.sf.dozer:dozer:$dozerVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
compile "joda-time:joda-time:1.6"
compile "com.gemstone.gemfire:gemfire:6.6.3"
compile "org.springframework.data:spring-data-gemfire:1.1.1.RELEASE"
compile "net.schmizz:sshj:0.8.1"
}
}
project('spring-nanotrader-data') {
description = 'Spring Nanotrader Data'
dependencies {
compile "org.springframework:spring-tx:$springVersion"
compile "org.aspectj:aspectjrt:$aspectjVersion"
compile "org.springframework:spring-aspects:$springVersion"
compile "org.springframework.integration:spring-integration-amqp:$springIntegrationVersion"
compile "org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final"
compile "org.springframework.data:spring-data-jpa:1.0.3.RELEASE"
compile "org.apache.commons:commons-lang3:$commonsLangVersion"
compile "javax.validation:validation-api:1.0.0.GA"
compile "org.hibernate:hibernate-validator:4.2.0.Final"
compile "commons-dbcp:commons-dbcp:1.3"
compile "org.hibernate:hibernate-core:3.6.8.Final"
compile "org.hibernate:hibernate-entitymanager:3.6.8.Final"
compile "postgresql:postgresql:9.0-801.jdbc3"
compile files("../lib/sqlfireclient-1.0.3.jar")
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
compile "com.h2database:h2:$h2Version"
}
}
project('tools') {
apply plugin: 'groovy'
repositories {
mavenCentral()
}
configurations {
compile
}
jar {
archiveName 'DataGenerator.zip'
fileMode 0755
into('libs') {
from configurations.compile
}
}
task release(idependsOn: assemble) << {
copy {
description "Copy artifacts to $rootDir/dist"
from file("build/libs")
into file("$rootDir/dist")
include '*.zip'
}
}
dependencies {
groovy localGroovy()
compile 'org.apache.commons:commons-lang3:3.1'
compile 'commons-beanutils:commons-beanutils-core:1.8.3'
compile 'commons-codec:commons-codec:1.4'
compile 'commons-collections:commons-collections:3.2.1'
compile 'commons-logging:commons-logging:1.1.1'
compile 'net.sf.ezmorph:ezmorph:1.0.6'
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.2'
compile 'org.apache.httpcomponents:httpclient:4.1.3'
compile 'org.apache.httpcomponents:httpcore:4.1.4'
compile 'net.sf.json-lib:json-lib:2.3:jdk15@jar'
compile 'net.sourceforge.nekohtml:nekohtml:1.9.15'
compile 'xerces:xercesImpl:2.10.0'
compile 'net.sf.opencsv:opencsv:2.0'
compile 'postgresql:postgresql:9.1-901.jdbc4'
compile 'org.apache.ant:ant:1.8.3'
compile files("../lib/sqlfireclient-1.0.3.jar")
}
}
project('spring-nanotrader-services') {
apply plugin: 'war'
description = 'Spring Nanotrader Services'
dependencies {
compile project(":spring-nanotrader-service-support")
compile project(":spring-nanotrader-chaos")
compile "org.springframework:spring-webmvc:$springVersion"
providedCompile ("javax.servlet:servlet-api:$servletApiVersion")
compile "com.jayway.jsonpath:json-path:0.8.1"
compile "cglib:cglib-nodep:$cglibVersion"
compile "org.springframework.security:spring-security-web:$springSecurityVersion"
compile "org.springframework.security:spring-security-config:$springSecurityVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:1.8.5"
compile "javax.inject:javax.inject:$javaxInjectVersion"
compile "net.sf.dozer:dozer:$dozerVersion"
testCompile "org.springframework:spring-test-mvc:1.0.0.BUILD-SNAPSHOT"
testCompile "org.hamcrest:hamcrest-all:1.1"
compile "org.aspectj:aspectjweaver:$aspectjVersion"
}
task release(dependsOn: assemble) << {
copy {
description "Copy artifacts to $rootDir/dist"
from war.archivePath
into file("$rootDir/dist")
}
}
}
project('spring-nanotrader-web') {
apply plugin: 'war'
description = 'Spring Nanotrader Web'
task tar(type: Tar) {
from 'src/main/webapp'
compression = Compression.GZIP
destinationDir = file("build/libs")
}
artifacts {
archives tar
}
task release(dependsOn: assemble) << {
copy {
description "Copy artifacts to $rootDir/dist"
from war.archivePath
from tar.archivePath
into file("$rootDir/dist")
}
}
}
project('spring-nanotrader-asynch-services') {
apply plugin: 'war'
description = 'Spring Nanotrader Asynch Services'
dependencies {
compile project(":spring-nanotrader-data")
compile project(":spring-nanotrader-service-support")
compile "org.springframework:spring-webmvc:$springVersion"
providedCompile ("javax.servlet:servlet-api:$servletApiVersion")
compile "com.jayway.jsonpath:json-path:0.8.1"
compile "cglib:cglib-nodep:$cglibVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:1.8.5"
compile "javax.inject:javax.inject:$javaxInjectVersion"
compile "net.sf.dozer:dozer:$dozerVersion"
testCompile "org.springframework:spring-test-mvc:1.0.0.BUILD-SNAPSHOT"
compile "org.aspectj:aspectjweaver:$aspectjVersion"
}
task release(dependsOn: assemble) << {
copy {
description "Copy artifacts to $rootDir/dist"
from war.archivePath
into file("$rootDir/dist")
}
}
}
apply plugin: 'docbook-reference'
reference { ext.sourceDir = file('src/reference/docbook') }
apply plugin: 'sonar'
sonar {
if (rootProject.hasProperty('sonarHostUrl')) {
server.url = rootProject.sonarHostUrl
}
database {
if (rootProject.hasProperty('sonarJdbcUrl')) {
url = rootProject.sonarJdbcUrl
}
if (rootProject.hasProperty('sonarJdbcDriver')) {
driverClassName = rootProject.sonarJdbcDriver
}
if (rootProject.hasProperty('sonarJdbcUsername')) {
username = rootProject.sonarJdbcUsername
}
if (rootProject.hasProperty('sonarJdbcPassword')) {
password = rootProject.sonarJdbcPassword
}
}
project {
dynamicAnalysis = "reuseReports"
withProjectProperties { props ->
props["sonar.core.codeCoveragePlugin"] = "jacoco"
props["sonar.jacoco.reportPath"] = "${buildDirName}/jacoco.exec"
}
}
logger.info("Sonar parameters used: server.url='${server.url}'; database.url='${database.url}'; database.driverClassName='${database.driverClassName}'; database.username='${database.username}'")
}
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'
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
destinationDir = new File(buildDir, "api")
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
}
task docsZip(type: Zip) {
group = 'Distribution'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference " +
"for deployment at static.springframework.org/spring-integration/docs."
from('src/dist') { include 'changelog.txt' }
from (api) { into 'api' }
from (reference) { into 'reference' }
}
task distZip(type: Zip, dependsOn: [docsZip]) {
group = 'Distribution'
classifier = 'dist'
description = "Builds -${classifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${project.name}-${project.version}";
from('src/dist') {
include 'readme.txt'
include 'license.txt'
include 'notice.txt'
into "${baseDir}"
}
from(zipTree(docsZip.archivePath)) { into "${baseDir}/docs" }
subprojects.each { subproject ->
into ("${baseDir}/libs") {
from subproject.jar
from subproject.sourcesJar
from subproject.javadocJar
}
}
}
artifacts {
archives distZip
archives docsZip
}
task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs distribution archives.'
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '1.0-rc-1-20120409112701+0200'
distributionUrl = 'http://services.gradle.org/distributions-snapshots/gradle-1.0-rc-1-20120409112701+0200-bin.zip'
jarFile = '.wrapper/gradle-wrapper.jar'
}
def customizePom(def pom, def gradleProject) {
pom.whenConfigured { generatedPom ->
// respect 'optional' and 'provided' dependencies
def deps = gradleProject.configurations.runtime.allDependencies
def optionalDeps = deps.findAll { dep ->
dep.asDynamicObject.hasProperty('optional') && dep.optional
}
def providedDeps = deps.findAll { dep ->
dep.asDynamicObject.hasProperty('provided') && dep.provided
}
generatedPom.dependencies.each { mavenDep ->
mavenDep.optional = optionalDeps.any { optionalDep ->
optionalDep.group == mavenDep.groupId &&
optionalDep.name == mavenDep.artifactId &&
optionalDep.version == mavenDep.version
}
boolean isProvided = providedDeps.any { providedDep ->
providedDep.group == mavenDep.groupId &&
providedDep.name == mavenDep.artifactId &&
providedDep.version == mavenDep.version
}
if (isProvided) {
mavenDep.scope = 'provided'
}
}
// eliminate test-scoped dependencies (no need in maven central poms)
generatedPom.dependencies.removeAll { dep ->
dep.scope == 'test'
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
url = 'https://github.com/SpringSource/spring-nanotrader'
organization {
name = 'SpringSource'
url = 'http://springsource.org'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url = 'https://github.com/SpringSource/nanotrader'
connection = 'scm:git:git://github.com/SpringSource/nanotrader'
developerConnection = 'scm:git:git://github.com/SpringSource/nanotrader'
}
developers {
developer {
id = 'dussab'
name = 'Brian Dussault'
email = 'bdussault@vmware.com'
}
developer {
id = 'garyrussell'
name = 'Gary Russell'
email = 'grussell@vmware.com'
}
}
}
}
}