Skip to content

Commit 0e44882

Browse files
authored
Move ScopeOptions to SharedOptions (#3612)
1 parent 9c8ce2c commit 0e44882

25 files changed

+85
-88
lines changed

modules/cli/src/main/scala/scala/cli/commands/compile/Compile.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ object Compile extends ScalaCommand[CompileOptions] with BuildCommandHelpers {
109109
None,
110110
logger,
111111
crossBuilds = cross,
112-
buildTests = options.scope.test,
112+
buildTests = options.shared.scope.test,
113113
partial = None,
114114
actionableDiagnostics = actionableDiagnostics,
115115
postAction = () => WatchUtil.printWatchMessage()
@@ -128,7 +128,7 @@ object Compile extends ScalaCommand[CompileOptions] with BuildCommandHelpers {
128128
None,
129129
logger,
130130
crossBuilds = cross,
131-
buildTests = options.scope.test,
131+
buildTests = options.shared.scope.test,
132132
partial = None,
133133
actionableDiagnostics = actionableDiagnostics
134134
)

modules/cli/src/main/scala/scala/cli/commands/compile/CompileOptions.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ final case class CompileOptions(
2222
@HelpMessage("Print the resulting class path")
2323
@Tag(tags.should)
2424
@Tag(tags.inShortHelp)
25-
printClassPath: Boolean = false,
26-
27-
@Recurse
28-
scope: ScopeOptions = ScopeOptions()
25+
printClassPath: Boolean = false
2926
) extends HasSharedOptions
3027
// format: on
3128

modules/cli/src/main/scala/scala/cli/commands/dependencyupdate/DependencyUpdate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object DependencyUpdate extends ScalaCommand[DependencyUpdateOptions] {
2525
args: RemainingArgs,
2626
logger: Logger
2727
): Unit = {
28-
if options.scope.test then
28+
if options.shared.scope.test then
2929
logger.message(
3030
s"""$warnPrefix Including the test scope does not change the behaviour of this command.
3131
|$warnPrefix Test dependencies are updated regardless.""".stripMargin

modules/cli/src/main/scala/scala/cli/commands/dependencyupdate/DependencyUpdateOptions.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ final case class DependencyUpdateOptions(
1515
@HelpMessage("Update all dependencies if a newer version was released")
1616
@Tag(tags.restricted)
1717
@Tag(tags.inShortHelp)
18-
all: Boolean = false,
19-
@Recurse
20-
scope: ScopeOptions = ScopeOptions()
18+
all: Boolean = false
2119
) extends HasSharedOptions
2220
// format: on
2321

modules/cli/src/main/scala/scala/cli/commands/doc/Doc.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ object Doc extends ScalaCommand[DocOptions] {
5252
configDb.get(Keys.actions).getOrElse(None)
5353
)
5454

55-
val withTestScope = options.scope.test
55+
val withTestScope = options.shared.scope.test
5656
Build.build(
5757
inputs,
5858
initialBuildOptions,

modules/cli/src/main/scala/scala/cli/commands/doc/DocOptions.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ final case class DocOptions(
3232
@HelpMessage(s"Control if $fullRunnerName should use default options for scaladoc, true by default. Use `--default-scaladoc-opts:false` to not include default options.")
3333
@Tag(tags.should)
3434
@ExtraName("defaultScaladocOpts")
35-
defaultScaladocOptions: Option[Boolean] = None,
36-
@Recurse
37-
scope: ScopeOptions = ScopeOptions()
35+
defaultScaladocOptions: Option[Boolean] = None
3836
) extends HasSharedOptions
3937
// format: on
4038

modules/cli/src/main/scala/scala/cli/commands/export0/Export.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ object Export extends ScalaCommand[ExportOptions] {
136136
override def sharedOptions(opts: ExportOptions): Option[SharedOptions] = Some(opts.shared)
137137

138138
override def runCommand(options: ExportOptions, args: RemainingArgs, logger: Logger): Unit = {
139-
if options.scope.test then {
139+
if options.shared.scope.test then {
140140
logger.error(
141141
s"""Including the test scope sources together with the main scope is currently not supported.
142142
|Note that test scope sources will still be exported as per the output build tool tests definition demands.""".stripMargin

modules/cli/src/main/scala/scala/cli/commands/export0/ExportOptions.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ final case class ExportOptions(
8585
@Group(HelpGroup.BuildToolExport.toString)
8686
@Tag(tags.restricted)
8787
output: Option[String] = None,
88-
89-
@Recurse
90-
scope: ScopeOptions = ScopeOptions()
9188
) extends HasSharedOptions
9289
// format: on
9390
object ExportOptions {

modules/cli/src/main/scala/scala/cli/commands/fmt/Fmt.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ object Fmt extends ScalaCommand[FmtOptions] {
4343
override def runCommand(options: FmtOptions, args: RemainingArgs, logger: Logger): Unit = {
4444
val buildOptions = buildOptionsOrExit(options)
4545

46-
if options.scope.test then
46+
if options.shared.scope.test then
4747
logger.message(
4848
s"""$warnPrefix Including the test scope does not change the behaviour of this command.
4949
|$warnPrefix Test scope inputs are formatted, regardless.""".stripMargin

modules/cli/src/main/scala/scala/cli/commands/fmt/FmtOptions.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ final case class FmtOptions(
9494
@HelpMessage(s"Pass scalafmt version before running it (${Constants.defaultScalafmtVersion} by default). If passed, this overrides whatever value is configured in the .scalafmt.conf file.")
9595
@Name("fmtVersion")
9696
@Tag(tags.inShortHelp)
97-
scalafmtVersion: Option[String] = None,
98-
@Recurse
99-
scope: ScopeOptions = ScopeOptions()
97+
scalafmtVersion: Option[String] = None
10098
) extends HasSharedOptions {
10199
// format: on
102100

0 commit comments

Comments
 (0)