Last active
December 14, 2015 01:09
-
-
Save bantonsson/5004611 to your computer and use it in GitHub Desktop.
Akka sbt-plugin packaging dependencies with names set for some projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In a new directory: | |
> mkdir project foo bar baz biz | |
Place ExampleBuild.scala and plugins.sbt in project | |
sbt foo/dist | |
ls -la foo/target/dist/lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import Keys._ | |
import akka.sbt.AkkaKernelPlugin | |
import akka.sbt.AkkaKernelPlugin.{ Dist, outputDirectory, distJvmOptions} | |
object ExampleBuild extends Build { | |
lazy val buildSettings = Defaults.defaultSettings ++ Seq( | |
organization := "example", | |
version := "1.0-SNAPSHOT", | |
scalaVersion := "2.10.0", | |
crossVersion := CrossVersion.full | |
) | |
lazy val example = Project( | |
id = "example", | |
base = file("."), | |
settings = buildSettings, | |
aggregate = Seq(foo, bar, baz, biz) | |
) | |
lazy val foo = Project( | |
id = "foo", | |
base = file("foo"), | |
dependencies = Seq(bar), | |
settings = buildSettings ++ AkkaKernelPlugin.distSettings ++ Seq( | |
name := "extra-foo", | |
libraryDependencies ++= Dependencies.example, | |
distJvmOptions in Dist := "-Xms256M -Xmx2048M", | |
outputDirectory in Dist <<= target / "dist" | |
) | |
) | |
lazy val bar = Project( | |
id = "bar", | |
base = file("bar"), | |
dependencies = Seq(baz), | |
settings = buildSettings ++ Seq(name := "extra-bar") | |
) | |
lazy val baz = Project( | |
id = "baz", | |
base = file("baz"), | |
dependencies = Seq(biz), | |
settings = buildSettings ++ Seq(name := "extra-baz") | |
) | |
lazy val biz = Project( | |
id = "biz", | |
base = file("biz"), | |
settings = buildSettings ++ Seq(libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-remote" % "2.1.1")) | |
) | |
object Dependencies { | |
val example = Seq( | |
// ---- application dependencies ---- | |
"com.typesafe.akka" %% "akka-actor" % "2.1.1", | |
"com.typesafe.akka" %% "akka-kernel" % "2.1.1" | |
) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addSbtPlugin("com.typesafe.akka" % "akka-sbt-plugin" % "2.1.1") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment