mirror of https://github.com/apache/kafka.git
KAFKA-1254 remove vestigial sbt patch by Joe Stein; reviewed by Jun Rao
This commit is contained in:
parent
11f3975930
commit
fbb3525ce8
31
LICENSE
31
LICENSE
|
@ -200,34 +200,3 @@
|
|||
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.
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
SBT LICENSE
|
||||
|
||||
Copyright (c) 2008, 2009, 2010 Mark Harrah, Jason Zaugg
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-----------------------------------------------------------------------
|
|
@ -1,60 +0,0 @@
|
|||
# Apache Kafka #
|
||||
|
||||
See our [web site](http://kafka.apache.org) for details on the project.
|
||||
|
||||
## Building it ##
|
||||
1. ./sbt update
|
||||
2. ./sbt package
|
||||
3. ./sbt assembly-package-dependency
|
||||
|
||||
To build for a particular version of Scala (either 2.8.0, 2.8.2, 2.9.1, 2.9.2 or 2.10.1), change step 2 above to:
|
||||
2. ./sbt "++2.8.0 package"
|
||||
|
||||
To build for all supported versions of Scala, change step 2 above to:
|
||||
2. ./sbt +package
|
||||
|
||||
## Running it ##
|
||||
Follow instuctions in http://kafka.apache.org/documentation.html#quickstart
|
||||
|
||||
## Running unit tests ##
|
||||
./sbt test
|
||||
|
||||
## Building a binary release zip or gzipped tar ball ##
|
||||
./sbt release-zip
|
||||
./sbt release-tar
|
||||
The release file can be found inside ./target/RELEASE/.
|
||||
|
||||
## Other Build Tips ##
|
||||
Here are some useful sbt commands, to be executed at the sbt command prompt (./sbt). Prefixing with "++<version> " runs the
|
||||
command for a specific Scala version, prefixing with "+" will perform the action for all versions of Scala, and no prefix
|
||||
runs the command for the default (2.8.0) version of Scala. -
|
||||
|
||||
tasks : Lists all the sbt commands and their descriptions
|
||||
clean : Deletes all generated files (the target directory).
|
||||
compile : Compile all the sub projects, but not create the jars
|
||||
test : Run all unit tests in all sub projects
|
||||
release-zip : Create all the jars, run unit tests and create a deployable release zip
|
||||
release-tar : Create all the jars, run unit tests and create a deployable release gzipped tar tall
|
||||
package: Creates jars for src, test, docs etc
|
||||
projects : List all the sub projects
|
||||
project sub_project_name : Switch to a particular sub-project. For example, to switch to the core kafka code, use "project core-kafka"
|
||||
|
||||
The following commands can be run only on a particular sub project -
|
||||
test-only package.test.TestName : Runs only the specified test in the current sub project
|
||||
run : Provides options to run any of the classes that have a main method. For example, you can switch to project java-examples, and run the examples there by executing "project java-examples" followed by "run"
|
||||
|
||||
For more details please see the [SBT documentation](https://github.com/harrah/xsbt/wiki)
|
||||
|
||||
## Contribution ##
|
||||
|
||||
Kafka is a new project, and we are interested in building the community; we would welcome any thoughts or [patches](https://issues.apache.org/jira/browse/KAFKA). You can reach us [on the Apache mailing lists](http://kafka.apache.org/contact.html).
|
||||
|
||||
To contribute follow the instructions here:
|
||||
* http://kafka.apache.org/contributing.html
|
||||
|
||||
We also welcome patches for the website and documentation which can be found here:
|
||||
* https://svn.apache.org/repos/asf/kafka/site
|
||||
|
||||
|
||||
|
||||
|
|
@ -32,13 +32,6 @@ if [ -z "$SCALA_VERSION" ]; then
|
|||
SCALA_VERSION=2.8.0
|
||||
fi
|
||||
|
||||
# TODO: remove when removing sbt
|
||||
# assume all dependencies have been packaged into one jar with sbt-assembly's task "assembly-package-dependency"
|
||||
for file in $base_dir/core/target/scala-${SCALA_VERSION}/*.jar;
|
||||
do
|
||||
CLASSPATH=$CLASSPATH:$file
|
||||
done
|
||||
|
||||
# run ./gradlew copyDependantLibs to get all dependant jars in a local dir
|
||||
for file in $base_dir/core/build/dependant-libs-${SCALA_VERSION}/*.jar;
|
||||
do
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
import AssemblyKeys._
|
||||
|
||||
name := "clients"
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"com.novocode" % "junit-interface" % "0.9" % "test"
|
||||
)
|
||||
|
||||
assemblySettings
|
|
@ -1 +0,0 @@
|
|||
crossPaths := false
|
|
@ -1 +0,0 @@
|
|||
crossPaths := false
|
|
@ -1,32 +0,0 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
import AssemblyKeys._
|
||||
|
||||
name := "kafka"
|
||||
|
||||
resolvers ++= Seq(
|
||||
"SonaType ScalaTest repo" at "https://oss.sonatype.org/content/groups/public/org/scalatest/"
|
||||
)
|
||||
|
||||
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _ )
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"org.apache.zookeeper" % "zookeeper" % "3.3.4",
|
||||
"com.101tec" % "zkclient" % "0.3",
|
||||
"org.xerial.snappy" % "snappy-java" % "1.0.5",
|
||||
"com.yammer.metrics" % "metrics-core" % "2.2.0",
|
||||
"com.yammer.metrics" % "metrics-annotation" % "2.2.0",
|
||||
"org.easymock" % "easymock" % "3.0" % "test",
|
||||
"junit" % "junit" % "4.1" % "test"
|
||||
)
|
||||
|
||||
libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) =>
|
||||
deps :+ (sv match {
|
||||
case "2.8.0" => "org.scalatest" % "scalatest" % "1.2" % "test"
|
||||
case v if v.startsWith("2.10") => "org.scalatest" %% "scalatest" % "1.9.1" % "test"
|
||||
case _ => "org.scalatest" %% "scalatest" % "1.8" % "test"
|
||||
})
|
||||
}
|
||||
|
||||
assemblySettings
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
name := "kafka-java-examples"
|
||||
|
||||
crossPaths := false
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
name := "kafka-perf"
|
|
@ -1,152 +0,0 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import sbt._
|
||||
import Keys._
|
||||
import Process._
|
||||
|
||||
import scala.xml.{Node, Elem}
|
||||
import scala.xml.transform.{RewriteRule, RuleTransformer}
|
||||
|
||||
object KafkaBuild extends Build {
|
||||
val buildNumber = SettingKey[String]("build-number", "Build number defaults to $BUILD_NUMBER environment variable")
|
||||
val releaseName = SettingKey[String]("release-name", "the full name of this release")
|
||||
val commonSettings = Seq(
|
||||
organization := "org.apache.kafka",
|
||||
pomExtra :=
|
||||
<parent>
|
||||
<groupId>org.apache</groupId>
|
||||
<artifactId>apache</artifactId>
|
||||
<version>10</version>
|
||||
</parent>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache 2</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>,
|
||||
scalacOptions ++= Seq("-deprecation", "-unchecked", "-g:none"),
|
||||
crossScalaVersions := Seq("2.8.0","2.8.2", "2.9.1", "2.9.2", "2.10.1"),
|
||||
excludeFilter in unmanagedSources <<= scalaVersion(v => if (v.startsWith("2.8")) "*_2.9+.scala" else "*_2.8.scala"),
|
||||
scalaVersion := "2.8.0",
|
||||
version := "0.8.1",
|
||||
publishTo := Some("Apache Maven Repo" at "https://repository.apache.org/service/local/staging/deploy/maven2"),
|
||||
credentials += Credentials(Path.userHome / ".m2" / ".credentials"),
|
||||
buildNumber := System.getProperty("build.number", ""),
|
||||
version <<= (buildNumber, version) { (build, version) => if (build == "") version else version + "+" + build},
|
||||
releaseName <<= (name, version, scalaVersion) {(name, version, scalaVersion) => name + "_" + scalaVersion + "-" + version},
|
||||
javacOptions in compile ++= Seq("-Xlint:unchecked", "-source", "1.5"),
|
||||
javacOptions in doc ++= Seq("-source", "1.5"),
|
||||
parallelExecution in Test := false, // Prevent tests from overrunning each other
|
||||
publishArtifact in Test := true,
|
||||
libraryDependencies ++= Seq(
|
||||
"log4j" % "log4j" % "1.2.15" exclude("javax.jms", "jms"),
|
||||
"net.sf.jopt-simple" % "jopt-simple" % "3.2",
|
||||
"org.slf4j" % "slf4j-simple" % "1.6.4"
|
||||
),
|
||||
// The issue is going from log4j 1.2.14 to 1.2.15, the developers added some features which required
|
||||
// some dependencies on various sun and javax packages.
|
||||
ivyXML := <dependencies>
|
||||
<exclude module="javax"/>
|
||||
<exclude module="jmxri"/>
|
||||
<exclude module="jmxtools"/>
|
||||
<exclude module="mail"/>
|
||||
<exclude module="jms"/>
|
||||
<dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.4">
|
||||
<exclude org="log4j" module="log4j"/>
|
||||
<exclude org="jline" module="jline"/>
|
||||
</dependency>
|
||||
</dependencies>,
|
||||
mappings in packageBin in Compile += file("LICENSE") -> "LICENSE",
|
||||
mappings in packageBin in Compile += file("NOTICE") -> "NOTICE"
|
||||
)
|
||||
|
||||
val hadoopSettings = Seq(
|
||||
javacOptions in compile ++= Seq("-Xlint:deprecation"),
|
||||
libraryDependencies ++= Seq(
|
||||
"org.apache.avro" % "avro" % "1.4.0",
|
||||
"org.apache.pig" % "pig" % "0.8.0",
|
||||
"commons-logging" % "commons-logging" % "1.0.4",
|
||||
"org.codehaus.jackson" % "jackson-core-asl" % "1.5.5",
|
||||
"org.codehaus.jackson" % "jackson-mapper-asl" % "1.5.5",
|
||||
"org.apache.hadoop" % "hadoop-core" % "0.20.2"
|
||||
),
|
||||
ivyXML :=
|
||||
<dependencies>
|
||||
<exclude module="netty"/>
|
||||
<exclude module="javax"/>
|
||||
<exclude module="jmxri"/>
|
||||
<exclude module="jmxtools"/>
|
||||
<exclude module="mail"/>
|
||||
<exclude module="jms"/>
|
||||
<dependency org="org.apache.hadoop" name="hadoop-core" rev="0.20.2">
|
||||
<exclude org="junit" module="junit"/>
|
||||
</dependency>
|
||||
<dependency org="org.apache.pig" name="pig" rev="0.8.0">
|
||||
<exclude org="junit" module="junit"/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
)
|
||||
|
||||
|
||||
val runRat = TaskKey[Unit]("run-rat-task", "Runs Apache rat on Kafka")
|
||||
val runRatTask = runRat := {
|
||||
"bin/run-rat.sh" !
|
||||
}
|
||||
|
||||
val release = TaskKey[Unit]("release", "Creates a deployable release directory file with dependencies, config, and scripts.")
|
||||
val releaseTask = release <<= ( packageBin in (core, Compile), dependencyClasspath in (core, Runtime), exportedProducts in Compile,
|
||||
target, releaseName in core ) map { (packageBin, deps, products, target, releaseName) =>
|
||||
val jarFiles = deps.files.filter(f => !products.files.contains(f) && f.getName.endsWith(".jar"))
|
||||
val destination = target / "RELEASE" / releaseName
|
||||
IO.copyFile(packageBin, destination / packageBin.getName)
|
||||
IO.copyFile(file("LICENSE"), destination / "LICENSE")
|
||||
IO.copyFile(file("NOTICE"), destination / "NOTICE")
|
||||
IO.copy(jarFiles.map { f => (f, destination / "libs" / f.getName) })
|
||||
IO.copyDirectory(file("config"), destination / "config")
|
||||
IO.copyDirectory(file("bin"), destination / "bin")
|
||||
for {file <- (destination / "bin").listFiles} { file.setExecutable(true, true) }
|
||||
}
|
||||
|
||||
val releaseZip = TaskKey[Unit]("release-zip", "Creates a deployable zip file with dependencies, config, and scripts.")
|
||||
val releaseZipTask = releaseZip <<= (release, target, releaseName in core) map { (release, target, releaseName) =>
|
||||
val zipPath = target / "RELEASE" / "%s.zip".format(releaseName)
|
||||
IO.delete(zipPath)
|
||||
IO.zip((target/"RELEASE" ** releaseName ***) x relativeTo(target/"RELEASE"), zipPath)
|
||||
}
|
||||
|
||||
val releaseTar = TaskKey[Unit]("release-tar", "Creates a deployable tar.gz file with dependencies, config, and scripts.")
|
||||
val releaseTarTask = releaseTar <<= ( release, target, releaseName in core) map { (release, target, releaseName) =>
|
||||
Process(Seq("tar", "czf", "%s.tar.gz".format(releaseName), releaseName), target / "RELEASE").! match {
|
||||
case 0 => ()
|
||||
case n => sys.error("Failed to run native tar application!")
|
||||
}
|
||||
}
|
||||
|
||||
lazy val kafka = Project(id = "Kafka", base = file(".")).aggregate(core, examples, contrib, perf).settings((commonSettings ++
|
||||
runRatTask ++ releaseTask ++ releaseZipTask ++ releaseTarTask): _*)
|
||||
lazy val core = Project(id = "core", base = file("core")).settings(commonSettings: _*)
|
||||
lazy val examples = Project(id = "java-examples", base = file("examples")).settings(commonSettings :_*) dependsOn (core)
|
||||
lazy val perf = Project(id = "perf", base = file("perf")).settings((Seq(name := "kafka-perf") ++ commonSettings):_*) dependsOn (core)
|
||||
|
||||
lazy val contrib = Project(id = "contrib", base = file("contrib")).aggregate(hadoopProducer, hadoopConsumer).settings(commonSettings :_*)
|
||||
lazy val hadoopProducer = Project(id = "hadoop-producer", base = file("contrib/hadoop-producer")).settings(hadoopSettings ++ commonSettings: _*) dependsOn (core)
|
||||
lazy val hadoopConsumer = Project(id = "hadoop-consumer", base = file("contrib/hadoop-consumer")).settings(hadoopSettings ++ commonSettings: _*) dependsOn (core)
|
||||
lazy val clients = Project(id = "kafka-clients", base = file("clients"))
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
# 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.
|
||||
#Project properties
|
||||
#Mon Feb 28 11:55:49 PST 2011
|
||||
sbt.version=0.12.1
|
|
@ -1,251 +0,0 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import sbt._
|
||||
import scala.xml.{Node, Elem}
|
||||
import scala.xml.transform.{RewriteRule, RuleTransformer}
|
||||
|
||||
class KafkaProject(info: ProjectInfo) extends ParentProject(info) with IdeaProject {
|
||||
override def managedStyle = ManagedStyle.Maven
|
||||
val publishTo = "Maven Repo" at "http://maven/content/repositories/repository.snapshots"
|
||||
Credentials(Path.userHome / ".m2" / ".credentials", log)
|
||||
|
||||
lazy val core = project("core", "core-kafka", new CoreKafkaProject(_))
|
||||
lazy val examples = project("examples", "java-examples", new KafkaExamplesProject(_), core)
|
||||
lazy val contrib = project("contrib", "contrib", new ContribProject(_))
|
||||
lazy val perf = project("perf", "perf", new KafkaPerfProject(_))
|
||||
|
||||
lazy val releaseZipTask = core.packageDistTask
|
||||
|
||||
val releaseZipDescription = "Compiles every sub project, runs unit tests, creates a deployable release zip file with dependencies, config, and scripts."
|
||||
lazy val releaseZip = releaseZipTask dependsOn(core.corePackageAction, core.test, examples.examplesPackageAction,
|
||||
contrib.producerPackageAction, contrib.consumerPackageAction) describedAs releaseZipDescription
|
||||
|
||||
val runRatDescription = "Runs Apache rat on Kafka"
|
||||
lazy val runRatTask = task {
|
||||
Runtime.getRuntime().exec("bin/run-rat.sh")
|
||||
None
|
||||
} describedAs runRatDescription
|
||||
|
||||
val rat = "org.apache.rat" % "apache-rat" % "0.8"
|
||||
|
||||
class CoreKafkaProject(info: ProjectInfo) extends DefaultProject(info)
|
||||
with IdeaProject with CoreDependencies with TestDependencies with CompressionDependencies {
|
||||
val corePackageAction = packageAllAction
|
||||
|
||||
//The issue is going from log4j 1.2.14 to 1.2.15, the developers added some features which required
|
||||
// some dependencies on various sun and javax packages.
|
||||
override def ivyXML =
|
||||
<dependencies>
|
||||
<exclude module="javax"/>
|
||||
<exclude module="jmxri"/>
|
||||
<exclude module="jmxtools"/>
|
||||
<exclude module="mail"/>
|
||||
<exclude module="jms"/>
|
||||
<dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.4">
|
||||
<exclude module="log4j"/>
|
||||
<exclude module="jline"/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
override def organization = "org.apache"
|
||||
override def filterScalaJars = false
|
||||
|
||||
// build the executable jar's classpath.
|
||||
// (why is it necessary to explicitly remove the target/{classes,resources} paths? hm.)
|
||||
def dependentJars = {
|
||||
val jars =
|
||||
publicClasspath +++ mainDependencies.scalaJars --- mainCompilePath --- mainResourcesOutputPath
|
||||
if (jars.get.find { jar => jar.name.startsWith("scala-library-") }.isDefined) {
|
||||
// workaround bug in sbt: if the compiler is explicitly included, don't include 2 versions
|
||||
// of the library.
|
||||
jars --- jars.filter { jar =>
|
||||
jar.absolutePath.contains("/boot/") && jar.name == "scala-library.jar"
|
||||
}
|
||||
} else {
|
||||
jars
|
||||
}
|
||||
}
|
||||
|
||||
def dependentJarNames = dependentJars.getFiles.map(_.getName).filter(_.endsWith(".jar"))
|
||||
override def manifestClassPath = Some(dependentJarNames.map { "libs/" + _ }.mkString(" "))
|
||||
|
||||
def distName = (artifactID + "-" + projectVersion.value)
|
||||
def distPath = "dist" / distName ##
|
||||
|
||||
def configPath = "config" ##
|
||||
def configOutputPath = distPath / "config"
|
||||
|
||||
def binPath = "bin" ##
|
||||
def binOutputPath = distPath / "bin"
|
||||
|
||||
def distZipName = {
|
||||
"%s-%s.zip".format(artifactID, projectVersion.value)
|
||||
}
|
||||
|
||||
lazy val packageDistTask = task {
|
||||
distPath.asFile.mkdirs()
|
||||
(distPath / "libs").asFile.mkdirs()
|
||||
binOutputPath.asFile.mkdirs()
|
||||
configOutputPath.asFile.mkdirs()
|
||||
|
||||
FileUtilities.copyFlat(List(jarPath), distPath, log).left.toOption orElse
|
||||
FileUtilities.copyFlat(dependentJars.get, distPath / "libs", log).left.toOption orElse
|
||||
FileUtilities.copy((configPath ***).get, configOutputPath, log).left.toOption orElse
|
||||
FileUtilities.copy((binPath ***).get, binOutputPath, log).left.toOption orElse
|
||||
FileUtilities.zip((("dist" / distName) ##).get, "dist" / distZipName, true, log)
|
||||
None
|
||||
}
|
||||
|
||||
val PackageDistDescription = "Creates a deployable zip file with dependencies, config, and scripts."
|
||||
lazy val packageDist = packageDistTask dependsOn(`package`, `test`) describedAs PackageDistDescription
|
||||
|
||||
val cleanDist = cleanTask("dist" ##) describedAs("Erase any packaged distributions.")
|
||||
override def cleanAction = super.cleanAction dependsOn(cleanDist)
|
||||
|
||||
override def javaCompileOptions = super.javaCompileOptions ++
|
||||
List(JavaCompileOption("-source"), JavaCompileOption("1.5"))
|
||||
|
||||
override def packageAction = super.packageAction dependsOn (testCompileAction, packageTestAction)
|
||||
|
||||
}
|
||||
|
||||
class KafkaPerfProject(info: ProjectInfo) extends DefaultProject(info)
|
||||
with IdeaProject
|
||||
with CoreDependencies {
|
||||
val perfPackageAction = packageAllAction
|
||||
val dependsOnCore = core
|
||||
|
||||
//The issue is going from log4j 1.2.14 to 1.2.15, the developers added some features which required
|
||||
// some dependencies on various sun and javax packages.
|
||||
override def ivyXML =
|
||||
<dependencies>
|
||||
<exclude module="javax"/>
|
||||
<exclude module="jmxri"/>
|
||||
<exclude module="jmxtools"/>
|
||||
<exclude module="mail"/>
|
||||
<exclude module="jms"/>
|
||||
</dependencies>
|
||||
|
||||
override def artifactID = "kafka-perf"
|
||||
override def filterScalaJars = false
|
||||
override def javaCompileOptions = super.javaCompileOptions ++
|
||||
List(JavaCompileOption("-Xlint:unchecked"))
|
||||
}
|
||||
|
||||
class KafkaExamplesProject(info: ProjectInfo) extends DefaultProject(info)
|
||||
with IdeaProject
|
||||
with CoreDependencies {
|
||||
val examplesPackageAction = packageAllAction
|
||||
val dependsOnCore = core
|
||||
//The issue is going from log4j 1.2.14 to 1.2.15, the developers added some features which required
|
||||
// some dependencies on various sun and javax packages.
|
||||
override def ivyXML =
|
||||
<dependencies>
|
||||
<exclude module="javax"/>
|
||||
<exclude module="jmxri"/>
|
||||
<exclude module="jmxtools"/>
|
||||
<exclude module="mail"/>
|
||||
<exclude module="jms"/>
|
||||
</dependencies>
|
||||
|
||||
override def artifactID = "kafka-java-examples"
|
||||
override def filterScalaJars = false
|
||||
override def javaCompileOptions = super.javaCompileOptions ++
|
||||
List(JavaCompileOption("-Xlint:unchecked"))
|
||||
}
|
||||
|
||||
class ContribProject(info: ProjectInfo) extends ParentProject(info) with IdeaProject {
|
||||
lazy val hadoopProducer = project("hadoop-producer", "hadoop producer",
|
||||
new HadoopProducerProject(_), core)
|
||||
lazy val hadoopConsumer = project("hadoop-consumer", "hadoop consumer",
|
||||
new HadoopConsumerProject(_), core)
|
||||
|
||||
val producerPackageAction = hadoopProducer.producerPackageAction
|
||||
val consumerPackageAction = hadoopConsumer.consumerPackageAction
|
||||
|
||||
class HadoopProducerProject(info: ProjectInfo) extends DefaultProject(info)
|
||||
with IdeaProject
|
||||
with CoreDependencies with HadoopDependencies {
|
||||
val producerPackageAction = packageAllAction
|
||||
override def ivyXML =
|
||||
<dependencies>
|
||||
<exclude module="netty"/>
|
||||
<exclude module="javax"/>
|
||||
<exclude module="jmxri"/>
|
||||
<exclude module="jmxtools"/>
|
||||
<exclude module="mail"/>
|
||||
<exclude module="jms"/>
|
||||
<dependency org="org.apache.hadoop" name="hadoop-core" rev="0.20.2">
|
||||
<exclude module="junit"/>
|
||||
</dependency>
|
||||
<dependency org="org.apache.pig" name="pig" rev="0.10.0">
|
||||
<exclude module="junit"/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
}
|
||||
|
||||
class HadoopConsumerProject(info: ProjectInfo) extends DefaultProject(info)
|
||||
with IdeaProject
|
||||
with CoreDependencies {
|
||||
val consumerPackageAction = packageAllAction
|
||||
override def ivyXML =
|
||||
<dependencies>
|
||||
<exclude module="netty"/>
|
||||
<exclude module="javax"/>
|
||||
<exclude module="jmxri"/>
|
||||
<exclude module="jmxtools"/>
|
||||
<exclude module="mail"/>
|
||||
<exclude module="jms"/>
|
||||
<exclude module=""/>
|
||||
<dependency org="org.apache.hadoop" name="hadoop-core" rev="0.20.2">
|
||||
<exclude module="junit"/>
|
||||
</dependency>
|
||||
<dependency org="org.apache.pig" name="pig" rev="0.8.0">
|
||||
<exclude module="junit"/>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
val jodaTime = "joda-time" % "joda-time" % "1.6"
|
||||
}
|
||||
}
|
||||
|
||||
trait TestDependencies {
|
||||
val easymock = "org.easymock" % "easymock" % "3.0" % "test"
|
||||
val junit = "junit" % "junit" % "4.1" % "test"
|
||||
val scalaTest = "org.scalatest" % "scalatest" % "1.2" % "test"
|
||||
}
|
||||
|
||||
trait CoreDependencies {
|
||||
val log4j = "log4j" % "log4j" % "1.2.15"
|
||||
val jopt = "net.sf.jopt-simple" % "jopt-simple" % "3.2"
|
||||
val slf4jSimple = "org.slf4j" % "slf4j-simple" % "1.6.4"
|
||||
}
|
||||
|
||||
trait HadoopDependencies {
|
||||
val avro = "org.apache.avro" % "avro" % "1.4.0"
|
||||
val commonsLogging = "commons-logging" % "commons-logging" % "1.0.4"
|
||||
val jacksonCore = "org.codehaus.jackson" % "jackson-core-asl" % "1.5.5"
|
||||
val jacksonMapper = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.5.5"
|
||||
val hadoop = "org.apache.hadoop" % "hadoop-core" % "0.20.2"
|
||||
}
|
||||
|
||||
trait CompressionDependencies {
|
||||
val snappy = "org.xerial.snappy" % "snappy-java" % "1.0.5"
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
resolvers += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
|
||||
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.8")
|
||||
|
||||
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0")
|
||||
|
||||
resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
|
||||
|
||||
addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")
|
16
sbt
16
sbt
|
@ -1,16 +0,0 @@
|
|||
# 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.
|
||||
|
||||
java -Xmx1024M -XX:MaxPermSize=512m -Dbuild.number="$BUILD_NUMBER" -jar `dirname $0`/lib/sbt-launch.jar "$@"
|
17
sbt.bat
17
sbt.bat
|
@ -1,17 +0,0 @@
|
|||
@echo off
|
||||
rem Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
rem contributor license agreements. See the NOTICE file distributed with
|
||||
rem this work for additional information regarding copyright ownership.
|
||||
rem The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
rem (the "License"); you may not use this file except in compliance with
|
||||
rem the License. You may obtain a copy of the License at
|
||||
rem
|
||||
rem http://www.apache.org/licenses/LICENSE-2.0
|
||||
rem
|
||||
rem Unless required by applicable law or agreed to in writing, software
|
||||
rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
rem See the License for the specific language governing permissions and
|
||||
rem limitations under the License.
|
||||
|
||||
java -Xmx1024M -XX:MaxPermSize=512m -jar lib\sbt-launch.jar "%1"
|
Loading…
Reference in New Issue