-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable debugging for run and test commands
- Loading branch information
Showing
15 changed files
with
160 additions
and
41 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
modules/cli-options/src/main/scala/scala/cli/commands/SharedDebugOptions.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package scala.cli.commands | ||
|
||
import caseapp.* | ||
import caseapp.core.help.Help | ||
|
||
import scala.cli.commands.BloopExitOptions.parser | ||
|
||
// format: off | ||
final case class SharedDebugOptions( | ||
@Group("Debug") | ||
@HelpMessage("Turn debugging on") | ||
debug: Boolean = false, | ||
@Group("Debug") | ||
@HelpMessage("Debug port (5005 by default)") | ||
debugPort: Option[String] = None, | ||
@Group("Debug") | ||
@HelpMessage("Debug mode (attach by default)") | ||
@ValueDescription("attach|a|listen|l") | ||
debugMode: Option[String] = None | ||
) | ||
// format: on | ||
|
||
object SharedDebugOptions { | ||
implicit lazy val parser: Parser[SharedDebugOptions] = Parser.derive | ||
implicit lazy val help: Help[SharedDebugOptions] = Help.derive | ||
// Parser.Aux for using SharedDebugOptions with @Recurse in other options | ||
implicit lazy val parserAux: Parser.Aux[SharedDebugOptions, parser.D] = parser | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
5 changes: 5 additions & 0 deletions
5
modules/core/src/main/scala/scala/build/errors/UnrecognizedDebugModeError.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package scala.build.errors | ||
|
||
final class UnrecognizedDebugModeError(mode: String) extends BuildException( | ||
s"Unrecognized debug mode: $mode." | ||
) |
This file contains 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
This file contains 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
Oops, something went wrong.