Improve build mode flag handling in mac crafter
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Sat, 22 Jun 2024 09:29:21 +0000 (17:29 +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 96f0e108b5e5303f91db96c6ef2aa7c51b89604e..4dec3941c9daf788ccd96c4cd70b716692508317 100644 (file)
@@ -73,6 +73,9 @@ struct MacCrafter: ParsableCommand {
     @Option(name: [.long], help: "Git clone command; include options such as depth.")
     var gitCloneCommand = "git clone --depth=1"
 
+    @Option(name: [.long], help: "Run a full rebuild.")
+    var fullRebuild = false
+
     mutating func run() throws {
         print("Configuring build tooling.")
 
@@ -160,8 +163,9 @@ struct MacCrafter: ParsableCommand {
 
         let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ")
         
+        let buildMode = fullRebuild ? "-i" : buildAppBundle ? "--compile --install" : "--compile"
         guard shell(
-            "\(craftCommand) --buildtype \(buildType) --compile --install \(allOptionsString) \(craftBlueprintName)"
+            "\(craftCommand) --buildtype \(buildType) \(buildMode) \(allOptionsString) \(craftBlueprintName)"
         ) == 0 else {
             throw MacCrafterError.craftError("Error crafting Nextcloud Desktop Client.")
         }