Skip to content

Commit 6c8ae7b

Browse files
committed
Allow overwriting sources in stdlib-bootstrapped
1 parent f7d664d commit 6c8ae7b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

project/Build.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,13 @@ object Build {
974974
file.getPath.endsWith("scala-library-src/scala/Nothing.scala") ||
975975
file.getPath.endsWith("scala-library-src/scala/Null.scala") ||
976976
file.getPath.endsWith("scala-library-src/scala/Singleton.scala"))),
977+
(Compile / sources) := {
978+
val files = (Compile / sources).value
979+
val overwritenSourcesDir = (Compile / scalaSource).value
980+
val overwritenSources = files.flatMap(_.relativeTo(overwritenSourcesDir)).toSet
981+
val reference = (Compile/sourceManaged).value / "scala-library-src"
982+
files.filterNot(_.relativeTo(reference).exists(overwritenSources))
983+
},
977984
(Test / managedClasspath) ~= {
978985
_.filterNot(file => file.data.getName == s"scala-library-${stdlibVersion(Bootstrapped)}.jar")
979986
},

0 commit comments

Comments
 (0)