]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Add flag to build pkg in mac-crafter
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 19 Sep 2024 13:00:15 +0000 (21:00 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 23 Sep 2024 08:30:10 +0000 (16:30 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
admin/osx/mac-crafter/Sources/main.swift

index 0492d9fc527b86d1ca587432eaacae5a945d60f9..1efe1e99203195e28aaa65bd1fe16520970a620b 100644 (file)
@@ -86,6 +86,9 @@ struct Build: ParsableCommand {
     @Flag(help: "Run a full rebuild.")
     var fullRebuild = false
 
+    @Flag(help: "Create an installer package.")
+    var package = false
+
     mutating func run() throws {
         print("Configuring build tooling.")
 
@@ -175,6 +178,7 @@ struct Build: ParsableCommand {
 
         let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ")
 
+        let buildWorkPath = "\(buildPath)/\(craftTarget)/build"
         let clientBuildDir = "\(buildPath)/\(craftTarget)/build/\(craftBlueprintName)"
         if fullRebuild {
             do {
@@ -209,6 +213,11 @@ struct Build: ParsableCommand {
         }
         try fm.copyItem(atPath: clientAppDir, toPath: "\(productPath)/\(appName).app")
 
+        if package {
+            let packagePath =
+                try buildPackage(buildWorkPath: buildWorkPath, productPath: productPath)
+        }
+
         print("Done!")
     }
 }