Last active
October 12, 2015 15:08
-
-
Save bantonsson/4045529 to your computer and use it in GitHub Desktop.
Akka sbt-plugin packaging dependencies
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 | |
Place ExampleBuild.scala and plugins.sbt in project | |
sbt foo/dist |
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-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 | |
) | |
} | |
} |
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.0-RC2") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment