File tree 1 file changed +22
-1
lines changed
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
4
4
import org.jetbrains.compose.desktop.application.tasks.AbstractJPackageTask
5
5
import org.jetbrains.compose.internal.de.undercouch.gradle.tasks.download.Download
6
6
import org.jetbrains.kotlin.fir.scopes.impl.overrides
7
+ import java.io.FileOutputStream
8
+ import java.util.zip.ZipEntry
9
+ import java.util.zip.ZipOutputStream
7
10
8
11
plugins{
9
12
id(" java" )
@@ -415,6 +418,7 @@ tasks.register("signResources"){
415
418
from(zipTree(file))
416
419
into(tempDir)
417
420
}
421
+ file.delete()
418
422
jars.add(tempDir)
419
423
}
420
424
fileTree(resourcesPath){
@@ -436,7 +440,24 @@ tasks.register("signResources"){
436
440
}
437
441
doLast {
438
442
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
+ }
440
461
441
462
file.deleteRecursively()
442
463
}
You can’t perform that action at this time.
0 commit comments