From f87841c5409b412d5e61435806cfeb1d95bd61ef Mon Sep 17 00:00:00 2001 From: StealthWire Date: Tue, 30 Jun 2026 11:54:47 -0400 Subject: [PATCH] Migrate from Carthage to Swift Package Manager; build a native universal binary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only published release (v4.0.0, 2019) ships an Intel-only (x86_64) binary, so it runs on Apple Silicon only under Rosetta 2 — which Apple is removing. Carthage also no longer builds cleanly on Apple Silicon with current Xcode (libarclite removed, deprecated AppKit symbols, codesigning of Sparkle's helper tools), making Dozer effectively unbuildable from a fresh clone. This migrates all dependencies to Swift Package Manager so the project builds natively on Apple Silicon with no manual patching, and produces a universal (arm64 + x86_64) binary that runs natively on both Apple Silicon and Intel. Dependencies: - Defaults 4 -> 9: no source changes needed. - Preferences -> Settings (renamed upstream): PreferencePane -> SettingsPane, preferencePaneIdentifier -> paneIdentifier, PreferencesWindowController -> SettingsWindowController, show(preferencePane:) -> show(pane:). The settings window is now opened via a single AppDelegate.showPreferences() that calls orderFrontRegardless(), because Settings' cooperative NSApp.activate() on macOS 14+ does not reliably bring an accessory app's window to the front. - Sparkle 1 -> 2: SUUpdater.shared() -> a shared SPUStandardUpdaterController owned by AppDelegate. The EdDSA-signed, HTTPS appcast feed is unchanged. - MASShortcut (unmaintained) -> KeyboardShortcuts: the recorder is created programmatically and hosted in a plain NSView in General.xib, since RecorderCocoa cannot be loaded from a nib. The global hotkey fires on key-down to match MASShortcut's original behavior. Shortcuts saved by the old MASShortcut integration are migrated on first launch (the legacy "toggleMenuItems" {keyCode, modifierFlags} dictionary is converted to KeyboardShortcuts' storage), so existing users keep their hotkey. - LaunchAtLogin -> LaunchAtLogin-Legacy (SPM): same isEnabled API; embeds the login-item helper via a build phase, keeping support for macOS < 13. Project: - Minimum macOS raised from 10.13 to 11 (Big Sur) so older Intel Macs are still supported while the binary stays universal. This drops 10.13-10.15 users, so it is a breaking change — release as a new major version. - Dependencies are pinned to exact versions in project.yml (committed and reviewable) — the SPM equivalent of the removed Cartfile.resolved. - Remove Cartfile, Cartfile.resolved, the Carthage build scripts and the now stale Brewfile.lock.json; update Brewfile, Makefile, README and CONTRIBUTING. - .swiftlint.yml: use the current validates_start_with_lowercase syntax so the lint phase passes on modern SwiftLint. Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitignore | 1 - .swiftlint.yml | 2 +- Brewfile | 1 - Brewfile.lock.json | 107 ------------------ CONTRIBUTING.md | 2 +- Cartfile | 5 - Cartfile.resolved | 5 - Dozer/AppDelegate.swift | 69 +++++++++-- Dozer/Constants.swift | 11 +- Dozer/DozerIcons.swift | 2 +- Dozer/Other/Info.plist | 2 +- Dozer/Other/bridging-header.h | 1 - .../StatusIconClasses/NormalStatusIcon.swift | 2 +- .../StatusIconClasses/RemoveStatusIcon.swift | 2 +- Dozer/ViewControllers/DozerVC.swift | 14 ++- Dozer/ViewControllers/GeneralVC.swift | 41 +++---- Dozer/XIB/General.xib | 6 +- Makefile | 3 +- README.md | 6 +- Scripts/LaunchAtLogin.sh | 1 - Scripts/SignFrameworks.sh | 11 -- project.yml | 61 ++++++---- 22 files changed, 152 insertions(+), 203 deletions(-) delete mode 100644 Brewfile.lock.json delete mode 100644 Cartfile delete mode 100644 Cartfile.resolved delete mode 100755 Scripts/LaunchAtLogin.sh delete mode 100755 Scripts/SignFrameworks.sh diff --git a/.gitignore b/.gitignore index 16219e7..3fe73fc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ build/ Releases/ Dozer.xcodeproj/ Credentials/ -Carthage/ # Fastlane fastlane/ diff --git a/.swiftlint.yml b/.swiftlint.yml index b5f135d..cb69034 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -141,7 +141,7 @@ identifier_name: min_length: warning: 2 error: 2 - validates_start_with_lowercase: false + validates_start_with_lowercase: off allowed_symbols: - '_' excluded: diff --git a/Brewfile b/Brewfile index d428fb3..6682046 100644 --- a/Brewfile +++ b/Brewfile @@ -2,4 +2,3 @@ brew "swiftformat" brew "swiftgen" brew "swiftlint" brew "xcodegen" -brew "carthage" diff --git a/Brewfile.lock.json b/Brewfile.lock.json deleted file mode 100644 index 2699f74..0000000 --- a/Brewfile.lock.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "entries": { - "brew": { - "swiftformat": { - "version": "0.44.16", - "bottle": { - "cellar": ":any_skip_relocation", - "prefix": "/usr/local", - "files": { - "catalina": { - "url": "https://homebrew.bintray.com/bottles/swiftformat-0.44.16.catalina.bottle.tar.gz", - "sha256": "e03e40dbe228ee7136cc2dd57079b589a6c531f4f2a52fce8a0ad7aaa2e2a935" - }, - "mojave": { - "url": "https://homebrew.bintray.com/bottles/swiftformat-0.44.16.mojave.bottle.tar.gz", - "sha256": "9b866de2516e8f68b1ad764f996f38cba31b2d2fc345ba683bdd1867e6a44091" - }, - "high_sierra": { - "url": "https://homebrew.bintray.com/bottles/swiftformat-0.44.16.high_sierra.bottle.tar.gz", - "sha256": "eb111096afada9821c4cf1489706b5daf599670d8651719955998f763c6b9cdb" - } - } - } - }, - "swiftgen": { - "version": "6.2.1", - "bottle": { - "cellar": ":any", - "prefix": "/usr/local", - "files": { - "catalina": { - "url": "https://homebrew.bintray.com/bottles/swiftgen-6.2.1.catalina.bottle.tar.gz", - "sha256": "0fde7ff65be044c1685ab5aa84514e45c594cbc8bad028b5ac8f2f6218cfd626" - } - } - } - }, - "swiftlint": { - "version": "0.39.2", - "bottle": { - "cellar": ":any_skip_relocation", - "prefix": "/usr/local", - "files": { - "catalina": { - "url": "https://homebrew.bintray.com/bottles/swiftlint-0.39.2.catalina.bottle.tar.gz", - "sha256": "32f9e5e37190e81856eff49c2118c04d1995110b509f0a4997e211c9f939919e" - }, - "mojave": { - "url": "https://homebrew.bintray.com/bottles/swiftlint-0.39.2.mojave.bottle.tar.gz", - "sha256": "c4fc10277d46c406277491003e5d5bbdfe526890c39b30eb924749696ed56d40" - } - } - } - }, - "xcodegen": { - "version": "2.16.0", - "bottle": { - "cellar": ":any_skip_relocation", - "prefix": "/usr/local", - "files": { - "catalina": { - "url": "https://homebrew.bintray.com/bottles/xcodegen-2.16.0.catalina.bottle.tar.gz", - "sha256": "fc8f03f0f3968c6f913725629bdfa34a24a539a6868afdb1112b8f76cdbf5a55" - }, - "mojave": { - "url": "https://homebrew.bintray.com/bottles/xcodegen-2.16.0.mojave.bottle.tar.gz", - "sha256": "a8eea29cb064ef817a1aae173b102eb689a263fc4039987a4592e9f15c4b1d85" - } - } - } - }, - "carthage": { - "version": "0.35.0", - "bottle": { - "cellar": ":any_skip_relocation", - "prefix": "/usr/local", - "files": { - "catalina": { - "url": "https://homebrew.bintray.com/bottles/carthage-0.35.0.catalina.bottle.tar.gz", - "sha256": "fdaacafff1566fa7b1e42e68e108da69aa7578dc82f4736272dca10283c9cba2" - }, - "mojave": { - "url": "https://homebrew.bintray.com/bottles/carthage-0.35.0.mojave.bottle.tar.gz", - "sha256": "1da29ca0b1d8e79bec5e548f5ab2433890ebc3fc9007f5fdb70d9e3be281dbb7" - }, - "high_sierra": { - "url": "https://homebrew.bintray.com/bottles/carthage-0.35.0.high_sierra.bottle.tar.gz", - "sha256": "130fcb9bc06ef8e7f1c5ac9af0d155bd347db039b2cf80fa0fef764b3627ffbf" - } - } - } - } - } - }, - "system": { - "macos": { - "catalina": { - "HOMEBREW_VERSION": "2.4.4-57-g6d2c395", - "HOMEBREW_PREFIX": "/usr/local", - "Homebrew/homebrew-core": "a4ba652e5d0b5380df4f2edecc2f4d15cd15fc48", - "CLT": "1103.0.32.29", - "Xcode": "11.5", - "macOS": "10.15.5" - } - } - } -} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c7c5435..cb14e97 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ Refresh the Dozer icons or logo. [Design resources for logo and status bar icon] You can submit your own code. This can be bug fixes or new features. Please ask me (@Mortennn) before implementing a new feature. Check out [Issues](https://github.com/Mortennn/Dozer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). ### Getting started -Make sure you have at least Xcode 10 installed. +Make sure you have Xcode 15 or later installed (Dozer targets macOS 11+). Dependencies are managed with Swift Package Manager and resolved automatically by Xcode — no Carthage step is required. Run the following command: ```shell diff --git a/Cartfile b/Cartfile deleted file mode 100644 index e7e2f56..0000000 --- a/Cartfile +++ /dev/null @@ -1,5 +0,0 @@ -github "sindresorhus/LaunchAtLogin" -github "sindresorhus/Defaults" -github "sindresorhus/Preferences" -github "shpakovski/MASShortcut" -github "sparkle-project/Sparkle" \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index 799e1f7..0000000 --- a/Cartfile.resolved +++ /dev/null @@ -1,5 +0,0 @@ -github "shpakovski/MASShortcut" "2.4.0" -github "sindresorhus/Defaults" "v4.2.2" -github "sindresorhus/LaunchAtLogin" "v4.1.0" -github "sindresorhus/Preferences" "v2.2.1" -github "sparkle-project/Sparkle" "1.26.0" diff --git a/Dozer/AppDelegate.swift b/Dozer/AppDelegate.swift index f66e516..da63981 100755 --- a/Dozer/AppDelegate.swift +++ b/Dozer/AppDelegate.swift @@ -3,21 +3,32 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import Cocoa -import MASShortcut +import KeyboardShortcuts import Sparkle import Defaults -import Preferences +import Settings final class AppDelegate: NSObject, NSApplicationDelegate { + // Sparkle 2 updater. Shared so the settings panes can read/write its state. + let updaterController = SPUStandardUpdaterController( + startingUpdater: true, + updaterDelegate: nil, + userDriverDelegate: nil + ) + func applicationDidFinishLaunching(_: Notification) { - MASShortcutBinder.shared()?.bindShortcut(withDefaultsKey: UserDefaultKeys.Shortcuts.ToggleMenuItems) { () in + // Carry over a shortcut saved by the old MASShortcut integration. + migrateLegacyShortcutIfNeeded() + + // Trigger on key-down to match MASShortcut's original behavior. + KeyboardShortcuts.onKeyDown(for: .toggleMenuItems) { DozerIcons.shared.toggle() } // Initalize Dozer Icons _ = DozerIcons.shared - + // If enabled hide menu bar icons at launch DozerIcons.shared.hideAtLaunch() @@ -30,15 +41,59 @@ final class AppDelegate: NSObject, NSApplicationDelegate { return true } - lazy var preferences: [PreferencePane] = [ + /// Import a shortcut saved by the previous MASShortcut integration so + /// existing users keep their toggle hotkey after upgrading. + /// + /// MASShortcut (via `MASShortcutBinder`) stored the shortcut under the + /// `"toggleMenuItems"` UserDefaults key as a `{keyCode, modifierFlags}` + /// dictionary, where `modifierFlags` are Cocoa `NSEvent.ModifierFlags`. + /// KeyboardShortcuts uses its own `"KeyboardShortcuts_"`-prefixed storage, + /// so without this the saved shortcut would silently disappear. + @MainActor + private func migrateLegacyShortcutIfNeeded() { + let legacyKey = "toggleMenuItems" + let defaults = UserDefaults.standard + + guard let legacy = defaults.dictionary(forKey: legacyKey) else { + return + } + + // Only import if the user has not already recorded one with the new API. + if KeyboardShortcuts.getShortcut(for: .toggleMenuItems) == nil, + let keyCode = (legacy["keyCode"] as? NSNumber)?.intValue, + let modifierFlags = (legacy["modifierFlags"] as? NSNumber)?.uintValue { + let shortcut = KeyboardShortcuts.Shortcut( + KeyboardShortcuts.Key(rawValue: keyCode), + modifiers: NSEvent.ModifierFlags(rawValue: modifierFlags) + ) + KeyboardShortcuts.setShortcut(shortcut, for: .toggleMenuItems) + Defaults[.isShortcutSet] = true + } + + // Drop the obsolete key so this only runs once. + defaults.removeObject(forKey: legacyKey) + } + + lazy var preferences: [SettingsPane] = [ Dozer(), General() ] - lazy var preferencesWindowController = PreferencesWindowController( - preferencePanes: preferences, + lazy var preferencesWindowController = SettingsWindowController( + panes: preferences, style: .toolbarItems, animated: true, hidesToolbarForSingleItem: true ) + + /// Open the settings window, reliably in front of other apps. + /// + /// The Settings library relies on the cooperative `NSApp.activate()` on + /// macOS 14+, which does not reliably bring an accessory (menu-bar) app's + /// window forward, so the window can open behind the frontmost app. + /// `orderFrontRegardless()` forces it above other apps' windows. + func showPreferences() { + preferencesWindowController.show(pane: .general) + preferencesWindowController.window?.orderFrontRegardless() + } } diff --git a/Dozer/Constants.swift b/Dozer/Constants.swift index eaea46b..10c5ab1 100644 --- a/Dozer/Constants.swift +++ b/Dozer/Constants.swift @@ -3,8 +3,9 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import Cocoa -import Preferences +import Settings import Defaults +import KeyboardShortcuts extension Defaults.Keys { static let hideOnLogin: Defaults.Key = Key("hideOnLogin", default: false) @@ -20,17 +21,15 @@ extension Defaults.Keys { static let isShortcutSet: Defaults.Key = Key("isShortcutSet", default: false) } -struct UserDefaultKeys { - struct Shortcuts { - static let ToggleMenuItems: String = "toggleMenuItems" - } +extension KeyboardShortcuts.Name { + static let toggleMenuItems = Self("toggleMenuItems") } extension NSStoryboard.Name { static let preferences: NSStoryboard.Name = NSStoryboard.Name("Preferences") } -extension Preferences.PaneIdentifier { +extension Settings.PaneIdentifier { static let dozer = Self("dozer") static let general = Self("general") } diff --git a/Dozer/DozerIcons.swift b/Dozer/DozerIcons.swift index 33ca599..f91b241 100755 --- a/Dozer/DozerIcons.swift +++ b/Dozer/DozerIcons.swift @@ -107,7 +107,7 @@ public final class DozerIcons { Defaults[.showIconAndMenuEnabled] = self.enableIconAndMenu if self.enableIconAndMenu == false { _ = DozerIcons.toggleDockIcon(showIcon: false) - appDelegate.preferencesWindowController.show(preferencePane: .general) + appDelegate.showPreferences() } } } diff --git a/Dozer/Other/Info.plist b/Dozer/Other/Info.plist index 183a8e8..388e68c 100755 --- a/Dozer/Other/Info.plist +++ b/Dozer/Other/Info.plist @@ -23,7 +23,7 @@ LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion - 10.13 + 11.0 LSUIElement NSHumanReadableCopyright diff --git a/Dozer/Other/bridging-header.h b/Dozer/Other/bridging-header.h index 271adf5..600f77b 100755 --- a/Dozer/Other/bridging-header.h +++ b/Dozer/Other/bridging-header.h @@ -6,6 +6,5 @@ #define bridging_header_h #import -#import #endif diff --git a/Dozer/StatusIconClasses/NormalStatusIcon.swift b/Dozer/StatusIconClasses/NormalStatusIcon.swift index 12467b0..b65b405 100644 --- a/Dozer/StatusIconClasses/NormalStatusIcon.swift +++ b/Dozer/StatusIconClasses/NormalStatusIcon.swift @@ -28,7 +28,7 @@ class NormalStatusIcon: HelperstatusIcon { case .leftMouseDown: DozerIcons.shared.toggle() case .rightMouseDown: - appDelegate.preferencesWindowController.show(preferencePane: .general) + appDelegate.showPreferences() default: break } diff --git a/Dozer/StatusIconClasses/RemoveStatusIcon.swift b/Dozer/StatusIconClasses/RemoveStatusIcon.swift index 0ca9165..1634b73 100644 --- a/Dozer/StatusIconClasses/RemoveStatusIcon.swift +++ b/Dozer/StatusIconClasses/RemoveStatusIcon.swift @@ -20,7 +20,7 @@ class RemoveStatusIcon: HelperstatusIcon { case .leftMouseDown: DozerIcons.shared.toggleRemove() case .rightMouseDown: - appDelegate.preferencesWindowController.show(preferencePane: .general) + appDelegate.showPreferences() default: break } diff --git a/Dozer/ViewControllers/DozerVC.swift b/Dozer/ViewControllers/DozerVC.swift index 4d72221..a6860c1 100755 --- a/Dozer/ViewControllers/DozerVC.swift +++ b/Dozer/ViewControllers/DozerVC.swift @@ -4,11 +4,11 @@ import Cocoa import Sparkle -import Preferences +import Settings -final class Dozer: NSViewController, PreferencePane { - let preferencePaneIdentifier = Preferences.PaneIdentifier.dozer - let preferencePaneTitle: String = "Dozer" +final class Dozer: NSViewController, SettingsPane { + let paneIdentifier = Settings.PaneIdentifier.dozer + let paneTitle: String = "Dozer" let toolbarItemIcon = NSImage(named: "AppIcon")! override var nibName: NSNib.Name? { "Dozer" } @@ -25,8 +25,10 @@ final class Dozer: NSViewController, PreferencePane { versionLabel.stringValue = "\(releaseVersionNumber) (\(buildVersionNumber))" } - checkForUpdates.target = SUUpdater.shared()! - checkForUpdates.action = #selector(SUUpdater.shared()!.checkForUpdates(_:)) + if let appDelegate = NSApp.delegate as? AppDelegate { + checkForUpdates.target = appDelegate.updaterController + checkForUpdates.action = #selector(SPUStandardUpdaterController.checkForUpdates(_:)) + } quit.action = #selector(NSApp.terminate(_:)) } diff --git a/Dozer/ViewControllers/GeneralVC.swift b/Dozer/ViewControllers/GeneralVC.swift index 9832a81..7c2e917 100644 --- a/Dozer/ViewControllers/GeneralVC.swift +++ b/Dozer/ViewControllers/GeneralVC.swift @@ -3,20 +3,22 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import Cocoa -import Preferences -import MASShortcut +import Settings +import KeyboardShortcuts import LaunchAtLogin import Sparkle import Defaults -final class General: NSViewController, PreferencePane { - let preferencePaneIdentifier = Preferences.PaneIdentifier.general - let preferencePaneTitle: String = "General" +final class General: NSViewController, SettingsPane { + let paneIdentifier = Settings.PaneIdentifier.general + let paneTitle: String = "General" let toolbarItemIcon = NSImage(named: NSImage.preferencesGeneralName)! override var nibName: NSNib.Name? { "General" } - fileprivate var userShortCut: MASShortcut! + private var updater: SPUUpdater? { + (NSApp.delegate as? AppDelegate)?.updaterController.updater + } @IBOutlet private var LaunchAtLoginCheckbox: NSButton! @IBOutlet private var CheckForUpdatesCheckbox: NSButton! @@ -28,7 +30,7 @@ final class General: NSViewController, PreferencePane { @IBOutlet private var ShowIconAndMenuCheckbox: NSButton! @IBOutlet private var FontSizePopUpButton: NSPopUpButton! @IBOutlet private var ButtonPaddingPopUpButton: NSPopUpButton! - @IBOutlet private var ToggleMenuItemsView: MASShortcutView! + @IBOutlet private var ToggleMenuItemsView: NSView! override func viewDidLoad() { super.viewDidLoad() @@ -36,8 +38,8 @@ final class General: NSViewController, PreferencePane { LaunchAtLoginCheckbox.focusRingType = .none LaunchAtLoginCheckbox.isChecked = LaunchAtLogin.isEnabled - if SUUpdater.shared() != nil { - CheckForUpdatesCheckbox.isChecked = SUUpdater.shared()!.automaticallyChecksForUpdates + if let updater = updater { + CheckForUpdatesCheckbox.isChecked = updater.automaticallyChecksForUpdates } else { CheckForUpdatesCheckbox.isChecked = false } @@ -51,14 +53,15 @@ final class General: NSViewController, PreferencePane { FontSizePopUpButton.selectItem(withTitle: "\(Int(Defaults[.iconSize])) px") ButtonPaddingPopUpButton.selectItem(withTitle: "\(Int(Defaults[.buttonPadding])) px") - ToggleMenuItemsView.associatedUserDefaultsKey = UserDefaultKeys.Shortcuts.ToggleMenuItems - view.addSubview(ToggleMenuItemsView) - configureEnabledNoIconCheckbox() - - ToggleMenuItemsView.shortcutValueChange = { _ -> Void in - self.userShortCut = self.ToggleMenuItemsView.shortcutValue - self.configureEnabledNoIconCheckbox() + // Host the KeyboardShortcuts recorder inside the container view from the XIB. + // RecorderCocoa cannot be loaded from a nib, so it is created programmatically. + let recorder = KeyboardShortcuts.RecorderCocoa(for: .toggleMenuItems) { [weak self] _ in + self?.configureEnabledNoIconCheckbox() } + recorder.frame = ToggleMenuItemsView.bounds + recorder.autoresizingMask = [.width, .height] + ToggleMenuItemsView.addSubview(recorder) + configureEnabledNoIconCheckbox() } @IBAction private func launchAtLoginClicked(_ sender: NSButton) { @@ -66,11 +69,11 @@ final class General: NSViewController, PreferencePane { } @IBAction private func automaticallyCheckForUpdatesClicked(_ sender: NSButton) { - guard SUUpdater.shared() != nil else { + guard let updater = updater else { CheckForUpdatesCheckbox.isChecked = false return } - SUUpdater.shared()!.automaticallyChecksForUpdates = CheckForUpdatesCheckbox.isChecked + updater.automaticallyChecksForUpdates = CheckForUpdatesCheckbox.isChecked } @IBAction private func hideStatusBarIconsAtLaunchClicked(_ sender: NSButton) { @@ -108,7 +111,7 @@ final class General: NSViewController, PreferencePane { /// disables the noIcon-checkbox if no shortcut is set and keeps track whether shortcut is set private func configureEnabledNoIconCheckbox() { - if ToggleMenuItemsView.shortcutValue == nil { + if KeyboardShortcuts.getShortcut(for: .toggleMenuItems) == nil { HideBothDozerIconsCheckbox.isEnabled = false Defaults[.isShortcutSet] = false } else { diff --git a/Dozer/XIB/General.xib b/Dozer/XIB/General.xib index f20bf77..64ebad5 100644 --- a/Dozer/XIB/General.xib +++ b/Dozer/XIB/General.xib @@ -234,12 +234,12 @@ - - + + - + diff --git a/Makefile b/Makefile index 8e6ed74..0583700 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ build: @brew bundle --no-upgrade - @carthage bootstrap --cache-builds --platform osx @mkdir -p Dozer/Other/Generated @swiftgen - @xcodegen + @xcodegen @xed "." release: diff --git a/README.md b/README.md index 253b9f6..d81144c 100755 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ platform - - systemrequirements + + systemrequirements swiftlint @@ -59,4 +59,4 @@ There are 2 or 3, numbered from right to left: ## 📄 Requirements -macOS 10.13+ +macOS 11+ (Big Sur) diff --git a/Scripts/LaunchAtLogin.sh b/Scripts/LaunchAtLogin.sh deleted file mode 100755 index 5562007..0000000 --- a/Scripts/LaunchAtLogin.sh +++ /dev/null @@ -1 +0,0 @@ -./Carthage/Build/Mac/LaunchAtLogin.framework/Resources/copy-helper.sh diff --git a/Scripts/SignFrameworks.sh b/Scripts/SignFrameworks.sh deleted file mode 100755 index ab655a8..0000000 --- a/Scripts/SignFrameworks.sh +++ /dev/null @@ -1,11 +0,0 @@ -LOCATION="${BUILT_PRODUCTS_DIR}"/"${FRAMEWORKS_FOLDER_PATH}" - -# By default, use the configured code signing identity for the project/target -IDENTITY="${CODE_SIGN_IDENTITY}" -if [ "$IDENTITY" == "" ] -then - # If a code signing identity is not specified, use ad hoc signing - IDENTITY="-" -fi -codesign --verbose --force --deep -o runtime --sign "$IDENTITY" "$LOCATION/Sparkle.framework/Versions/A/Resources/AutoUpdate.app" -codesign --verbose --force -o runtime --sign "$IDENTITY" "$LOCATION/Sparkle.framework/Versions/A" diff --git a/project.yml b/project.yml index e3b3d98..edff740 100755 --- a/project.yml +++ b/project.yml @@ -3,31 +3,53 @@ options: usesTabs: false tabWidth: 4 createIntermediateGroups: true - xcodeVersion: 10.2.1 - deploymentTarget: 10.13 + xcodeVersion: "26.0" + deploymentTarget: 11.0 +# Pinned to exact versions (committed, reviewable) so a fresh checkout always +# resolves the same dependency set — the SPM equivalent of the old +# Cartfile.resolved. Bump these in an explicit, reviewable commit. +packages: + Defaults: + url: https://github.com/sindresorhus/Defaults + exactVersion: 9.0.9 + Settings: + url: https://github.com/sindresorhus/Settings + exactVersion: 3.1.2 + Sparkle: + url: https://github.com/sparkle-project/Sparkle + exactVersion: 2.9.3 + LaunchAtLogin: + url: https://github.com/sindresorhus/LaunchAtLogin-Legacy + exactVersion: 5.0.2 + KeyboardShortcuts: + url: https://github.com/sindresorhus/KeyboardShortcuts + exactVersion: 3.0.1 targets: Dozer: type: application platform: macOS - deploymentTarget: - macOS: 10.13 + deploymentTarget: + macOS: 11.0 configFiles: Debug: Configs/Debug.xcconfig Release: Configs/Release.xcconfig sources: - Dozer postBuildScripts: - - path: Scripts/LaunchAtLogin.sh - name: Launch At Login - runOnlyWhenInstalling: true - - path: Scripts/SignFrameworks.sh - name: Sign Frameworks - runOnlyWhenInstalling: true - runOnlyWhenInstalling: true - - script: /usr/local/bin/swiftgen + - script: | + export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin" + if which swiftgen >/dev/null; then + swiftgen + else + echo "warning: SwiftGen not installed" + fi name: Generate files using SwiftGen - path: Scripts/Swiftlint.sh name: Swiftlint + # LaunchAtLogin-Legacy embeds a login-item helper for macOS < 13. + - script: '"${BUILT_PRODUCTS_DIR}/LaunchAtLogin_LaunchAtLogin.bundle/Contents/Resources/copy-helper-swiftpm.sh"' + name: Copy "Launch at Login Helper" + basedOnDependencyAnalysis: false settings: base: CODE_SIGN_ENTITLEMENTS: Dozer/Other/Dozer.entitlements @@ -35,17 +57,18 @@ targets: SWIFT_VERSION: 5 DEBUG_INFORMATION_FORMAT: "dwarf-with-dsym" ENABLE_HARDENED_RUNTIME: true - MACOSX_DEPLOYMENT_TARGET: 10.13 + ENABLE_USER_SCRIPT_SANDBOXING: NO + MACOSX_DEPLOYMENT_TARGET: 11.0 VERSIONING_SYSTEM: apple-generic CURRENT_PROJECT_VERSION: 30 dependencies: - - carthage: LaunchAtLogin - - carthage: Defaults - - carthage: Preferences - - carthage: MASShortcut - - carthage: Sparkle + - package: LaunchAtLogin + - package: Defaults + - package: Settings + - package: KeyboardShortcuts + - package: Sparkle schemes: Dozer: build: targets: - Dozer: all \ No newline at end of file + Dozer: all