Add procedure to codesign app bundle in mac crafter
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 20 Jun 2024 10:11:33 +0000 (18:11 +0800)
committerClaudio Cambra <developer@claudiocambra.com>
Mon, 8 Jul 2024 07:41:45 +0000 (15:41 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
admin/osx/mac-crafter/Sources/main.swift

index ee4d7cc41d0052a723e1b45b69c0a6928575bf41..d35322d70322b8618bcdf6804119a96bc939b266 100644 (file)
@@ -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)
+        }
     }
 }