Skip to content

Instantly share code, notes, and snippets.

@samuelorji
Created November 23, 2018 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelorji/8b74d7f1879611ed3c2669bfb06c6bb6 to your computer and use it in GitHub Desktop.
Save samuelorji/8b74d7f1879611ed3c2669bfb06c6bb6 to your computer and use it in GitHub Desktop.
A sample build.sbt file ffor multiple projects
val Snapshots = "Snapshots" at "url to repo "
val Releases = "Releases" at "url to repo "
lazy val sharedSettings = Seq(
scalaVersion := "2.12.6",
version := "0.1.6",
resolvers ++= Seq(
Snapshots,
Releases,
"Typesafe repository releases" at "http://repo.typesafe.com/typesafe/releases/",
"Confluent Maven Repository" at "http://packages.confluent.io/maven/"
),
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-unchecked"
),
updateOptions := updateOptions.value.withLatestSnapshots(false),
test in assembly := {},
assemblyMergeStrategy in assembly := {
case "META-INF/io.netty.versions.properties" => MergeStrategy.first
case PathList("io", "netty", xs @ _*) => MergeStrategy.last
case "logback.xml" => MergeStrategy.last
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)
val akkaVersion = "2.5.17"
val akkaHttpVersion = "10.1.5"
val scalaTestVersion = "3.0.5"
lazy val elmer = (project in file("."))
.aggregate(core, web)
lazy val sharedDependencies = Seq(
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test,
"org.scalatest" %% "scalatest" % scalaTestVersion % Test
)
lazy val core = (project in file("core")).
settings(
sharedSettings,
libraryDependencies ++= sharedDependencies,
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion
)
)
lazy val web = (project in file("web")).
settings(
sharedSettings,
libraryDependencies ++= sharedDependencies
).dependsOn(core)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment