| /* |
| * 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 { |
| // Required for Kafka. |
| maven { |
| url 'https://repository.apache.org/content/groups/public' |
| } |
| mavenCentral() |
| mavenLocal() |
| } |
| } |
| |
| apply from: file('gradle/license.gradle') |
| apply from: file('gradle/environment.gradle') |
| apply from: file("gradle/dependency-versions.gradle") |
| apply from: file("gradle/dependency-versions-scala-" + scalaVersion + ".gradle") |
| apply from: file("gradle/release.gradle") |
| |
| 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' |
| } |
| |
| project(':samza-api') { |
| apply plugin: 'java' |
| |
| dependencies { |
| testCompile "junit:junit:$junitVersion" |
| } |
| } |
| |
| project(":samza-core_$scalaVersion") { |
| apply plugin: 'scala' |
| |
| dependencies { |
| compile project(':samza-api') |
| compile "org.scala-lang:scala-library:$scalaLibVersion" |
| compile "org.clapper:grizzled-slf4j_$scalaVersion:$grizzledVersion" |
| compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion" |
| compile "org.codehaus.jackson:jackson-jaxrs:$jacksonVersion" |
| 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 "org.clapper:grizzled-slf4j_$scalaVersion:$grizzledVersion" |
| 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" |
| 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 = "4096m" |
| maxHeapSize = "4096m" |
| jvmArgs = ["-XX:+UseConcMarkSweepGC", "-server", "-d64"] |
| } |
| } |
| |
| 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.clapper:grizzled-slf4j_$scalaVersion:$grizzledVersion" |
| compile "org.codehaus.jackson:jackson-jaxrs:$jacksonVersion" |
| testCompile "junit:junit:$junitVersion" |
| } |
| } |
| |
| project(":samza-yarn_$scalaVersion") { |
| apply plugin: 'scala' |
| |
| 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.clapper:grizzled-slf4j_$scalaVersion:$grizzledVersion" |
| 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' |
| } |
| compile("org.apache.hadoop:hadoop-yarn-client:$yarnVersion") { |
| exclude module: 'slf4j-log4j12' |
| } |
| compile("org.apache.hadoop:hadoop-common:$yarnVersion") { |
| exclude module: 'slf4j-log4j12' |
| exclude module: 'servlet-api' |
| exclude module: 'jetty' |
| exclude module: 'jetty-util' |
| } |
| 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' |
| } |
| testCompile "junit:junit:$junitVersion" |
| } |
| |
| repositories { |
| maven { |
| url "http://repo.typesafe.com/typesafe/releases" |
| } |
| } |
| } |
| |
| 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"] |
| } |
| } |
| |
| project(":samza-kv_$scalaVersion") { |
| apply plugin: 'scala' |
| |
| dependencies { |
| compile project(':samza-api') |
| compile project(":samza-core_$scalaVersion") |
| compile "org.scala-lang:scala-library:$scalaLibVersion" |
| compile "org.clapper:grizzled-slf4j_$scalaVersion:$grizzledVersion" |
| compile "org.fusesource.leveldbjni:leveldbjni-all:$leveldbVersion" |
| testCompile "junit:junit:$junitVersion" |
| // Depend on samza-core's test classes so TestUtils can be used. |
| testCompile project(":samza-core_$scalaVersion").sourceSets.test.output |
| } |
| } |
| |
| 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_$scalaVersion") |
| compile project(":samza-core_$scalaVersion") |
| compile "org.scala-lang:scala-library:$scalaLibVersion" |
| compile "org.clapper:grizzled-slf4j_$scalaVersion:$grizzledVersion" |
| 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") |
| 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 = "4096m" |
| maxHeapSize = "4096m" |
| 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") } |
| } |
| } |
| |