mirror of
https://github.com/enso-org/enso.git
synced 2024-11-29 14:02:10 +03:00
sbt runEngineDistribution --debug to ease debuggging (#6745)
This commit is contained in:
parent
9e491e7c0b
commit
2bc7d346a8
@ -7,6 +7,8 @@ import sbt.util.{CacheStore, CacheStoreFactory, FileInfo, Tracked}
|
|||||||
|
|
||||||
import scala.sys.process._
|
import scala.sys.process._
|
||||||
|
|
||||||
|
import org.enso.build.WithDebugCommand
|
||||||
|
|
||||||
object DistributionPackage {
|
object DistributionPackage {
|
||||||
|
|
||||||
/** File extensions. */
|
/** File extensions. */
|
||||||
@ -263,6 +265,10 @@ object DistributionPackage {
|
|||||||
all.add(enso.getAbsolutePath())
|
all.add(enso.getAbsolutePath())
|
||||||
all.addAll(args.asJava)
|
all.addAll(args.asJava)
|
||||||
pb.command(all)
|
pb.command(all)
|
||||||
|
if (args.contains("--debug")) {
|
||||||
|
all.remove("--debug")
|
||||||
|
pb.environment().put("JAVA_OPTS", WithDebugCommand.DEBUG_OPTION)
|
||||||
|
}
|
||||||
pb.inheritIO()
|
pb.inheritIO()
|
||||||
val p = pb.start()
|
val p = pb.start()
|
||||||
val exitCode = p.waitFor()
|
val exitCode = p.waitFor()
|
||||||
|
@ -15,6 +15,8 @@ import sbt._
|
|||||||
* }}}
|
* }}}
|
||||||
*/
|
*/
|
||||||
object WithDebugCommand {
|
object WithDebugCommand {
|
||||||
|
val DEBUG_OPTION =
|
||||||
|
"-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5005,suspend=y";
|
||||||
|
|
||||||
val truffleNoBackgroundCompilationOptions = Seq(
|
val truffleNoBackgroundCompilationOptions = Seq(
|
||||||
"-Dpolyglot.engine.BackgroundCompilation=false"
|
"-Dpolyglot.engine.BackgroundCompilation=false"
|
||||||
@ -78,9 +80,7 @@ object WithDebugCommand {
|
|||||||
else Seq()
|
else Seq()
|
||||||
val debuggerOpts =
|
val debuggerOpts =
|
||||||
if (debugFlags.contains(debuggerOption))
|
if (debugFlags.contains(debuggerOption))
|
||||||
Seq(
|
Seq(DEBUG_OPTION)
|
||||||
"-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5005,suspend=y"
|
|
||||||
)
|
|
||||||
else Seq()
|
else Seq()
|
||||||
val javaOpts: Seq[String] = Seq(
|
val javaOpts: Seq[String] = Seq(
|
||||||
truffleNoBackgroundCompilationOptions,
|
truffleNoBackgroundCompilationOptions,
|
||||||
|
Loading…
Reference in New Issue
Block a user