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 seems to work as expected. I'm launching debug:run
but the run doesn't suspends as expected.
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 += "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005",
fork in RunDebug := true
)
lazy val RunDebug = config("debug").extend( Runtime )
}
clean – delete all generated sources, compiled artifacts, intermediate products, and generally all build-produced files. reload – reload the build, to take into account changes to the sbt plugin and its transitive dependencies.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With