diff --git a/project/Project.scala b/project/Project.scala index 7b6bf82..361f888 100644 --- a/project/Project.scala +++ b/project/Project.scala @@ -34,8 +34,6 @@ object ScalabootBuild extends Build { "clojars.org" at "http://clojars.org/repo") val hadoopDeps = Seq( - "com.twitter" %% "scalding-core" % "0.10.0", - "com.twitter" %% "scalding-avro" % "0.10.0", "com.twitter" %% "scalding-commons" % "0.10.0" // "org.apache.hadoop" % "hadoop-core" % "2.3.0-mr1-cdh5.0.1" % "provided", ) @@ -63,46 +61,44 @@ object ScalabootBuild extends Build { import sbtassembly.Plugin._ import AssemblyKeys._ - import sbtavro.SbtAvro._ - lazy val hadoopSettings = defaultSettings ++ assemblySettings ++ avroSettings ++ Seq( - resolvers ++= hadoopResolvers, - libraryDependencies ++= hadoopDeps, - - version in avroConfig := "1.7.5", // remove this if you want cdh5 avro to be - // pulled in - stringType in avroConfig := "String", + lazy val hadoopSettings = defaultSettings ++ + assemblySettings ++ + sbtAvro.settings ++ + Seq( + resolvers ++= hadoopResolvers, + libraryDependencies ++= hadoopDeps, - // Slightly cleaner jar name - jarName in assembly := { name.value + "-" + version.value + ".jar" }, - test in assembly := {}, // ignore tests - mainClass in assembly := Some(HADOOP_JOBRUNNER), - // NOTE: specifying the main class for Compile,run is currently somewhat - // buggy because of this - // [[https://github.com/sbt/sbt/issues/850][bug]]. it's also not really - // needed but adding here for completeness - mainClass in (Compile, run) := Some(HADOOP_JOBRUNNER), - // Drop these jars - excludedJars in assembly <<= (fullClasspath in assembly) map { cp => - val excludes: Set[String] = Set( - "minlog-1.2.jar" // Otherwise causes conflicts with Kryo (which bundles it) - , "commons-beanutils-core-1.8.0.jar" // Clash with each other and with commons-collections - , "commons-beanutils-1.7.0.jar" // " - , "asm-3.1.jar" // there's already asm-4.0 - , "jsp-2.1-6.1.14.jar" - ) - cp filter { jar => excludes(jar.data.getName) } - }, + // Slightly cleaner jar name + jarName in assembly := { name.value + "-" + version.value + ".jar" }, + test in assembly := {}, // ignore tests + mainClass in assembly := Some(HADOOP_JOBRUNNER), + // NOTE: specifying the main class for Compile,run is currently somewhat + // buggy because of this + // [[https://github.com/sbt/sbt/issues/850][bug]]. it's also not really + // needed but adding here for completeness + mainClass in (Compile, run) := Some(HADOOP_JOBRUNNER), + // Drop these jars + excludedJars in assembly <<= (fullClasspath in assembly) map { cp => + val excludes: Set[String] = Set( + "minlog-1.2.jar" // Otherwise causes conflicts with Kryo (which bundles it) + , "commons-beanutils-core-1.8.0.jar" // Clash with each other and with commons-collections + , "commons-beanutils-1.7.0.jar" // " + , "asm-3.1.jar" // there's already asm-4.0 + , "jsp-2.1-6.1.14.jar" + ) + cp filter { jar => excludes(jar.data.getName) } + }, - mergeStrategy in assembly <<= (mergeStrategy in assembly) { - (old) => - { - case PathList("javax", "servlet", xs @ _*) => MergeStrategy.first - case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first - case "project.clj" => MergeStrategy.discard // Leiningen build files - case x => old(x) - } - }) + mergeStrategy in assembly <<= (mergeStrategy in assembly) { + (old) => + { + case PathList("javax", "servlet", xs @ _*) => MergeStrategy.first + case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first + case "project.clj" => MergeStrategy.discard // Leiningen build files + case x => old(x) + } + }) lazy val root = Project(PROJECT_NAME, file(".")) .configs(IntegrationTest) diff --git a/project/sbt-avro-plugin.sbt b/project/sbtAvro.sbt similarity index 100% rename from project/sbt-avro-plugin.sbt rename to project/sbtAvro.sbt diff --git a/project/sbtAvro.scala b/project/sbtAvro.scala new file mode 100644 index 0000000..0abee1d --- /dev/null +++ b/project/sbtAvro.scala @@ -0,0 +1,19 @@ +object sbtAvro { + import sbt._ + import sbtavro.SbtAvro._ + + private lazy val deps = Seq( + "com.twitter" %% "scalding-core" % "0.10.0" + , "com.twitter" %% "scalding-avro" % "0.10.0" + ) + + + lazy val settings = avroSettings ++ Seq( + Keys.resolvers += "sbt-plugin-releases" at + "http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases" + , Keys.libraryDependencies ++= deps + , Keys.version in avroConfig := "1.7.5" // remove this if you want cdh5 avro + // to be pulled in + , stringType in avroConfig := "String" + ) +}