blob: 364451afe3f479c1971ec759ee670b56e54bb616 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
buildscript {
repositories {
mavenCentral()
}
apply from: file('gradle/buildscript.gradle'), to: buildscript
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
}
}
apply from: file("gradle/dependency-versions.gradle")
apply from: file("gradle/dependency-versions-scala-" + scalaVersion + ".gradle")
apply from: file("gradle/release.gradle")
apply from: file("gradle/rat.gradle")
apply from: file('gradle/customize.gradle')
rat {
excludes = [
'**/.git/**',
'**/.gradle/**',
'**/.project',
'**/.settings',
'**/*.iml',
'**/*.iws',
'**/*.ipr',
'gradle/wrapper/**',
'.reviewboardrc',
'gradlew',
'README.md',
'RELEASE.md',
'**/.DS_Store/**',
'**/.gitignore',
'**/build/**',
'docs/Gemfile.lock',
'docs/sitemap.xml',
'docs/_site/**',
'samza-test/state/mystore/**',
'**/bootstrap.min.js',
'**/jquery-1.11.1.min.js',
'**/jquery.tablesorter.min.js',
'**/bootstrap.css.map',
'**/bootstrap.min.css',
'**/ropa-sans.css',
'**/font-awesome.min.css',
'**/syntax.css',
'**/non-responsive.less',
'**/*.graffle',
'**/*.otf',
'**/*.woff',
'**/*.eot',
'**/*.svg',
'**/*.ttf'
]
}
allprojects {
apply plugin: 'idea'
// For all scala compilation, add extra compiler options, taken from version-specific
// dependency-versions-scala file applied above.
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = [ scalaOptions ]
}
}
subprojects {
apply plugin: 'eclipse'
apply plugin: 'project-report'
tasks.withType(Test) {
test {
testLogging {
showStackTraces = true
showExceptions = true
showCauses = true
displayGranularity = maxGranularity
exceptionFormat = 'full'
}
}
}
}
project(':samza-api') {
apply plugin: 'java'
dependencies {
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"
}
}
project(":samza-core_$scalaVersion") {
apply plugin: 'scala'
jar {
manifest {
attributes("Implementation-Version": "$version")
}
}
dependencies {
compile project(':samza-api')
compile "org.scala-lang:scala-library:$scalaLibVersion"
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion"
compile "org.codehaus.jackson:jackson-jaxrs:$jacksonVersion"
// Temporary workaround to reduce config size via compression (SAMZA-337). Remove this
// once we figure out a clean way to do this.
compile "commons-codec:commons-codec:$commonsCodecVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"
testCompile "org.scalatest:scalatest_$scalaVersion:$scalaTestVersion"
}
}
project(":samza-kafka_$scalaVersion") {
apply plugin: 'scala'
configurations {
// Remove transitive dependencies from Zookeeper that we don't want.
compile.exclude group: 'javax.jms', module: 'jms'
compile.exclude group: 'com.sun.jdmk', module: 'jmxtools'
compile.exclude group: 'com.sun.jmx', module: 'jmxri'
}
dependencies {
compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
compile project(":samza-serializers_$scalaVersion")
compile "org.scala-lang:scala-library:$scalaLibVersion"
compile "com.101tec:zkclient:$zkClientVersion"
compile "org.apache.zookeeper:zookeeper:$zookeeperVersion"
compile "org.codehaus.jackson:jackson-jaxrs:$jacksonVersion"
compile "org.apache.kafka:kafka_$scalaVersion:$kafkaVersion"
compile "org.codehaus.jackson:jackson-jaxrs:$jacksonVersion"
testCompile "org.apache.kafka:kafka_$scalaVersion:$kafkaVersion:test"
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"
// Logging in tests is good.
testRuntime "org.slf4j:slf4j-simple:$slf4jVersion"
}
test {
// Bump up the heap so we can start ZooKeeper and Kafka brokers.
minHeapSize = "2560m"
maxHeapSize = "2560m"
jvmArgs = ["-XX:+UseConcMarkSweepGC", "-server", "-d64"]
}
}
project(':samza-log4j') {
apply plugin: 'java'
dependencies {
compile "log4j:log4j:$log4jVersion"
testCompile "junit:junit:$junitVersion"
}
}
project(":samza-serializers_$scalaVersion") {
apply plugin: 'scala'
dependencies {
compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
compile "org.scala-lang:scala-library:$scalaLibVersion"
compile "org.codehaus.jackson:jackson-jaxrs:$jacksonVersion"
testCompile "junit:junit:$junitVersion"
}
}
project(":samza-yarn_$scalaVersion") {
apply plugin: 'scala'
apply plugin: 'lesscss'
dependencies {
compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
compile "org.scala-lang:scala-library:$scalaLibVersion"
compile "org.scala-lang:scala-compiler:$scalaLibVersion"
compile "org.codehaus.jackson:jackson-jaxrs:$jacksonVersion"
compile "commons-httpclient:commons-httpclient:$commonsHttpClientVersion"
compile "org.eclipse.jetty:jetty-webapp:$jettyVersion"
compile("org.apache.hadoop:hadoop-yarn-api:$yarnVersion") {
exclude module: 'slf4j-log4j12'
}
compile("org.apache.hadoop:hadoop-yarn-common:$yarnVersion") {
exclude module: 'slf4j-log4j12'
exclude module: 'servlet-api'
}
compile("org.apache.hadoop:hadoop-yarn-client:$yarnVersion") {
exclude module: 'slf4j-log4j12'
exclude module: 'servlet-api'
}
compile("org.apache.hadoop:hadoop-common:$yarnVersion") {
exclude module: 'slf4j-log4j12'
exclude module: 'servlet-api'
}
compile("org.scalatra:scalatra_$scalaVersion:$scalatraVersion") {
exclude module: 'scala-compiler'
exclude module: 'slf4j-api'
}
compile("org.scalatra:scalatra-scalate_$scalaVersion:$scalatraVersion") {
exclude module: 'scala-compiler'
exclude module: 'slf4j-api'
}
compile "joda-time:joda-time:$jodaTimeVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"
}
repositories {
maven {
url "http://repo.typesafe.com/typesafe/releases"
}
}
lesscss {
source = fileTree('src/main/less') {
include 'main.less'
}
dest = "$buildDir/resources/main/scalate/css"
}
jar.dependsOn("lesscss")
}
project(":samza-shell") {
apply plugin: 'java'
configurations {
gradleShell
}
dependencies {
gradleShell project(":samza-core_$scalaVersion")
gradleShell project(":samza-kafka_$scalaVersion")
gradleShell project(":samza-test_$scalaVersion")
gradleShell project(":samza-yarn_$scalaVersion")
gradleShell "org.slf4j:slf4j-log4j12:$slf4jVersion"
gradleShell "log4j:log4j:1.2.16"
}
task shellTarGz(type: Tar) {
compression = Compression.GZIP
classifier = 'dist'
from 'src/main/bash'
from 'src/main/resources'
}
artifacts {
archives(shellTarGz) {
name 'samza-shell'
classifier 'dist'
}
}
// Usage: ./gradlew samza-shell:runJob \
// -PconfigPath=file:///path/to/job/config.properties
task runJob(type:JavaExec) {
main = 'org.apache.samza.job.JobRunner'
classpath = configurations.gradleShell
if (project.hasProperty('configPath')) args += ['--config-path', configPath]
jvmArgs = ["-Dlog4j.configuration=file:src/main/resources/log4j-console.xml"]
}
// Usage: ./gradlew samza-shell:checkpointTool \
// -PconfigPath=file:///path/to/job/config.properties -PnewOffsets=file:///path/to/new/offsets.properties
task checkpointTool(type:JavaExec) {
main = 'org.apache.samza.checkpoint.CheckpointTool'
classpath = configurations.gradleShell
if (project.hasProperty('configPath')) args += ['--config-path', configPath]
if (project.hasProperty('newOffsets')) args += ['--new-offsets', newOffsets]
jvmArgs = ["-Dlog4j.configuration=file:src/main/resources/log4j-console.xml"]
}
// Usage: ./gradlew samza-shell:kvPerformanceTest
// -PconfigPath=file:///path/to/job/config.properties
task kvPerformanceTest(type:JavaExec) {
main = 'org.apache.samza.test.performance.TestKeyValuePerformance'
classpath = configurations.gradleShell
if (project.hasProperty('configPath')) args += ['--config-path', configPath]
jvmArgs = ["-Dlog4j.configuration=file:src/main/resources/log4j-console.xml"]
}
// Usage: ./gradlew samza-shell:checkpointMigrationTool \
// -PconfigPath=file:///path/to/job/config.properties
task checkpointMigrationTool(type:JavaExec) {
main = 'org.apache.samza.util.CheckpointMigrationTool'
classpath = configurations.gradleShell
if (project.hasProperty('configPath')) args += ['--config-path', configPath]
if (project.hasProperty('configFactory')) args += ['--config-factory', configFactory]
jvmArgs = ["-Dlog4j.configuration=file:src/main/resources/log4j-console.xml"]
}
}
project(":samza-kv_$scalaVersion") {
apply plugin: 'scala'
dependencies {
compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
compile "org.scala-lang:scala-library:$scalaLibVersion"
testCompile "junit:junit:$junitVersion"
}
}
project(":samza-kv-inmemory_$scalaVersion") {
apply plugin: 'scala'
dependencies {
compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
compile project(":samza-kv_$scalaVersion")
compile "org.scala-lang:scala-library:$scalaLibVersion"
compile "com.google.guava:guava:$guavaVersion"
testCompile "junit:junit:$junitVersion"
}
}
project(":samza-kv-leveldb_$scalaVersion") {
apply plugin: 'scala'
dependencies {
compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
compile project(":samza-kv_$scalaVersion")
compile "org.scala-lang:scala-library:$scalaLibVersion"
compile "org.fusesource.leveldbjni:leveldbjni-all:$leveldbVersion"
testCompile "junit:junit:$junitVersion"
}
}
project(":samza-kv-rocksdb_$scalaVersion") {
apply plugin: 'scala'
dependencies {
compile project(':samza-api')
compile project(":samza-core_$scalaVersion")
compile project(":samza-kv_$scalaVersion")
compile "org.scala-lang:scala-library:$scalaLibVersion"
compile "org.rocksdb:rocksdbjni:$rocksdbVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.scalatest:scalatest_$scalaVersion:$scalaTestVersion"
}
}
project(":samza-test_$scalaVersion") {
apply plugin: 'scala'
configurations {
// Remove transitive dependencies from Zookeeper that we don't want.
compile.exclude group: 'javax.jms', module: 'jms'
compile.exclude group: 'com.sun.jdmk', module: 'jmxtools'
compile.exclude group: 'com.sun.jmx', module: 'jmxri'
}
dependencies {
compile project(':samza-api')
compile project(":samza-kv-inmemory_$scalaVersion")
compile project(":samza-kv-leveldb_$scalaVersion")
compile project(":samza-kv-rocksdb_$scalaVersion")
compile project(":samza-core_$scalaVersion")
compile "org.scala-lang:scala-library:$scalaLibVersion"
compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion"
compile "javax.mail:mail:1.4"
compile "junit:junit:$junitVersion"
compile "org.apache.kafka:kafka_$scalaVersion:$kafkaVersion"
testCompile "org.apache.kafka:kafka_$scalaVersion:$kafkaVersion:test"
testCompile "com.101tec:zkclient:$zkClientVersion"
testCompile project(":samza-kafka_$scalaVersion")
testCompile "org.scalatest:scalatest_$scalaVersion:$scalaTestVersion"
testRuntime "org.slf4j:slf4j-simple:$slf4jVersion"
}
test {
// Bump up the heap so we can start ZooKeeper and Kafka brokers. Also
// required for TestSamzaContainerPerformance when a high thread count
// with a lot of inputs is used.
minHeapSize = "2560m"
maxHeapSize = "2560m"
jvmArgs = ["-XX:+UseConcMarkSweepGC", "-server", "-d64"]
// Forward all samza.* system properties to test subprocesses. This is
// useful for configuring TestSamzaContainerPerformance from the CLI.
systemProperties = System.properties.findAll { it.key.startsWith("samza") }
}
}