From a1add7235d1064f6d926e6663ab2407e851a57bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kautler?= Date: Tue, 20 Aug 2024 12:17:13 +0200 Subject: [PATCH] feat(abg): clean up temporary files after jar creation --- .../typesafegithub/workflows/mavenbinding/JarBuilding.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/maven-binding-builder/src/main/kotlin/io/github/typesafegithub/workflows/mavenbinding/JarBuilding.kt b/maven-binding-builder/src/main/kotlin/io/github/typesafegithub/workflows/mavenbinding/JarBuilding.kt index 6cdab4122a..b3a13e26e4 100644 --- a/maven-binding-builder/src/main/kotlin/io/github/typesafegithub/workflows/mavenbinding/JarBuilding.kt +++ b/maven-binding-builder/src/main/kotlin/io/github/typesafegithub/workflows/mavenbinding/JarBuilding.kt @@ -37,6 +37,8 @@ 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() } @@ -44,6 +46,7 @@ internal fun ActionCoords.buildJars(types: String?): Jars? { val (_, compilationInputDir) = binding.prepareDirectoryWithSources() val sourcesJarByteArrayOutputStream = ByteArrayOutputStream() sourcesJarByteArrayOutputStream.createZipFile(compilationInputDir) + compilationInputDir.toFile().deleteRecursively() sourcesJarByteArrayOutputStream.toByteArray() }