@@ -30,7 +30,7 @@ import scala.util.control.NonFatal
30
30
import scala .util .{Properties , Try }
31
31
32
32
trait Build {
33
- def inputs : ModuleInputs
33
+ def inputs : Module
34
34
def options : BuildOptions
35
35
def scope : Scope
36
36
def outputOpt : Option [os.Path ]
@@ -43,17 +43,17 @@ trait Build {
43
43
object Build {
44
44
45
45
final case class Successful (
46
- inputs : ModuleInputs ,
47
- options : BuildOptions ,
48
- scalaParams : Option [ScalaParameters ],
49
- scope : Scope ,
50
- sources : Sources ,
51
- artifacts : Artifacts ,
52
- project : Project ,
53
- output : os.Path ,
54
- diagnostics : Option [Seq [(Either [String , os.Path ], bsp4j.Diagnostic )]],
55
- generatedSources : Seq [GeneratedSource ],
56
- isPartial : Boolean
46
+ inputs : Module ,
47
+ options : BuildOptions ,
48
+ scalaParams : Option [ScalaParameters ],
49
+ scope : Scope ,
50
+ sources : Sources ,
51
+ artifacts : Artifacts ,
52
+ project : Project ,
53
+ output : os.Path ,
54
+ diagnostics : Option [Seq [(Either [String , os.Path ], bsp4j.Diagnostic )]],
55
+ generatedSources : Seq [GeneratedSource ],
56
+ isPartial : Boolean
57
57
) extends Build {
58
58
def success : Boolean = true
59
59
def successfulOpt : Some [this .type ] = Some (this )
@@ -166,24 +166,24 @@ object Build {
166
166
}
167
167
168
168
final case class Failed (
169
- inputs : ModuleInputs ,
170
- options : BuildOptions ,
171
- scope : Scope ,
172
- sources : Sources ,
173
- artifacts : Artifacts ,
174
- project : Project ,
175
- diagnostics : Option [Seq [(Either [String , os.Path ], bsp4j.Diagnostic )]]
169
+ inputs : Module ,
170
+ options : BuildOptions ,
171
+ scope : Scope ,
172
+ sources : Sources ,
173
+ artifacts : Artifacts ,
174
+ project : Project ,
175
+ diagnostics : Option [Seq [(Either [String , os.Path ], bsp4j.Diagnostic )]]
176
176
) extends Build {
177
177
def success : Boolean = false
178
178
def successfulOpt : None .type = None
179
179
def outputOpt : None .type = None
180
180
}
181
181
182
182
final case class Cancelled (
183
- inputs : ModuleInputs ,
184
- options : BuildOptions ,
185
- scope : Scope ,
186
- reason : String
183
+ inputs : Module ,
184
+ options : BuildOptions ,
185
+ scope : Scope ,
186
+ reason : String
187
187
) extends Build {
188
188
def success : Boolean = false
189
189
def successfulOpt : None .type = None
@@ -195,10 +195,10 @@ object Build {
195
195
* Using only the command-line options not the ones from the sources.
196
196
*/
197
197
def updateInputs (
198
- inputs : ModuleInputs ,
199
- options : BuildOptions ,
200
- testOptions : Option [BuildOptions ] = None
201
- ): ModuleInputs = {
198
+ inputs : Module ,
199
+ options : BuildOptions ,
200
+ testOptions : Option [BuildOptions ] = None
201
+ ): Module = {
202
202
203
203
// If some options are manually overridden, append a hash of the options to the project name
204
204
// Using options, not options0 - only the command-line options are taken into account. No hash is
@@ -215,7 +215,7 @@ object Build {
215
215
}
216
216
217
217
private def allInputs (
218
- inputs : ModuleInputs ,
218
+ inputs : Module ,
219
219
options : BuildOptions ,
220
220
logger : Logger
221
221
)(using ScalaCliInvokeData ) =
@@ -232,9 +232,8 @@ object Build {
232
232
)
233
233
234
234
private def build (
235
- inputs : ModuleInputs ,
236
- crossSources : CrossSources ,
237
- options : BuildOptions ,
235
+ inputs : Module ,
236
+ crossSources : CrossSources ,options : BuildOptions ,
238
237
logger : Logger ,
239
238
buildClient : BloopBuildClient ,
240
239
compiler : ScalaCompiler ,
@@ -247,7 +246,7 @@ object Build {
247
246
val sharedOptions = crossSources.sharedOptions(options)
248
247
val crossOptions = sharedOptions.crossOptions
249
248
250
- def doPostProcess (build : Build , inputs : ModuleInputs , scope : Scope ): Unit = build match {
249
+ def doPostProcess (build : Build , inputs : Module , scope : Scope ): Unit = build match {
251
250
case build : Build .Successful =>
252
251
for (sv <- build.project.scalaCompiler.map(_.scalaVersion))
253
252
postProcess(
@@ -426,17 +425,17 @@ object Build {
426
425
}
427
426
428
427
private def build (
429
- inputs : ModuleInputs ,
430
- sources : Sources ,
431
- generatedSources : Seq [GeneratedSource ],
432
- options : BuildOptions ,
433
- scope : Scope ,
434
- logger : Logger ,
435
- buildClient : BloopBuildClient ,
436
- compiler : ScalaCompiler ,
437
- buildTests : Boolean ,
438
- partial : Option [Boolean ],
439
- actionableDiagnostics : Option [Boolean ]
428
+ inputs : Module ,
429
+ sources : Sources ,
430
+ generatedSources : Seq [GeneratedSource ],
431
+ options : BuildOptions ,
432
+ scope : Scope ,
433
+ logger : Logger ,
434
+ buildClient : BloopBuildClient ,
435
+ compiler : ScalaCompiler ,
436
+ buildTests : Boolean ,
437
+ partial : Option [Boolean ],
438
+ actionableDiagnostics : Option [Boolean ]
440
439
)(using ScalaCliInvokeData ): Either [BuildException , Build ] = either {
441
440
442
441
val build0 = value {
@@ -498,9 +497,9 @@ object Build {
498
497
root / Constants .workspaceDirName / projectName.name / s " resources- ${scope.name}"
499
498
500
499
def scalaNativeSupported (
501
- options : BuildOptions ,
502
- inputs : ModuleInputs ,
503
- logger : Logger
500
+ options : BuildOptions ,
501
+ inputs : Module ,
502
+ logger : Logger
504
503
): Either [BuildException , Option [ScalaNativeCompatibilityError ]] =
505
504
either {
506
505
val scalaParamsOpt = value(options.scalaParams)
@@ -557,7 +556,7 @@ object Build {
557
556
}
558
557
559
558
def build (
560
- inputs : ModuleInputs ,
559
+ inputs : Module ,
561
560
options : BuildOptions ,
562
561
compilerMaker : ScalaCompilerMaker ,
563
562
docCompilerMakerOpt : Option [ScalaCompilerMaker ],
@@ -637,16 +636,16 @@ object Build {
637
636
}
638
637
639
638
def watch (
640
- inputs : ModuleInputs ,
641
- options : BuildOptions ,
642
- compilerMaker : ScalaCompilerMaker ,
643
- docCompilerMakerOpt : Option [ScalaCompilerMaker ],
644
- logger : Logger ,
645
- crossBuilds : Boolean ,
646
- buildTests : Boolean ,
647
- partial : Option [Boolean ],
648
- actionableDiagnostics : Option [Boolean ],
649
- postAction : () => Unit = () => ()
639
+ inputs : Module ,
640
+ options : BuildOptions ,
641
+ compilerMaker : ScalaCompilerMaker ,
642
+ docCompilerMakerOpt : Option [ScalaCompilerMaker ],
643
+ logger : Logger ,
644
+ crossBuilds : Boolean ,
645
+ buildTests : Boolean ,
646
+ partial : Option [Boolean ],
647
+ actionableDiagnostics : Option [Boolean ],
648
+ postAction : () => Unit = () => ()
650
649
)(action : Either [BuildException , Builds ] => Unit )(using ScalaCliInvokeData ): Watcher = {
651
650
652
651
val buildClient = BloopBuildClient .create(
@@ -841,15 +840,15 @@ object Build {
841
840
* a bloop [[Project ]]
842
841
*/
843
842
def buildProject (
844
- inputs : ModuleInputs ,
845
- sources : Sources ,
846
- generatedSources : Seq [GeneratedSource ],
847
- options : BuildOptions ,
848
- compilerJvmVersionOpt : Option [Positioned [Int ]],
849
- scope : Scope ,
850
- logger : Logger ,
851
- artifacts : Artifacts ,
852
- maybeRecoverOnError : BuildException => Option [BuildException ] = e => Some (e)
843
+ inputs : Module ,
844
+ sources : Sources ,
845
+ generatedSources : Seq [GeneratedSource ],
846
+ options : BuildOptions ,
847
+ compilerJvmVersionOpt : Option [Positioned [Int ]],
848
+ scope : Scope ,
849
+ logger : Logger ,
850
+ artifacts : Artifacts ,
851
+ maybeRecoverOnError : BuildException => Option [BuildException ] = e => Some (e)
853
852
): Either [BuildException , Project ] = either {
854
853
855
854
val allSources = sources.paths.map(_._1) ++ generatedSources.map(_.generated)
@@ -1033,16 +1032,16 @@ object Build {
1033
1032
}
1034
1033
1035
1034
def prepareBuild (
1036
- inputs : ModuleInputs ,
1037
- sources : Sources ,
1038
- generatedSources : Seq [GeneratedSource ],
1039
- options : BuildOptions ,
1040
- compilerJvmVersionOpt : Option [Positioned [Int ]],
1041
- scope : Scope ,
1042
- compiler : ScalaCompiler ,
1043
- logger : Logger ,
1044
- buildClient : BloopBuildClient ,
1045
- maybeRecoverOnError : BuildException => Option [BuildException ] = e => Some (e)
1035
+ inputs : Module ,
1036
+ sources : Sources ,
1037
+ generatedSources : Seq [GeneratedSource ],
1038
+ options : BuildOptions ,
1039
+ compilerJvmVersionOpt : Option [Positioned [Int ]],
1040
+ scope : Scope ,
1041
+ compiler : ScalaCompiler ,
1042
+ logger : Logger ,
1043
+ buildClient : BloopBuildClient ,
1044
+ maybeRecoverOnError : BuildException => Option [BuildException ] = e => Some (e)
1046
1045
): Either [BuildException , (os.Path , Option [ScalaParameters ], Artifacts , Project , Boolean )] =
1047
1046
either {
1048
1047
@@ -1114,15 +1113,15 @@ object Build {
1114
1113
}
1115
1114
1116
1115
def buildOnce (
1117
- inputs : ModuleInputs ,
1118
- sources : Sources ,
1119
- generatedSources : Seq [GeneratedSource ],
1120
- options : BuildOptions ,
1121
- scope : Scope ,
1122
- logger : Logger ,
1123
- buildClient : BloopBuildClient ,
1124
- compiler : ScalaCompiler ,
1125
- partialOpt : Option [Boolean ]
1116
+ inputs : Module ,
1117
+ sources : Sources ,
1118
+ generatedSources : Seq [GeneratedSource ],
1119
+ options : BuildOptions ,
1120
+ scope : Scope ,
1121
+ logger : Logger ,
1122
+ buildClient : BloopBuildClient ,
1123
+ compiler : ScalaCompiler ,
1124
+ partialOpt : Option [Boolean ]
1126
1125
): Either [BuildException , Build ] = either {
1127
1126
1128
1127
if (options.platform.value == Platform .Native )
@@ -1284,14 +1283,14 @@ object Build {
1284
1283
else path.toString
1285
1284
1286
1285
private def jmhBuild (
1287
- inputs : ModuleInputs ,
1288
- build : Build .Successful ,
1289
- logger : Logger ,
1290
- javaCommand : String ,
1291
- buildClient : BloopBuildClient ,
1292
- compiler : ScalaCompiler ,
1293
- buildTests : Boolean ,
1294
- actionableDiagnostics : Option [Boolean ]
1286
+ inputs : Module ,
1287
+ build : Build .Successful ,
1288
+ logger : Logger ,
1289
+ javaCommand : String ,
1290
+ buildClient : BloopBuildClient ,
1291
+ compiler : ScalaCompiler ,
1292
+ buildTests : Boolean ,
1293
+ actionableDiagnostics : Option [Boolean ]
1295
1294
)(using ScalaCliInvokeData ): Either [BuildException , Option [Build ]] = either {
1296
1295
val jmhProjectName = inputs.projectName.name + " _jmh"
1297
1296
val jmhOutputDir = inputs.workspace / Constants .workspaceDirName / jmhProjectName
0 commit comments