From 503bd966f8044f3530a01f369cbc48442cc3b97f Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 20 Jun 2024 18:46:44 +0800 Subject: [PATCH] Add option to skip craft configuration in mac crafter Signed-off-by: Claudio Cambra --- .../osx/mac-crafter/Sources/Craft/Build.swift | 8 ++++ admin/osx/mac-crafter/Sources/main.swift | 44 +++++++++++-------- 2 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 admin/osx/mac-crafter/Sources/Craft/Build.swift diff --git a/admin/osx/mac-crafter/Sources/Craft/Build.swift b/admin/osx/mac-crafter/Sources/Craft/Build.swift new file mode 100644 index 000000000..da7f9a986 --- /dev/null +++ b/admin/osx/mac-crafter/Sources/Craft/Build.swift @@ -0,0 +1,8 @@ +// +// File.swift +// +// +// Created by Claudio Cambra on 20/6/24. +// + +import Foundation diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index 48280d367..7a40f0731 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -49,6 +49,9 @@ struct MacCrafter: ParsableCommand { @Option(name: [.long], help: "Skip code-signing dependency libraries and plugins.") var skipDependencyCodeSigning = false + @Option(name: [.long], help: "Skip craft configuration.") + var skipCraftConfiguration = false + @Option(name: [.long], help: "The application's branded name.") var appName = "Nextcloud" @@ -71,34 +74,36 @@ struct MacCrafter: ParsableCommand { try installIfMissing("python3", "brew install pyenv && pyenv install 3.12.4") print("Build tooling configured.") - print("Configuring KDE Craft.") - let craftMasterDir = "\(buildPath)/craftmaster" let fm = FileManager.default - - if fm.fileExists(atPath: craftMasterDir) { - print("KDE Craft is already cloned.") - } else { - print("Cloning KDE Craft...") - shell("git clone --depth=1 \(craftMasterGitUrl) \(craftMasterDir)") - } - - print("Configuring Nextcloud Desktop Client blueprints for KDE Craft...") - + let craftMasterDir = "\(buildPath)/craftmaster" let craftMasterIni = "\(repoRootDir)/craftmaster.ini" let craftMasterPy = "\(craftMasterDir)/CraftMaster.py" let craftTarget = "macos-clang-arm64" - let craftCommand = + let craftCommand = "python3 \(craftMasterPy) --config \(craftMasterIni) --target \(craftTarget) -c" - shell("\(craftCommand) --add-blueprint-repository \(clientBlueprintsGitUrl)") - print("Crafting KDE Craft...") - shell("\(craftCommand) craft") + if !skipCraftConfiguration { + print("Configuring KDE Craft.") + + if fm.fileExists(atPath: craftMasterDir) { + print("KDE Craft is already cloned.") + } else { + print("Cloning KDE Craft...") + shell("git clone --depth=1 \(craftMasterGitUrl) \(craftMasterDir)") + } + + print("Configuring Nextcloud Desktop Client blueprints for KDE Craft...") + shell("\(craftCommand) --add-blueprint-repository \(clientBlueprintsGitUrl)") + + print("Crafting KDE Craft...") + shell("\(craftCommand) craft") - print("Crafting Nextcloud Desktop Client dependencies...") - shell("\(craftCommand) --install-deps nextcloud-client") + print("Crafting Nextcloud Desktop Client dependencies...") + shell("\(craftCommand) --install-deps nextcloud-client") + } - if !skipDependencyCodeSigning, let codeSignIdentity { + if !skipCraftConfiguration, !skipDependencyCodeSigning, let codeSignIdentity { print("Code-signing Nextcloud Desktop Client libraries and frameworks...") let craftLibDir = "\(buildPath)/\(craftTarget)/lib" @@ -125,6 +130,7 @@ struct MacCrafter: ParsableCommand { shell("\(craftCommand) --src-dir \(repoRootDir) -i --buildtype \(buildType) nextcloud-client") if let codeSignIdentity { + print("Code-signing Nextcloud Desktop Client app bundle...") let craftBuildDir = "\(buildPath)/\(craftTarget)/build" let clientAppDir = "\(craftBuildDir)/nextcloud-client/image-\(buildType)-master/\(appName).app" -- 2.30.2