Skip to content

Commit

Permalink
Replace bool options with flags in mac crafter
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra committed Jun 24, 2024
1 parent d4beaba commit f1a66cd
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions admin/osx/mac-crafter/Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,34 @@ struct MacCrafter: ParsableCommand {
@Option(name: [.long], help: "Build type (e.g. Release, RelWithDebInfo, MinSizeRel, Debug).")
var buildType = "RelWithDebInfo"

@Option(name: [.long], help: "Reconfigure craft.")
var reconfigureCraft = false

@Option(name: [.long], help: "The application's branded name.")
var appName = "Nextcloud"

@Option(name: [.long], help: "Build with Sparkle auto-updater.")
var buildAutoUpdater = true

@Option(name: [.long], help: "Sparkle download URL.")
var sparkleDownloadUrl =
"https://github.com/sparkle-project/Sparkle/releases/download/1.27.3/Sparkle-1.27.3.tar.xz"

@Option(name: [.long], help: "Build App Bundle.")
var buildAppBundle = true
@Option(name: [.long], help: "Git clone command; include options such as depth.")
var gitCloneCommand = "git clone --depth=1"

@Flag(help: "Reconfigure KDE Craft.")
var reconfigureCraft = false

@Flag(help: "Build test suite.")
var buildTests = false

@Flag(name: [.long], help: "Do not build App Bundle.")
var disableAppBundle = false

@Option(name: [.long], help: "Build File Provider Module.")
@Flag(help: "Build File Provider Module.")
var buildFileProviderModule = false

@Option(name: [.long], help: "Git clone command; include options such as depth.")
var gitCloneCommand = "git clone --depth=1"
@Flag(help: "Build without Sparkle auto-updater.")
var disableAutoUpdater = false

@Option(name: [.long], help: "Run a full rebuild.")
@Flag(help: "Run a full rebuild.")
var fullRebuild = false

@Option(name: [.long], help: "Build test suite.")
var buildTests = true

mutating func run() throws {
print("Configuring build tooling.")

Expand Down Expand Up @@ -138,11 +138,11 @@ struct MacCrafter: ParsableCommand {
var craftOptions = [
"\(craftBlueprintName).srcDir=\(repoRootDir)",
"\(craftBlueprintName).buildTests=\(buildTests ? "True" : "False")",
"\(craftBlueprintName).buildMacOSBundle=\(buildAppBundle ? "True" : "False")",
"\(craftBlueprintName).buildMacOSBundle=\(disableAppBundle ? "False" : "True")",
"\(craftBlueprintName).buildFileProviderModule=\(buildFileProviderModule ? "True" : "False")"
]

if buildAutoUpdater {
if !disableAutoUpdater {
print("Configuring Sparkle auto-updater.")

let fm = FileManager.default
Expand Down Expand Up @@ -176,7 +176,7 @@ struct MacCrafter: ParsableCommand {
}
}

let buildMode = fullRebuild ? "-i" : buildAppBundle ? "--compile --install" : "--compile"
let buildMode = fullRebuild ? "-i" : disableAppBundle ? "compile" : "--compile --install"
guard shell(
"\(craftCommand) --buildtype \(buildType) \(buildMode) \(allOptionsString) \(craftBlueprintName)"
) == 0 else {
Expand Down

0 comments on commit f1a66cd

Please sign in to comment.