Skip to content

Commit dfc1e5a

Browse files
committed
Sign bundled resources/executables
[skip ci]
1 parent 678e1a9 commit dfc1e5a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

app/build.gradle.kts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,18 @@ tasks.register<Copy>("renameWindres") {
382382
duplicatesStrategy = DuplicatesStrategy.INCLUDE
383383
into(dir)
384384
}
385+
tasks.register<Exec>("signResources"){
386+
val distributable = tasks.named<AbstractJPackageTask>("createDistributable").get()
387+
dependsOn(distributable)
388+
389+
commandLine(
390+
"codesign",
391+
"--force",
392+
"--deep",
393+
"--sign", "Developer ID Application",
394+
distributable.destinationDir.get().file(distributable.packageName.get() + ".app").asFile
395+
)
396+
}
385397
afterEvaluate {
386398
tasks.named("prepareAppResources").configure {
387399
dependsOn(
@@ -394,6 +406,7 @@ afterEvaluate {
394406
"includeJavaModeResources",
395407
"renameWindres"
396408
)
409+
finalizedBy()
397410
}
398411
tasks.register("setExecutablePermissions") {
399412
description = "Sets executable permissions on binaries in Processing.app resources"
@@ -414,5 +427,5 @@ afterEvaluate {
414427
}
415428
}
416429
}
417-
tasks.findByName("createDistributable")?.finalizedBy("setExecutablePermissions")
430+
tasks.findByName("createDistributable")?.finalizedBy("setExecutablePermissions", "signResources")
418431
}

0 commit comments

Comments
 (0)