Skip to content

Commit 64ea0b6

Browse files
kjhollenStefterv
authored andcommitted
fix for processing#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 5164116 commit 64ea0b6

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()
@@ -590,9 +590,35 @@ tasks.register("signResources"){
590590
}
591591
file(composeResources("Info.plist")).delete()
592592
}
593+
}
593594

595+
/* for mac, perform one final signature of the whole app before submitting
596+
* the app for notarization.
597+
*/
598+
tasks.register<Exec>("signApp"){
599+
onlyIf {
600+
OperatingSystem.current().isMacOsX
601+
&&
602+
compose.desktop.application.nativeDistributions.macOS.signing.sign.get()
603+
}
604+
605+
group = "compose desktop"
606+
dependsOn("createDistributable", "setExecutablePermissions")
594607

608+
val packageName = distributable().packageName.get()
609+
val dir = distributable().destinationDir.get()
610+
val app = dir.file("$packageName.app").asFile
611+
612+
commandLine(
613+
"codesign",
614+
"--timestamp",
615+
"--force",
616+
"--deep",
617+
"--options=runtime",
618+
"--sign", "Developer ID Application",
619+
app)
595620
}
621+
596622
tasks.register("setExecutablePermissions") {
597623
description = "Sets executable permissions on binaries in Processing.app resources"
598624
group = "compose desktop"

0 commit comments

Comments
 (0)