File tree Expand file tree Collapse file tree 11 files changed +18
-15
lines changed
modules/cli/src/main/scala/scala/cli/commands Expand file tree Collapse file tree 11 files changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ object Compile extends ScalaCommand[CompileOptions] with BuildCommandHelpers {
102
102
configDb.get(Keys .actions).getOrElse(None )
103
103
)
104
104
105
+ val shouldBuildTestScope = options.shared.scope.test.getOrElse(false )
105
106
if (options.watch.watchMode) {
106
107
val watcher = Build .watch(
107
108
inputs,
@@ -110,7 +111,7 @@ object Compile extends ScalaCommand[CompileOptions] with BuildCommandHelpers {
110
111
None ,
111
112
logger,
112
113
crossBuilds = cross,
113
- buildTests = options.shared.scope.test ,
114
+ buildTests = shouldBuildTestScope ,
114
115
partial = None ,
115
116
actionableDiagnostics = actionableDiagnostics,
116
117
postAction = () => WatchUtil .printWatchMessage()
@@ -129,7 +130,7 @@ object Compile extends ScalaCommand[CompileOptions] with BuildCommandHelpers {
129
130
None ,
130
131
logger,
131
132
crossBuilds = cross,
132
- buildTests = options.shared.scope.test ,
133
+ buildTests = shouldBuildTestScope ,
133
134
partial = None ,
134
135
actionableDiagnostics = actionableDiagnostics
135
136
)
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ object DependencyUpdate extends ScalaCommand[DependencyUpdateOptions] {
25
25
args : RemainingArgs ,
26
26
logger : Logger
27
27
): Unit = {
28
- if options.shared.scope.test then
28
+ if options.shared.scope.test.nonEmpty then
29
29
logger.message(
30
30
s """ $warnPrefix Including the test scope does not change the behaviour of this command.
31
31
| $warnPrefix Test dependencies are updated regardless. """ .stripMargin
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ object Doc extends ScalaCommand[DocOptions] {
52
52
configDb.get(Keys .actions).getOrElse(None )
53
53
)
54
54
55
- val withTestScope = options.shared.scope.test
55
+ val withTestScope = options.shared.scope.test.getOrElse( false )
56
56
Build .build(
57
57
inputs,
58
58
initialBuildOptions,
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ object Export extends ScalaCommand[ExportOptions] {
136
136
override def sharedOptions (opts : ExportOptions ): Option [SharedOptions ] = Some (opts.shared)
137
137
138
138
override def runCommand (options : ExportOptions , args : RemainingArgs , logger : Logger ): Unit = {
139
- if options.shared.scope.test then {
139
+ if options.shared.scope.test.nonEmpty then {
140
140
logger.error(
141
141
s """ Including the test scope sources together with the main scope is currently not supported.
142
142
|Note that test scope sources will still be exported as per the output build tool tests definition demands. """ .stripMargin
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ object Fmt extends ScalaCommand[FmtOptions] {
43
43
override def runCommand (options : FmtOptions , args : RemainingArgs , logger : Logger ): Unit = {
44
44
val buildOptions = buildOptionsOrExit(options)
45
45
46
- if options.shared.scope.test then
46
+ if options.shared.scope.test.nonEmpty then
47
47
logger.message(
48
48
s """ $warnPrefix Including the test scope does not change the behaviour of this command.
49
49
| $warnPrefix Test scope inputs are formatted, regardless. """ .stripMargin
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ object Package extends ScalaCommand[PackageOptions] with BuildCommandHelpers {
88
88
configDb.get(Keys .actions).getOrElse(None )
89
89
)
90
90
91
- val withTestScope = options.shared.scope.test
91
+ val withTestScope = options.shared.scope.test.getOrElse( false )
92
92
if options.watch.watchMode then {
93
93
var expectedModifyEpochSecondOpt = Option .empty[Long ]
94
94
val watcher = Build .watch(
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ object Publish extends ScalaCommand[PublishOptions] with BuildCommandHelpers {
266
266
() => configDb,
267
267
options.mainClass,
268
268
dummy = options.sharedPublish.dummy,
269
- buildTests = options.shared.scope.test
269
+ buildTests = options.shared.scope.test.getOrElse( false )
270
270
)
271
271
}
272
272
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ object PublishLocal extends ScalaCommand[PublishLocalOptions] {
86
86
configDb = () => ConfigDb .empty, // shouldn't be used, no need of repo credentials here
87
87
mainClassOptions = options.mainClass,
88
88
dummy = options.sharedPublish.dummy,
89
- buildTests = options.shared.scope.test
89
+ buildTests = options.shared.scope.test.getOrElse( false )
90
90
)
91
91
}
92
92
}
Original file line number Diff line number Diff line change @@ -190,10 +190,11 @@ object Repl extends ScalaCommand[ReplOptions] with BuildCommandHelpers {
190
190
configDb.get(Keys .actions).getOrElse(None )
191
191
)
192
192
193
+ val shouldBuildTestScope = options.shared.scope.test.getOrElse(false )
193
194
if (inputs.isEmpty) {
194
195
val allArtifacts =
195
196
Seq (initialBuildOptions.artifacts(logger, Scope .Main ).orExit(logger)) ++
196
- (if options.shared.scope.test
197
+ (if shouldBuildTestScope
197
198
then Seq (initialBuildOptions.artifacts(logger, Scope .Test ).orExit(logger))
198
199
else Nil )
199
200
// synchronizing, so that multiple presses to enter (handled by WatchUtil.waitForCtrlC)
@@ -224,7 +225,7 @@ object Repl extends ScalaCommand[ReplOptions] with BuildCommandHelpers {
224
225
None ,
225
226
logger,
226
227
crossBuilds = cross,
227
- buildTests = options.shared.scope.test ,
228
+ buildTests = shouldBuildTestScope ,
228
229
partial = None ,
229
230
actionableDiagnostics = actionableDiagnostics,
230
231
postAction = () => WatchUtil .printWatchMessage()
@@ -252,7 +253,7 @@ object Repl extends ScalaCommand[ReplOptions] with BuildCommandHelpers {
252
253
None ,
253
254
logger,
254
255
crossBuilds = cross,
255
- buildTests = options.shared.scope.test ,
256
+ buildTests = shouldBuildTestScope ,
256
257
partial = None ,
257
258
actionableDiagnostics = actionableDiagnostics
258
259
)
Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ object Run extends ScalaCommand[RunOptions] with BuildCommandHelpers {
233
233
configDb.get(Keys .actions).getOrElse(None )
234
234
)
235
235
236
+ val shouldBuildTestScope = options.shared.scope.test.getOrElse(false )
236
237
if options.sharedRun.watch.watchMode then {
237
238
238
239
/** A handle to the Runner process, used to kill the process if it's still alive when a change
@@ -258,7 +259,7 @@ object Run extends ScalaCommand[RunOptions] with BuildCommandHelpers {
258
259
docCompilerMakerOpt = None ,
259
260
logger = logger,
260
261
crossBuilds = cross,
261
- buildTests = options.shared.scope.test ,
262
+ buildTests = shouldBuildTestScope ,
262
263
partial = None ,
263
264
actionableDiagnostics = actionableDiagnostics,
264
265
postAction = () =>
@@ -331,7 +332,7 @@ object Run extends ScalaCommand[RunOptions] with BuildCommandHelpers {
331
332
None ,
332
333
logger,
333
334
crossBuilds = cross,
334
- buildTests = options.shared.scope.test ,
335
+ buildTests = shouldBuildTestScope ,
335
336
partial = None ,
336
337
actionableDiagnostics = actionableDiagnostics
337
338
)
You can’t perform that action at this time.
0 commit comments