Run sbt project in debug mode with a custom configuration

前端 未结 3 1541
梦如初夏
梦如初夏 2021-02-09 03:22

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

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-09 04:00

    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.

提交回复
热议问题