Skip to content

Commit 02041f4

Browse files
committed
fix for #1507 - mac signing issues for release builds
fixes issue with Mac app notarization failure by signing the whole app again after fileAssocations are made. previously, release builds were failing because the .icns files for .pde, .pdex, and .pdez were added to the .app file after signing.
1 parent c6090d5 commit 02041f4

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

app/build.gradle.kts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ tasks.register<Exec>("packageCustomDmg"){
186186
onlyIf { OperatingSystem.current().isMacOsX }
187187
group = "compose desktop"
188188

189-
dependsOn(distributable(), "installCreateDmg")
189+
dependsOn("signApp", "installCreateDmg")
190190

191191
val packageName = distributable().packageName.get()
192192
val dir = distributable().destinationDir.get()
@@ -571,9 +571,35 @@ tasks.register("signResources"){
571571
}
572572
file(composeResources("Info.plist")).delete()
573573
}
574+
}
574575

576+
/* for mac, perform one final signature of the whole app before submitting
577+
* the app for notarization.
578+
*/
579+
tasks.register<Exec>("signApp"){
580+
onlyIf {
581+
OperatingSystem.current().isMacOsX
582+
&&
583+
compose.desktop.application.nativeDistributions.macOS.signing.sign.get()
584+
}
575585

586+
group = "compose desktop"
587+
dependsOn("createDistributable", "setExecutablePermissions")
588+
589+
val packageName = distributable().packageName.get()
590+
val dir = distributable().destinationDir.get()
591+
val app = dir.file("$packageName.app").asFile
592+
593+
commandLine(
594+
"codesign",
595+
"--timestamp",
596+
"--force",
597+
"--deep",
598+
"--options=runtime",
599+
"--sign", "Developer ID Application",
600+
app)
576601
}
602+
577603
tasks.register("setExecutablePermissions") {
578604
description = "Sets executable permissions on binaries in Processing.app resources"
579605
group = "compose desktop"

0 commit comments

Comments
 (0)