@@ -4,9 +4,7 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
44import org.jetbrains.compose.desktop.application.dsl.TargetFormat
55import org.jetbrains.compose.desktop.application.tasks.AbstractJPackageTask
66import org.jetbrains.compose.internal.de.undercouch.gradle.tasks.download.Download
7- import java.io.FileOutputStream
8- import java.util.zip.ZipEntry
9- import java.util.zip.ZipOutputStream
7+ import processing.gradle.SignResourcesTask
108
119// TODO: Update to 2.10.20 and add hot-reloading: https://github.com/JetBrains/compose-hot-reload
1210
@@ -49,14 +47,17 @@ compose.desktop {
4947 application {
5048 mainClass = " processing.app.ProcessingKt"
5149
52- jvmArgs(* listOf (
53- Pair (" processing.version" , rootProject.version),
54- Pair (" processing.revision" , findProperty(" revision" ) ? : Int .MAX_VALUE ),
55- Pair (" processing.contributions.source" , " https://contributions.processing.org/contribs" ),
56- Pair (" processing.download.page" , " https://processing.org/download/" ),
57- Pair (" processing.download.latest" , " https://processing.org/download/latest.txt" ),
58- Pair (" processing.tutorials" , " https://processing.org/tutorials/" ),
59- ).map { " -D${it.first} =${it.second} " }.toTypedArray())
50+ jvmArgs(
51+ " --enable-native-access=ALL-UNNAMED" , // Required for Java 25 native library access
52+ * listOf (
53+ Pair (" processing.version" , rootProject.version),
54+ Pair (" processing.revision" , findProperty(" revision" ) ? : Int .MAX_VALUE ),
55+ Pair (" processing.contributions.source" , " https://contributions.processing.org/contribs" ),
56+ Pair (" processing.download.page" , " https://processing.org/download/" ),
57+ Pair (" processing.download.latest" , " https://processing.org/download/latest.txt" ),
58+ Pair (" processing.tutorials" , " https://processing.org/tutorials/" ),
59+ ).map { " -D${it.first} =${it.second} " }.toTypedArray()
60+ )
6061
6162 nativeDistributions{
6263 modules(" jdk.jdi" , " java.compiler" , " jdk.accessibility" , " java.management.rmi" , " java.scripting" , " jdk.httpserver" )
@@ -421,82 +422,14 @@ tasks.register("includeProcessingResources"){
421422 finalizedBy(" signResources" )
422423}
423424
424- tasks.register(" signResources" ){
425+ tasks.register< SignResourcesTask > (" signResources" ) {
425426 onlyIf {
426427 OperatingSystem .current().isMacOsX
427428 &&
428429 compose.desktop.application.nativeDistributions.macOS.signing.sign.get()
429430 }
430431 group = " compose desktop"
431- val resourcesPath = composeResources(" " )
432-
433- // find jars in the resources directory
434- val jars = mutableListOf<File >()
435- doFirst{
436- fileTree(resourcesPath)
437- .matching { include(" **/Info.plist" ) }
438- .singleOrNull()
439- ?.let { file ->
440- copy {
441- from(file)
442- into(resourcesPath)
443- }
444- }
445- fileTree(resourcesPath) {
446- include(" **/*.jar" )
447- exclude(" **/*.jar.tmp/**" )
448- }.forEach { file ->
449- val tempDir = file.parentFile.resolve(" ${file.name} .tmp" )
450- copy {
451- from(zipTree(file))
452- into(tempDir)
453- }
454- file.delete()
455- jars.add(tempDir)
456- }
457- fileTree(resourcesPath){
458- include(" **/bin/**" )
459- include(" **/*.jnilib" )
460- include(" **/*.dylib" )
461- include(" **/*aarch64*" )
462- include(" **/*x86_64*" )
463- include(" **/*ffmpeg*" )
464- include(" **/ffmpeg*/**" )
465- exclude(" jdk/**" )
466- exclude(" *.jar" )
467- exclude(" *.so" )
468- exclude(" *.dll" )
469- }.forEach{ file ->
470- exec {
471- commandLine(" codesign" , " --timestamp" , " --force" , " --deep" ," --options=runtime" , " --sign" , " Developer ID Application" , file)
472- }
473- }
474- jars.forEach { file ->
475- FileOutputStream (File (file.parentFile, file.nameWithoutExtension)).use { fos ->
476- ZipOutputStream (fos).use { zos ->
477- file.walkTopDown().forEach { fileEntry ->
478- if (fileEntry.isFile) {
479- // Calculate the relative path for the zip entry
480- val zipEntryPath = fileEntry.relativeTo(file).path
481- val entry = ZipEntry (zipEntryPath)
482- zos.putNextEntry(entry)
483-
484- // Copy file contents to the zip
485- fileEntry.inputStream().use { input ->
486- input.copyTo(zos)
487- }
488- zos.closeEntry()
489- }
490- }
491- }
492- }
493-
494- file.deleteRecursively()
495- }
496- file(composeResources(" Info.plist" )).delete()
497- }
498-
499-
432+ resourcesPath.set(composeResources(" " ))
500433}
501434tasks.register(" setExecutablePermissions" ) {
502435 description = " Sets executable permissions on binaries in Processing.app resources"
0 commit comments