Created
August 24, 2013 10:38
-
-
Save rkuhn/6327375 to your computer and use it in GitHub Desktop.
A small experiment to integrate akka.Main with sbt-start-script (applying https://github.com/sbt/sbt-start-script/pull/43). sbt> start-script will generate a runner which executes the Actor `org.example.Main`
This file contains 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 sbt.Keys._ | |
import com.typesafe.sbt.SbtStartScript.{startScriptForClassesSettings => startScript} | |
import com.typesafe.sbt.SbtStartScript.StartScriptKeys._ | |
object AkkaProjectInScalaBuild extends Build { | |
lazy val akkaProjectInScala = Project( | |
id = "akka-project-in-scala", | |
base = file("."), | |
settings = Project.defaultSettings ++ startScript ++ Seq( | |
name := "Akka Project In Scala", | |
organization := "org.example", | |
version := "0.1-SNAPSHOT", | |
scalaVersion := "2.10.2", | |
mainClass in Compile := Some("akka.Main"), | |
startScriptArgs := Seq("org.example.Main"), | |
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.2.0" | |
) | |
) | |
} |
This file contains 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
package org.example | |
import akka.actor.Actor | |
class Main extends Actor { | |
println("hello") | |
context stop self | |
def receive = Actor.emptyBehavior | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment