Skip to content

Commit

Permalink
feat(abg): clean up temporary files after jar creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Aug 22, 2024
1 parent dd79813 commit 2c5eb3d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ internal fun ActionCoords.buildJars(types: String?): Jars? {
val pathWithJarContents = compileBinding(sourceFilePaths = sourceFilePaths)
val mainJarByteArrayOutputStream = ByteArrayOutputStream()
mainJarByteArrayOutputStream.createZipFile(pathWithJarContents)
pathWithJarContents.toFile().deleteRecursively()
compilationInputDir.toFile().deleteRecursively()
mainJarByteArrayOutputStream.toByteArray()
}

val sourcesJar by lazy {
val (_, compilationInputDir) = binding.prepareDirectoryWithSources()
val sourcesJarByteArrayOutputStream = ByteArrayOutputStream()
sourcesJarByteArrayOutputStream.createZipFile(compilationInputDir)
compilationInputDir.toFile().deleteRecursively()
sourcesJarByteArrayOutputStream.toByteArray()
}

Expand Down

0 comments on commit 2c5eb3d

Please sign in to comment.