Skip to content

Commit 8f60a5c

Browse files
committed
.
1 parent c9467f2 commit 8f60a5c

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

project/Build.scala

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,8 @@ object Build {
12971297
assembly / assemblyExcludedJars := {
12981298
(assembly / fullClasspath).value.filter { jar =>
12991299
val name = jar.data.getName
1300-
1300+
// Filter out the `scala-library` here otherwise it conflicts with the
1301+
// `scala-library` pulled in via `assembly / fullClasspath`
13011302
name.contains("scala-library") ||
13021303
// Avoid shading JLine because shading it causes problems with
13031304
// its service discovery and JNI-related logic
@@ -1318,28 +1319,27 @@ object Build {
13181319
val shadedDir = tmpDir / "dotty" / "isolated"
13191320
IO.createDirectory(shadedDir)
13201321

1321-
(tmpDir ** "*").get.foreach { file =>
1322-
if (file.isFile) {
1323-
val relativePath = file.relativeTo(tmpDir).get.getPath
1324-
1325-
val shouldKeepInPlace =
1326-
relativePath.startsWith("scala/tools/repl/")||
1327-
// These are manually shaded so leave them alone
1328-
relativePath.startsWith("dotty/shaded/") ||
1329-
// This needs to be inside scala/collection so cannot be moved
1330-
relativePath.startsWith("scala/collection/internal/pprint/")
1331-
1332-
if (!shouldKeepInPlace) {
1333-
val newPath = shadedDir / relativePath
1334-
IO.createDirectory(newPath.getParentFile)
1335-
IO.move(file, newPath)
1336-
}
1322+
for(file <- (tmpDir ** "*").get if file.isFile) {
1323+
val relativePath = file.relativeTo(tmpDir).get.getPath
1324+
1325+
val shouldKeepInPlace =
1326+
relativePath.startsWith("scala/tools/repl/")||
1327+
// These are manually shaded so leave them alone
1328+
relativePath.startsWith("dotty/shaded/") ||
1329+
// This needs to be inside scala/collection so cannot be moved
1330+
relativePath.startsWith("scala/collection/internal/pprint/")
1331+
1332+
if (!shouldKeepInPlace) {
1333+
val newPath = shadedDir / relativePath
1334+
IO.createDirectory(newPath.getParentFile)
1335+
IO.move(file, newPath)
13371336
}
13381337
}
13391338

1340-
val filesToZip = (tmpDir ** "*").get.filter(_.isFile).map { f =>
1341-
(f, f.relativeTo(tmpDir).get.getPath)
1342-
}
1339+
val filesToZip =
1340+
for(f <- (tmpDir ** "*").get if f.isFile)
1341+
yield (f, f.relativeTo(tmpDir).get.getPath)
1342+
13431343
IO.zip(filesToZip, originalJar, None)
13441344

13451345
log.info(s"Assembly post-processing complete")

0 commit comments

Comments
 (0)