Skip to content

Instantly share code, notes, and snippets.

@bantonsson
Last active October 12, 2015 15:08
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 bantonsson/4045529 to your computer and use it in GitHub Desktop.
Save bantonsson/4045529 to your computer and use it in GitHub Desktop.
Akka sbt-plugin packaging dependencies
In a new directory:
> mkdir project foo bar
Place ExampleBuild.scala and plugins.sbt in project
sbt foo/dist
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-RC2",
crossVersion := CrossVersion.full
)
lazy val example = Project(
id = "example",
base = file("."),
settings = buildSettings,
aggregate = Seq(bar, foo)
)
lazy val foo = Project(
id = "foo",
base = file("foo"),
dependencies = Seq(bar),
settings = buildSettings ++ AkkaKernelPlugin.distSettings ++ Seq(
libraryDependencies ++= Dependencies.example,
distJvmOptions in Dist := "-Xms256M -Xmx2048M",
outputDirectory in Dist <<= target / "dist"
)
)
lazy val bar = Project(
id = "bar",
base = file("bar"),
settings = buildSettings
)
object Dependencies {
val example = Seq(
// ---- application dependencies ----
"com.typesafe.akka" %% "akka-actor" % "2.1.0-RC2" cross CrossVersion.full,
"com.typesafe.akka" %% "akka-kernel" % "2.1.0-RC2" cross CrossVersion.full,
// ---- test dependencies ----
"org.scalatest" %% "scalatest" % "1.8-B2" % "test" cross CrossVersion.full
)
}
}
addSbtPlugin("com.typesafe.akka" % "akka-sbt-plugin" % "2.1.0-RC2")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment