@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.")
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
}
}
- 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 {