blob: 4639a8a3346a2a1af4e0086e812720aa99524c0f [file] [log] [blame]
/*
* Copyright 2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* The Apache Incubator S4 Project Build File
*
*/
description = 'Apache S4'
defaultTasks 'assemble'
project.ext["archivesBaseName"] = 's4'
project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
allprojects {
// Append the suffix 'SNAPSHOT' when the build is not for release.
version = new Version(major: 0, minor: 5, bugfix: 0, isRelease: false)
group = 'org.apache.s4'
/* Search these repos to find artifacts. Gradle will download and cache. */
repositories {
mavenLocal()
mavenCentral()
mavenRepo name: "gson", url: "http://google-gson.googlecode.com/svn/mavenrepo"
/* Add lib dir as a repo. Some jar files that are not available
in a public repo are distributed in the lib dir. */
flatDir name: 'libDir', dirs: "$rootDir/lib"
}
}
/* All project libraries must be defined here. */
project.ext["libraries"] = [
json: 'org.json:json:20090211',
guava: 'com.google.guava:guava:10.0.1',
gson: 'com.google.code.gson:gson:1.6',
guice: 'com.google.inject:guice:3.0',
guice_assist: 'com.google.inject.extensions:guice-assistedinject:3.0',
guice_grapher: 'com.google.inject:guice-grapher:3.0',
flexjson: 'net.sf.flexjson:flexjson:2.1',
bcel: 'org.apache.bcel:bcel:5.2',
jakarta_regexp: 'jakarta-regexp:jakarta-regexp:1.4',
kryo: 'com.googlecode:kryo:1.04',
netty: 'org.jboss.netty:netty:3.2.5.Final',
reflectasm: 'com.esotericsoftware:reflectasm:0.8',
minlog: 'com.esotericsoftware:minlog:1.2',
asm: 'asm:asm:3.2',
commons_io: 'commons-io:commons-io:2.0.1',
commons_config: 'commons-configuration:commons-configuration:1.6',
commons_codec: 'commons-codec:commons-codec:1.4',
commons_httpclient: 'commons-httpclient:commons-httpclient:3.1',
commons_coll: 'net.sourceforge.collections:collections-generic:4.01', // Use this lib until the commons collection with Generics is released.
slf4j: 'org.slf4j:slf4j-api:1.6.1',
logback_core: 'ch.qos.logback:logback-core:0.9.29',
logback_classic: 'ch.qos.logback:logback-classic:0.9.29',
ejml: 'com.googlecode.efficient-java-matrix-library:ejml:0.17',
zk: 'org.apache.zookeeper:zookeeper:3.3.1',
jcip: 'net.jcip:jcip-annotations:1.0',
junit: 'junit:junit:4.10',
zkclient: 'com.github.sgroschupf:zkclient:0.1',
diezel: 'net.ericaro:diezel-maven-plugin:1.0.0-beta-4',
jcommander: 'com.beust:jcommander:1.25',
commons_io: 'commons-io:commons-io:2.1',
gradle_base_services: 'gradle-base-services:gradle-base-services:1.0-rc-3',
gradle_core: 'gradle-core:gradle-core:1.0-rc-3',
gradle_tooling_api: 'gradle-tooling-api:gradle-tooling-api:1.0-rc-3',
gradle_wrapper: 'gradle-wrapper:gradle-wrapper:1.0-rc-3'
]
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
// apply plugin: 'checkstyle'
/* Set Java version. */
sourceCompatibility = 1.6
targetCompatibility = 1.6
project.ext["checkstyleConfigFileName"] = "$rootDir/config/checkstyle/s4-checkstyle.xml"
configurations.all {
exclude group: 'com.sun.jdmk', module: 'jmxtools'
exclude group: 'com.sun.jmx', module: 'jmxri'
exclude group: 'javax.jms', module: 'jms'
}
dependencies {
/* Google. */
compile( libraries.guava )
compile( libraries.guice )
compile (libraries.guice_assist)
/* Logging. */
compile( libraries.slf4j )
compile( libraries.logback_core )
compile( libraries.logback_classic )
/* Commons. */
compile( libraries.commons_io )
compile( libraries.commons_config )
compile( libraries.commons_coll )
/* Misc. */
compile( libraries.jcip )
compile( libraries.zk )
// // added here since from 1.0 dependencies don't seem to
// // be copied in through the application plugin (s4-tools)
// compile libraries.jcommander
// compile libraries.zkclient
// compile libraries.commons_io
// compile libraries.gradle_base_services
// compile libraries.gradle_core
// compile libraries.gradle_tooling_api
// compile libraries.gradle_wrapper
//
/* Testing. */
testCompile( libraries.junit )
}
manifest.mainAttributes(
provider: 'gradle',
'Implementation-Url': 'http://incubator.apache.org/projects/s4.html',
'Implementation-Version': version,
'Implementation-Vendor': 'Apache S4',
'Implementation-Vendor-Id': 'io.s4'
)
}
evaluationDependsOnChildren()
project.ext["platformProjects"] = [project(':s4-base'), project(':s4-core'), project(':s4-comm'), project(':s4-tools')]
configurations {
platformLibs
}
dependencies {
platformLibs platformProjects
}
//task xxx {
// platformProjects.collect {proj ->
// // Iterate over the source sets
// println '\n' + proj.name + ' ' + proj.sourceSets.main.name
// println proj.sourceSets.main.classesDir
// println proj.sourceSets.main.runtimeClasspath.getFiles()
// println proj.sourceSets.main.resources.getFiles()
// println proj.sourceSets.main.allJava.getFiles()
// println proj.configurations.runtime.getFiles()
// println ' '
// println proj.configurations.archives.allArtifactFiles.getFiles()
// }
//}
project.ext["binDistImage"] = copySpec {
platformProjects.collect {proj ->
into ("platform/lib") {
from proj.sourceSets.main.resources
from proj.configurations.runtime.getFiles()
from proj.configurations.archives.allArtifacts.files
}
}
}
task binImage(type: Copy) {
description = "Create binary image"
destinationDir = file("$buildDir/s4-image")
with binDistImage
}
task clean << {
delete buildDir
}
// This task lists all the jars. We can use this pattern to create file descriptors.
task listJars << {
description = 'List all the jars in the S4 framework.'
configurations.platformLibs.each { File file -> println file.name }
}
/* Generates the gradlew scripts.
http://www.gradle.org/1.0-milestone-3/docs/userguide/gradle_wrapper.html */
task wrapper(type: Wrapper) {
gradleVersion = '1.0-rc-3'
jarFile='lib/gradle-wrapper-1.0-rc-3.jar'
}
class Version {
int major
int minor
int bugfix
boolean isRelease
String toString() {
"$major.$minor.$bugfix${isRelease ? '' : '-SNAPSHOT'}"
}
}