@@ -305,9 +305,7 @@ object Build {
305
305
testDocOpt : Option [Build ]
306
306
)
307
307
308
- def doBuild (
309
- overrideOptions : BuildOptions
310
- ): Either [BuildException , NonCrossBuilds ] = either {
308
+ def doBuild (overrideOptions : BuildOptions ): Either [BuildException , NonCrossBuilds ] = either {
311
309
312
310
val inputs0 = updateInputs(
313
311
inputs,
@@ -685,9 +683,9 @@ object Build {
685
683
val threads = BuildThreads .create()
686
684
val classesDir0 = classesRootDir(inputs.workspace, inputs.projectName)
687
685
val info = either {
688
- val (crossSources, inputs0) = value(allInputs(inputs, options, logger))
689
- val sharedOptions = crossSources.sharedOptions(options)
690
- val compiler = value {
686
+ val (crossSources : CrossSources , inputs0 : Inputs ) = value(allInputs(inputs, options, logger))
687
+ val sharedOptions = crossSources.sharedOptions(options)
688
+ val compiler : ScalaCompiler = value {
691
689
compilerMaker.create(
692
690
inputs0.workspace / Constants .workspaceDirName,
693
691
classesDir0,
@@ -696,7 +694,7 @@ object Build {
696
694
sharedOptions
697
695
)
698
696
}
699
- val docCompilerOpt = docCompilerMakerOpt.map(_.create(
697
+ val docCompilerOpt : Option [ ScalaCompiler ] = docCompilerMakerOpt.map(_.create(
700
698
inputs0.workspace / Constants .workspaceDirName,
701
699
classesDir0,
702
700
buildClient,
@@ -711,20 +709,26 @@ object Build {
711
709
def run (): Unit = {
712
710
try {
713
711
res =
714
- info.flatMap { case (compiler, docCompilerOpt, crossSources, inputs) =>
715
- build(
716
- inputs,
717
- crossSources,
718
- options,
719
- logger,
720
- buildClient,
721
- compiler,
722
- docCompilerOpt,
723
- crossBuilds = crossBuilds,
724
- buildTests = buildTests,
725
- partial = partial,
726
- actionableDiagnostics = actionableDiagnostics
727
- )
712
+ info.flatMap {
713
+ case (
714
+ compiler : ScalaCompiler ,
715
+ docCompilerOpt : Option [ScalaCompiler ],
716
+ crossSources : CrossSources ,
717
+ inputs : Inputs
718
+ ) =>
719
+ build(
720
+ inputs = inputs,
721
+ crossSources = crossSources,
722
+ options = options,
723
+ logger = logger,
724
+ buildClient = buildClient,
725
+ compiler = compiler,
726
+ docCompilerOpt = docCompilerOpt,
727
+ crossBuilds = crossBuilds,
728
+ buildTests = buildTests,
729
+ partial = partial,
730
+ actionableDiagnostics = actionableDiagnostics
731
+ )
728
732
}
729
733
action(res)
730
734
}
@@ -742,7 +746,7 @@ object Build {
742
746
743
747
def doWatch (): Unit = {
744
748
val elements : Seq [Element ] =
745
- if ( res == null ) inputs.elements
749
+ if res == null then inputs.elements
746
750
else
747
751
res
748
752
.map { builds =>
@@ -777,10 +781,7 @@ object Build {
777
781
case _ : Virtual =>
778
782
}
779
783
watcher0.addObserver {
780
- onChangeBufferedObserver { event =>
781
- if (eventFilter(event))
782
- watcher.schedule()
783
- }
784
+ onChangeBufferedObserver(event => if eventFilter(event) then watcher.schedule())
784
785
}
785
786
}
786
787
@@ -797,14 +798,10 @@ object Build {
797
798
}
798
799
.getOrElse(Nil )
799
800
for (artifact <- artifacts) {
800
- val depth = if ( os.isFile(artifact)) - 1 else Int .MaxValue
801
+ val depth = if os.isFile(artifact) then - 1 else Int .MaxValue
801
802
val watcher0 = watcher.newWatcher()
802
803
watcher0.register(artifact.toNIO, depth)
803
- watcher0.addObserver {
804
- onChangeBufferedObserver { _ =>
805
- watcher.schedule()
806
- }
807
- }
804
+ watcher0.addObserver(onChangeBufferedObserver(_ => watcher.schedule()))
808
805
}
809
806
}
810
807
0 commit comments