Skip to content

Instantly share code, notes, and snippets.

@Shiti
Last active August 29, 2015 14:04
Show Gist options
  • Save Shiti/c17fdf9994507c2798b0 to your computer and use it in GitHub Desktop.
Save Shiti/c17fdf9994507c2798b0 to your computer and use it in GitHub Desktop.
A build file to show multi-project build with runtime scoped dependencies
import sbt._
import sbt.Keys._
import sbtassembly.Plugin._
import AssemblyKeys._
object SampleBuild extends Build {
lazy val module1 = Project(
id = "module1",
base = file("module1"),
settings = Project.defaultSettings ++ Seq(
name := "module1",
organization := "fancyOrg",
version := "1.0",
scalaVersion := "2.10.4",
libraryDependencies ++= Seq("org.apache.commons" % "commons-io" % "1.3.2" % "runtime")
)
)
lazy val assembly = Project(
id = "assembly",
base = file("assembly"),
settings = Project.defaultSettings ++ Seq(
name := "assembly",
organization := "fancyOrg",
version := "1.0",
scalaVersion := "2.10.4"
)
) dependsOn(module1 % "compile->compile;runtime->runtime") //The assembly module depending on module1 is optional
lazy val sample = Project(
id = "sample",
base = file("."),
settings = Project.defaultSettings++ assemblySettings ++ Seq(
name := "sample",
organization := "fancyOrg",
version := "1.0",
scalaVersion := "2.10.4"
)
) aggregate(square,assembly) dependsOn(module1 % "compile->compile;runtime->runtime",assembly)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment