Skip to content

Commit 8bcfaa0

Browse files
committed
Fix copying sources for stdlib-bootstrapped
1 parent e22cf05 commit 8bcfaa0

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

project/Build.scala

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -887,22 +887,28 @@ object Build {
887887

888888
// NOTE `sourceDirectory` is used for actual copying,
889889
// but `sources` are used as cache keys
890-
val dottyLibSourceDir = (`scala3-library-bootstrapped`/sourceDirectory).value
891-
val dottyLibSources = (`scala3-library-bootstrapped`/Compile/sources).value
890+
val dottyLibSourceDirs = (`scala3-library-bootstrapped`/Compile/unmanagedSourceDirectories).value
891+
def dottyLibSources = dottyLibSourceDirs.foldLeft(PathFinder.empty) { (pf, dir) =>
892+
if (!dir.exists) pf else pf +++ (dir ** "*.scala") +++ (dir ** "*.java")
893+
}
892894

893895
val cachedFun = FileFunction.cached(
894896
cacheDir / s"copyDottyLibrarySrc",
895897
FilesInfo.lastModified,
896898
FilesInfo.exists,
897899
) { _ =>
898-
s.log.info(s"Copying scala3-library sources from $dottyLibSourceDir to $trgDir...")
899900
if (trgDir.exists) IO.delete(trgDir)
900-
IO.copyDirectory(dottyLibSourceDir, trgDir)
901+
dottyLibSourceDirs.foreach { dir =>
902+
if (dir.exists) {
903+
s.log.info(s"Copying scala3-library sources from $dir to $trgDir...")
904+
IO.copyDirectory(dir, trgDir)
905+
}
906+
}
901907

902908
((trgDir ** "*.scala") +++ (trgDir ** "*.java")).get.toSet
903909
}
904910

905-
cachedFun(dottyLibSources.toSet).toSeq
911+
cachedFun(dottyLibSources.get.toSet).toSeq
906912
}.taskValue,
907913
sources in Compile ~= (_.filterNot(file =>
908914
// sources from https://github.com/scala/scala/tree/2.13.x/src/library-aux

0 commit comments

Comments
 (0)