From a9196609b0683f41fa44ba3470652eee86bdead8 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 20 Jun 2024 18:11:33 +0800 Subject: [PATCH] Add procedure to codesign app bundle in mac crafter Signed-off-by: Claudio Cambra --- admin/osx/mac-crafter/Sources/main.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index ee4d7cc41d..d35322d703 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -48,6 +48,9 @@ struct MacCrafter: ParsableCommand { @Option(name: [.long], help: "Skip code-signing dependency libraries and plugins.") var skipDependencyCodeSigning = false + @Option(name: [.long], help: "The application's branded name.") + var appName = "Nextcloud" + mutating func run() throws { print("Configuring build tooling.") @@ -113,6 +116,12 @@ struct MacCrafter: ParsableCommand { print("Crafting Nextcloud Desktop Client...") shell("\(craftCommand) --src-dir \(repoRootDir) -i --build-type \(buildType) nextcloud-client") + + if let codeSignIdentity { + let clientAppDir = + "\(buildPath)/\(craftTarget)/build/nextcloud-client/image-\(buildType)-master/\(appName).app" + try codesign(identity: codeSignIdentity, path: clientAppDir) + } } }