I want to introduce a debug mode in my sbt 0.11 project using a special configuration. I\'ve tried to implement this using the following code but unfortunately, it doesn\'t seem
In Intellij IDEA, I just boot the program in Dedug mode and it seems to work properly without further configuration.
Ok that works with the following :
object Test extends Build {
lazy val root = Project("test", file("."))
.configs( RunDebug )
.settings( inConfig(RunDebug)(Defaults.configTasks):_*)
.settings(
name := "test debug",
scalaVersion := "2.9.1",
javaOptions in RunDebug ++= Seq("-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
fork in RunDebug := true
)
lazy val RunDebug = config("debug").extend( Runtime )
}
now I can run my code in debug mode using debug:mode
.
for simply running sbt project in debug mode , just do
JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
and then
sbt run
would run SBT in debug mode, you can create a remote debug configuration in eclipse and connect to it.
this is a rather lame, but useful when you have a multi module play project and want to run one of the modules in the debug mode