Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
project
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
import sbt._
import sbt.Keys._
import com.earldouglas.xwp.XwpPlugin._
import sbtassembly.Plugin._
import AssemblyKeys._
object BuildSettings {
val buildOrganization = "jp.zucks"
val buildVersion = "1.0.0-SNAPSHOT"
val buildScalaVersion = "2.11.6"
val javaOptionsForTest = Seq(
"-Dscala.concurrent.context.numThreads=4",
"-Dscala.concurrent.context.minThreads=4",
"-Dscala.concurrent.context.maxThreads=4"
)
lazy val assemblyAdditionalSettings = Seq(
mergeStrategy in assembly ~= {
(old) => {
case x =>
old(x)
}
}
)
def project(_name: String, dependencies: Seq[ModuleID], customSettings: Seq[Setting[_]] = Nil): Project =
Project(
id = _name,
base = file("./" + _name),
settings = Defaults.defaultSettings ++ Seq(
name := _name,
organization := buildOrganization,
version := buildVersion,
scalaVersion := buildScalaVersion,
fork in Test := true,
javaOptions in Test ++= javaOptionsForTest,
testOptions in Test += Tests.Argument("-oNCXEHLOPQMG") // see http://www.scalatest.org/user_guide/using_the_runner
) ++ Seq(
resolvers ++= Resolvers.all,
libraryDependencies ++= dependencies
) ++ customSettings ++ assemblySettings ++ net.virtualvoid.sbt.graph.Plugin.graphSettings
)
}
object Resolvers {
val local = "Project Local Maven Repository" at file("./").toURI.toURL + "m2repo"
val all = Seq(local)
}
object Dependencies {
val slf4j = Seq(
"org.slf4j" % "slf4j-api" % "1.7.7",
"org.slf4j" % "jcl-over-slf4j" % "1.7.7"
)
val guava = "com.google.guava" % "guava" % "18.0"
val servletApi = "javax.servlet" % "javax.servlet-api" % "3.1.0"
val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.0.13"
val commmonsNet = "commons-net" % "commons-net" % "3.3"
val awsJavaSdk = "com.amazonaws" % "aws-java-sdk" % "1.9.33" exclude("commons-logging", "commons-logging")
val test = Seq(
"org.scalatest" % "scalatest_2.11" % "2.2.4" % "test",
logbackClassic % "test"
)
val adserver = Seq(
"joda-time" % "joda-time" % "2.3",
"org.joda" % "joda-convert" % "1.2",
"net.liftweb" % "lift-json_2.11" % "3.0-M2",
commmonsNet,
"com.google.javascript" % "closure-compiler" % "r2388"
) ++ slf4j
val protobuf = Seq(
"com.google.protobuf" % "protobuf-java" % "2.5.0",
"net.sandrogrzicic" % "scalabuff-runtime_2.11" % "1.3.9-SNAPSHOT"
)
val goat = Seq(
guava,
awsJavaSdk,
"org.scalaz" %% "scalaz-core" % "7.1.1",
"org.json4s" %% "json4s-native" % "3.2.11" withSources(),
"com.github.cb372" %% "scalacache-guava" % "0.6.2",
"com.typesafe" % "config" % "1.2.1"
) ++ slf4j
val vlt = Seq(
"com.google.code.findbugs" % "jsr305" % "1.3.9",
guava,
commmonsNet,
"commons-pool" % "commons-pool" % "1.6",
awsJavaSdk
) ++ slf4j
val utils = Seq(
"com.fasterxml.jackson.module" % "jackson-module-scala_2.10" % "2.3.3",
"commons-codec" % "commons-codec" % "1.7",
commmonsNet
)
val servletUtils = Seq(
servletApi % "provided"
)
val batch = Seq(
logbackClassic
)
val sh = Seq(
logbackClassic,
servletApi % "provided"
)
val jh = Seq(
logbackClassic,
servletApi % "provided"
)
}
object ZgokAdserver extends Build {
import BuildSettings._
lazy val root = Project(id = "zgok-adserver",
base = file(".")) aggregate(adserver, goat, vlt, utils, batch, sh, jh)
lazy val adserver = project("zgok-adserver-scala", Dependencies.test ++ Dependencies.adserver)
lazy val protobuf = project("zgok-protobuf", Dependencies.test ++ Dependencies.protobuf)
lazy val vlt = project("zgok-vlt", Dependencies.test ++ Dependencies.vlt)
lazy val goat = project("zgok-goat", Dependencies.test ++ Dependencies.goat)
lazy val utils = project("zgok-utils", Dependencies.test ++ Dependencies.utils)
lazy val servletUtils = project("zgok-servlet-utils", Dependencies.test ++ Dependencies.servletUtils)
lazy val batch = project("zgok-batch-scala", Dependencies.test ++ Dependencies.batch)
.dependsOn(adserver, utils, goat)
lazy val sh = project("zgok-sh", Dependencies.test ++ Dependencies.sh, jetty(port = 9090))
.dependsOn(adserver, vlt, goat, utils, servletUtils, protobuf)
lazy val jh = project("zgok-jh", Dependencies.test ++ Dependencies.jh, jetty(port = 9091))
.dependsOn(adserver, utils, servletUtils)
}
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "1.0.0")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.