File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
44import org.jetbrains.compose.desktop.application.tasks.AbstractJPackageTask
55import org.jetbrains.compose.internal.de.undercouch.gradle.tasks.download.Download
66import org.jetbrains.kotlin.fir.scopes.impl.overrides
7+ import java.io.FileOutputStream
8+ import java.util.zip.ZipEntry
9+ import java.util.zip.ZipOutputStream
710
811plugins{
912 id(" java" )
@@ -415,6 +418,7 @@ tasks.register("signResources"){
415418 from(zipTree(file))
416419 into(tempDir)
417420 }
421+ file.delete()
418422 jars.add(tempDir)
419423 }
420424 fileTree(resourcesPath){
@@ -436,7 +440,24 @@ tasks.register("signResources"){
436440 }
437441 doLast {
438442 jars.forEach { file ->
439- zipTo(file.resolve(file.nameWithoutExtension), file)
443+ FileOutputStream (File (file.parentFile, file.nameWithoutExtension)).use { fos ->
444+ ZipOutputStream (fos).use { zos ->
445+ file.walkTopDown().forEach { fileEntry ->
446+ if (fileEntry.isFile) {
447+ // Calculate the relative path for the zip entry
448+ val zipEntryPath = fileEntry.relativeTo(file).path
449+ val entry = ZipEntry (zipEntryPath)
450+ zos.putNextEntry(entry)
451+
452+ // Copy file contents to the zip
453+ fileEntry.inputStream().use { input ->
454+ input.copyTo(zos)
455+ }
456+ zos.closeEntry()
457+ }
458+ }
459+ }
460+ }
440461
441462 file.deleteRecursively()
442463 }
You can’t perform that action at this time.
0 commit comments