@@ -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 )
@@ -171,24 +171,24 @@ object Build {
171
171
}
172
172
173
173
final case class Failed (
174
- inputs : ModuleInputs ,
175
- options : BuildOptions ,
176
- scope : Scope ,
177
- sources : Sources ,
178
- artifacts : Artifacts ,
179
- project : Project ,
180
- diagnostics : Option [Seq [(Either [String , os.Path ], bsp4j.Diagnostic )]]
174
+ inputs : Module ,
175
+ options : BuildOptions ,
176
+ scope : Scope ,
177
+ sources : Sources ,
178
+ artifacts : Artifacts ,
179
+ project : Project ,
180
+ diagnostics : Option [Seq [(Either [String , os.Path ], bsp4j.Diagnostic )]]
181
181
) extends Build {
182
182
def success : Boolean = false
183
183
def successfulOpt : None .type = None
184
184
def outputOpt : None .type = None
185
185
}
186
186
187
187
final case class Cancelled (
188
- inputs : ModuleInputs ,
189
- options : BuildOptions ,
190
- scope : Scope ,
191
- reason : String
188
+ inputs : Module ,
189
+ options : BuildOptions ,
190
+ scope : Scope ,
191
+ reason : String
192
192
) extends Build {
193
193
def success : Boolean = false
194
194
def successfulOpt : None .type = None
@@ -200,10 +200,10 @@ object Build {
200
200
* Using only the command-line options not the ones from the sources.
201
201
*/
202
202
def updateInputs (
203
- inputs : ModuleInputs ,
204
- options : BuildOptions ,
205
- testOptions : Option [BuildOptions ] = None
206
- ): ModuleInputs = {
203
+ inputs : Module ,
204
+ options : BuildOptions ,
205
+ testOptions : Option [BuildOptions ] = None
206
+ ): Module = {
207
207
208
208
// If some options are manually overridden, append a hash of the options to the project name
209
209
// Using options, not options0 - only the command-line options are taken into account. No hash is
@@ -220,7 +220,7 @@ object Build {
220
220
}
221
221
222
222
private def allInputs (
223
- inputs : ModuleInputs ,
223
+ inputs : Module ,
224
224
options : BuildOptions ,
225
225
logger : Logger
226
226
)(using ScalaCliInvokeData ) =
@@ -237,9 +237,8 @@ object Build {
237
237
)
238
238
239
239
private def build (
240
- inputs : ModuleInputs ,
241
- crossSources : CrossSources ,
242
- options : BuildOptions ,
240
+ inputs : Module ,
241
+ crossSources : CrossSources ,options : BuildOptions ,
243
242
logger : Logger ,
244
243
buildClient : BloopBuildClient ,
245
244
compiler : ScalaCompiler ,
@@ -252,7 +251,7 @@ object Build {
252
251
val sharedOptions = crossSources.sharedOptions(options)
253
252
val crossOptions = sharedOptions.crossOptions
254
253
255
- def doPostProcess (build : Build , inputs : ModuleInputs , scope : Scope ): Unit = build match {
254
+ def doPostProcess (build : Build , inputs : Module , scope : Scope ): Unit = build match {
256
255
case build : Build .Successful =>
257
256
for (sv <- build.project.scalaCompiler.map(_.scalaVersion))
258
257
postProcess(
@@ -431,17 +430,17 @@ object Build {
431
430
}
432
431
433
432
private def build (
434
- inputs : ModuleInputs ,
435
- sources : Sources ,
436
- generatedSources : Seq [GeneratedSource ],
437
- options : BuildOptions ,
438
- scope : Scope ,
439
- logger : Logger ,
440
- buildClient : BloopBuildClient ,
441
- compiler : ScalaCompiler ,
442
- buildTests : Boolean ,
443
- partial : Option [Boolean ],
444
- actionableDiagnostics : Option [Boolean ]
433
+ inputs : Module ,
434
+ sources : Sources ,
435
+ generatedSources : Seq [GeneratedSource ],
436
+ options : BuildOptions ,
437
+ scope : Scope ,
438
+ logger : Logger ,
439
+ buildClient : BloopBuildClient ,
440
+ compiler : ScalaCompiler ,
441
+ buildTests : Boolean ,
442
+ partial : Option [Boolean ],
443
+ actionableDiagnostics : Option [Boolean ]
445
444
)(using ScalaCliInvokeData ): Either [BuildException , Build ] = either {
446
445
447
446
val build0 = value {
@@ -503,9 +502,9 @@ object Build {
503
502
root / Constants .workspaceDirName / projectName.name / s " resources- ${scope.name}"
504
503
505
504
def scalaNativeSupported (
506
- options : BuildOptions ,
507
- inputs : ModuleInputs ,
508
- logger : Logger
505
+ options : BuildOptions ,
506
+ inputs : Module ,
507
+ logger : Logger
509
508
): Either [BuildException , Option [ScalaNativeCompatibilityError ]] =
510
509
either {
511
510
val scalaParamsOpt = value(options.scalaParams)
@@ -562,7 +561,7 @@ object Build {
562
561
}
563
562
564
563
def build (
565
- inputs : ModuleInputs ,
564
+ inputs : Module ,
566
565
options : BuildOptions ,
567
566
compilerMaker : ScalaCompilerMaker ,
568
567
docCompilerMakerOpt : Option [ScalaCompilerMaker ],
@@ -642,16 +641,16 @@ object Build {
642
641
}
643
642
644
643
def watch (
645
- inputs : ModuleInputs ,
646
- options : BuildOptions ,
647
- compilerMaker : ScalaCompilerMaker ,
648
- docCompilerMakerOpt : Option [ScalaCompilerMaker ],
649
- logger : Logger ,
650
- crossBuilds : Boolean ,
651
- buildTests : Boolean ,
652
- partial : Option [Boolean ],
653
- actionableDiagnostics : Option [Boolean ],
654
- postAction : () => Unit = () => ()
644
+ inputs : Module ,
645
+ options : BuildOptions ,
646
+ compilerMaker : ScalaCompilerMaker ,
647
+ docCompilerMakerOpt : Option [ScalaCompilerMaker ],
648
+ logger : Logger ,
649
+ crossBuilds : Boolean ,
650
+ buildTests : Boolean ,
651
+ partial : Option [Boolean ],
652
+ actionableDiagnostics : Option [Boolean ],
653
+ postAction : () => Unit = () => ()
655
654
)(action : Either [BuildException , Builds ] => Unit )(using ScalaCliInvokeData ): Watcher = {
656
655
657
656
val buildClient = BloopBuildClient .create(
@@ -846,15 +845,15 @@ object Build {
846
845
* a bloop [[Project ]]
847
846
*/
848
847
def buildProject (
849
- inputs : ModuleInputs ,
850
- sources : Sources ,
851
- generatedSources : Seq [GeneratedSource ],
852
- options : BuildOptions ,
853
- compilerJvmVersionOpt : Option [Positioned [Int ]],
854
- scope : Scope ,
855
- logger : Logger ,
856
- artifacts : Artifacts ,
857
- maybeRecoverOnError : BuildException => Option [BuildException ] = e => Some (e)
848
+ inputs : Module ,
849
+ sources : Sources ,
850
+ generatedSources : Seq [GeneratedSource ],
851
+ options : BuildOptions ,
852
+ compilerJvmVersionOpt : Option [Positioned [Int ]],
853
+ scope : Scope ,
854
+ logger : Logger ,
855
+ artifacts : Artifacts ,
856
+ maybeRecoverOnError : BuildException => Option [BuildException ] = e => Some (e)
858
857
): Either [BuildException , Project ] = either {
859
858
860
859
val allSources = sources.paths.map(_._1) ++ generatedSources.map(_.generated)
@@ -1038,16 +1037,16 @@ object Build {
1038
1037
}
1039
1038
1040
1039
def prepareBuild (
1041
- inputs : ModuleInputs ,
1042
- sources : Sources ,
1043
- generatedSources : Seq [GeneratedSource ],
1044
- options : BuildOptions ,
1045
- compilerJvmVersionOpt : Option [Positioned [Int ]],
1046
- scope : Scope ,
1047
- compiler : ScalaCompiler ,
1048
- logger : Logger ,
1049
- buildClient : BloopBuildClient ,
1050
- maybeRecoverOnError : BuildException => Option [BuildException ] = e => Some (e)
1040
+ inputs : Module ,
1041
+ sources : Sources ,
1042
+ generatedSources : Seq [GeneratedSource ],
1043
+ options : BuildOptions ,
1044
+ compilerJvmVersionOpt : Option [Positioned [Int ]],
1045
+ scope : Scope ,
1046
+ compiler : ScalaCompiler ,
1047
+ logger : Logger ,
1048
+ buildClient : BloopBuildClient ,
1049
+ maybeRecoverOnError : BuildException => Option [BuildException ] = e => Some (e)
1051
1050
): Either [BuildException , (os.Path , Option [ScalaParameters ], Artifacts , Project , Boolean )] =
1052
1051
either {
1053
1052
@@ -1119,15 +1118,15 @@ object Build {
1119
1118
}
1120
1119
1121
1120
def buildOnce (
1122
- inputs : ModuleInputs ,
1123
- sources : Sources ,
1124
- generatedSources : Seq [GeneratedSource ],
1125
- options : BuildOptions ,
1126
- scope : Scope ,
1127
- logger : Logger ,
1128
- buildClient : BloopBuildClient ,
1129
- compiler : ScalaCompiler ,
1130
- partialOpt : Option [Boolean ]
1121
+ inputs : Module ,
1122
+ sources : Sources ,
1123
+ generatedSources : Seq [GeneratedSource ],
1124
+ options : BuildOptions ,
1125
+ scope : Scope ,
1126
+ logger : Logger ,
1127
+ buildClient : BloopBuildClient ,
1128
+ compiler : ScalaCompiler ,
1129
+ partialOpt : Option [Boolean ]
1131
1130
): Either [BuildException , Build ] = either {
1132
1131
1133
1132
if (options.platform.value == Platform .Native )
@@ -1289,14 +1288,14 @@ object Build {
1289
1288
else path.toString
1290
1289
1291
1290
private def jmhBuild (
1292
- inputs : ModuleInputs ,
1293
- build : Build .Successful ,
1294
- logger : Logger ,
1295
- javaCommand : String ,
1296
- buildClient : BloopBuildClient ,
1297
- compiler : ScalaCompiler ,
1298
- buildTests : Boolean ,
1299
- actionableDiagnostics : Option [Boolean ]
1291
+ inputs : Module ,
1292
+ build : Build .Successful ,
1293
+ logger : Logger ,
1294
+ javaCommand : String ,
1295
+ buildClient : BloopBuildClient ,
1296
+ compiler : ScalaCompiler ,
1297
+ buildTests : Boolean ,
1298
+ actionableDiagnostics : Option [Boolean ]
1300
1299
)(using ScalaCliInvokeData ): Either [BuildException , Option [Build ]] = either {
1301
1300
val jmhProjectName = inputs.projectName.name + " _jmh"
1302
1301
val jmhOutputDir = inputs.workspace / Constants .workspaceDirName / jmhProjectName
0 commit comments