Skip to content

Commit

Permalink
Merge pull request #96 from openmole/memory
Browse files Browse the repository at this point in the history
Reduce pressure on GC by using a Traversable instead of a Seq
  • Loading branch information
mdedetrich authored Nov 1, 2023
2 parents 65ad38f + 2378ab7 commit 2a32f3c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/scala/com/typesafe/sbt/osgi/Osgi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ private object Osgi {
val manifest = jar.getManifest
jar.writeFolder(tmpArtifactDirectoryPath)

def content =
sbt.Path.contentOf(tmpArtifactDirectoryPath).filterNot { case (_, p) => p == "META-INF/MANIFEST.MF" }
def content = {
import _root_.java.nio.file._
import _root_.scala.collection.JavaConverters._
val path = tmpArtifactDirectoryPath.toPath
Files.walk(path).iterator.asScala.map(f => f.toFile -> path.relativize(f).toString).filterNot { case (_, p) => p == "META-INF/MANIFEST.MF" }.toTraversable
}

IO.jar(content, tmpArtifactPath, manifest)
IO.delete(tmpArtifactDirectoryPath)
Expand Down

0 comments on commit 2a32f3c

Please sign in to comment.