Skip to content

Commit 0acd7bc

Browse files
committed
Allow overwriting sources in stdlib-2_13-bootstrapped and stdlib-bootstrap
1 parent 255383f commit 0acd7bc

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
@@ -1040,6 +1040,13 @@ object Build {
10401040
file.getPath.endsWith("scala-library-src/scala/Nothing.scala") ||
10411041
file.getPath.endsWith("scala-library-src/scala/Null.scala") ||
10421042
file.getPath.endsWith("scala-library-src/scala/Singleton.scala"))),
1043+
(Compile / sources) := {
1044+
val files = (Compile / sources).value
1045+
val overwritenSourcesDir = (Compile / scalaSource).value
1046+
val overwritenSources = files.flatMap(_.relativeTo(overwritenSourcesDir)).toSet
1047+
val reference = (Compile/sourceManaged).value / "scala-library-src"
1048+
files.filterNot(_.relativeTo(reference).exists(overwritenSources))
1049+
},
10431050
(Test / managedClasspath) ~= {
10441051
_.filterNot(file => file.data.getName == s"scala-library-${stdlibVersion(Bootstrapped)}.jar")
10451052
},

0 commit comments

Comments
 (0)