Created
May 6, 2012 17:12
-
-
Save remeniuk/2623345 to your computer and use it in GitHub Desktop.
CLI in SBT
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
object DslRepl extends Build { | |
val host = SettingKey[String]("host", "The host that the REPL will connect to.") | |
val port = SettingKey[Int]("port", "The port that the REPL will connect to.") | |
lazy val root = Project("root", file(".")) settings ( | |
libraryDependencies ++= Seq( | |
"com.vasilrem" % "somedsl" % "0.1" | |
), | |
host := "127.0.0.1", | |
port := 7777, | |
initialCommands in console <<= (host, port) {(h, p) => """ | |
Thread.currentThread.setContextClassLoader(getClass.getClassLoader) | |
import com.vasilrem.somedsl.lang._ | |
Context.init(%s, %s) | |
""".format(host, port)} | |
) | |
} |
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
~/projects/somedsl: ./run.sh | |
import com.vasilrem.somedsl.lang._ | |
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> call some_service and print to file "./file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment