@@ -10,7 +10,7 @@ import java.nio.charset.StandardCharsets
10
10
import java .nio .file .Path
11
11
import java .util .Arrays
12
12
13
- import scala .build .options .Scope
13
+ import scala .build .options .{ ScalacOpt , Scope , ShadowingSeq }
14
14
15
15
final case class Project (
16
16
workspace : os.Path ,
@@ -46,7 +46,7 @@ final case class Project(
46
46
}
47
47
val scalaConfigOpt = scalaCompiler.map { scalaCompiler0 =>
48
48
bloopScalaConfig(" org.scala-lang" , " scala-compiler" , scalaCompiler0.scalaVersion).copy(
49
- options = scalaCompiler0.scalacOptions.toList ,
49
+ options = updateScalacOptions( scalaCompiler0.scalacOptions).map(_.value) ,
50
50
jars = scalaCompiler0.compilerClassPath.map(_.toNIO).toList
51
51
)
52
52
}
@@ -72,6 +72,21 @@ final case class Project(
72
72
def bloopFile : BloopConfig .File =
73
73
BloopConfig .File (BloopConfig .File .LatestVersion , bloopProject)
74
74
75
+ private def updateScalacOptions (scalacOptions : Seq [String ]): List [ScalacOpt ] =
76
+ ShadowingSeq .from(scalacOptions.map(ScalacOpt (_))).values.map { l =>
77
+ // only look at the head, the tail is only values passed to it
78
+ l.headOption match {
79
+ case Some (opt) if opt.value.startsWith(" -coverage-out:" ) =>
80
+ // actual -coverage-out: option
81
+ val maybeRelativePath = opt.value.stripPrefix(" -coverage-out:" )
82
+ val absolutePath = os.Path (maybeRelativePath, Os .pwd)
83
+ ScalacOpt (s " -coverage-out: $absolutePath" ) +: l.tail
84
+ case _ =>
85
+ // not a -coverage-out: option
86
+ l
87
+ }
88
+ }.flatten.toList
89
+
75
90
private def maybeUpdateInputs (logger : Logger ): Boolean = {
76
91
val dest = directory / " .bloop" / s " $projectName.inputs.txt "
77
92
val onDiskOpt =
0 commit comments