diff --git a/Configurations/Project.xcconfig b/Configurations/Project.xcconfig index c947002..15ba5d3 100644 --- a/Configurations/Project.xcconfig +++ b/Configurations/Project.xcconfig @@ -37,7 +37,7 @@ CODE_SIGN_STYLE = Automatic COMBINE_HIDPI_IMAGES = YES COPY_PHASE_STRIP = NO CURRENT_PROJECT_DISPLAY_VERSION = 3.0.0 -CURRENT_PROJECT_VERSION = 151 +CURRENT_PROJECT_VERSION = 200 DEAD_CODE_STRIPPING = YES DEBUG_INFORMATION_FORMAT = dwarf-with-dsym ENABLE_HARDENED_RUNTIME = YES diff --git a/Edit.xcodeproj/project.pbxproj b/Edit.xcodeproj/project.pbxproj index 9a3ebe4..811183d 100644 --- a/Edit.xcodeproj/project.pbxproj +++ b/Edit.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ C929316D2B822BB300C64DDE /* TreeSitterGo in Frameworks */ = {isa = PBXBuildFile; productRef = C929316C2B822BB300C64DDE /* TreeSitterGo */; }; C929316F2B822BB800C64DDE /* TreeSitterSwift in Frameworks */ = {isa = PBXBuildFile; productRef = C929316E2B822BB800C64DDE /* TreeSitterSwift */; }; C92931712B822BBD00C64DDE /* TreeSitterMarkdown in Frameworks */ = {isa = PBXBuildFile; productRef = C92931702B822BBD00C64DDE /* TreeSitterMarkdown */; }; + C93F72272BF0F9290021ACF3 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = C93F72262BF0F9290021ACF3 /* Sparkle */; }; C9409C662A98CC9800B5D898 /* Outline in Frameworks */ = {isa = PBXBuildFile; productRef = C9409C652A98CC9800B5D898 /* Outline */; }; C9409C6C2A99059C00B5D898 /* ProjectState.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9409C6A2A99047000B5D898 /* ProjectState.swift */; }; C941F09C2B6AD4AF0003B640 /* DocumentContentAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C941F09B2B6AD4AF0003B640 /* DocumentContentAdapter.swift */; }; @@ -1223,6 +1224,7 @@ C9FE53942A766AB300CACA1A /* libSearch.a in Frameworks */, C9FE53932A766AAD00CACA1A /* libInspector.a in Frameworks */, C9409C662A98CC9800B5D898 /* Outline in Frameworks */, + C93F72272BF0F9290021ACF3 /* Sparkle in Frameworks */, C97918DA2A9E080C0046EAF1 /* ViewPlus in Frameworks */, C900A7CA2A9E94B4000556A6 /* ExtendableHost in Frameworks */, C97918CB2A9D4C740046EAF1 /* FuzzyFind in Frameworks */, @@ -2414,6 +2416,7 @@ C97918D92A9E080C0046EAF1 /* ViewPlus */, C900A7C92A9E94B4000556A6 /* ExtendableHost */, C9CDEB8E2B56ACA3009E252A /* MainOffender */, + C93F72262BF0F9290021ACF3 /* Sparkle */, ); productName = Edit; productReference = C9FE52992A7525D000CACA1A /* Chime.app */; @@ -2847,6 +2850,7 @@ C9BFA1A12BBF4FA200E86487 /* XCRemoteSwiftPackageReference "nsui" */, C9BFA1AE2BC0927A00E86487 /* XCRemoteSwiftPackageReference "Glyph" */, C9E0BA3A2BD2EB05007AF034 /* XCRemoteSwiftPackageReference "ThemePark" */, + C93F72252BF0F9290021ACF3 /* XCRemoteSwiftPackageReference "Sparkle" */, ); productRefGroup = C9FE529A2A7525D000CACA1A /* Products */; projectDirPath = ""; @@ -4644,6 +4648,14 @@ revision = 834fed55c04bab1e3894070b9b5939700284e4c8; }; }; + C93F72252BF0F9290021ACF3 /* XCRemoteSwiftPackageReference "Sparkle" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/sparkle-project/Sparkle"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 2.6.2; + }; + }; C9409C642A98CC9800B5D898 /* XCRemoteSwiftPackageReference "Outline" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/chimeHQ/Outline"; @@ -4896,6 +4908,11 @@ package = C9CDEB5F2B5193B1009E252A /* XCRemoteSwiftPackageReference "tree-sitter-markdown" */; productName = TreeSitterMarkdown; }; + C93F72262BF0F9290021ACF3 /* Sparkle */ = { + isa = XCSwiftPackageProductDependency; + package = C93F72252BF0F9290021ACF3 /* XCRemoteSwiftPackageReference "Sparkle" */; + productName = Sparkle; + }; C9409C652A98CC9800B5D898 /* Outline */ = { isa = XCSwiftPackageProductDependency; package = C9409C642A98CC9800B5D898 /* XCRemoteSwiftPackageReference "Outline" */; diff --git a/Edit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Edit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d6a4e16..d837ca6 100644 --- a/Edit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Edit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "e47bbfe67e141f3d63da0aa136990875f57fad0ee48affe6b39c948f30de42c0", + "originHash" : "bd19efcfc07bbe866e787909e54f1c2855bcfd99b9737e4272ebbf41ec8dcbe1", "pins" : [ { "identity" : "asyncxpcconnection", @@ -207,6 +207,15 @@ "revision" : "d563ef0ba6c1c91aa6bcee406577b8826baa1f69" } }, + { + "identity" : "sparkle", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sparkle-project/Sparkle", + "state" : { + "revision" : "41847a58cdef7506b257591fcca6f9495df591d4", + "version" : "2.6.2" + } + }, { "identity" : "swifttreesitter", "kind" : "remoteSourceControl", diff --git a/Edit/Resources/Base.lproj/MainMenu.xib b/Edit/Resources/Base.lproj/MainMenu.xib index 8afa775..fb17910 100644 --- a/Edit/Resources/Base.lproj/MainMenu.xib +++ b/Edit/Resources/Base.lproj/MainMenu.xib @@ -31,6 +31,12 @@ + + + + + + diff --git a/Edit/Resources/Edit.entitlements b/Edit/Resources/Edit.entitlements index 4a18276..8144bf1 100644 --- a/Edit/Resources/Edit.entitlements +++ b/Edit/Resources/Edit.entitlements @@ -8,6 +8,11 @@ $(APP_GROUP) + com.apple.security.temporary-exception.mach-lookup.global-name + + $(PRODUCT_BUNDLE_IDENTIFIER)-spks + $(PRODUCT_BUNDLE_IDENTIFIER)-spki + com.apple.security.files.user-selected.read-write diff --git a/Edit/Resources/Info.plist b/Edit/Resources/Info.plist index 8bff20f..b525c46 100644 --- a/Edit/Resources/Info.plist +++ b/Edit/Resources/Info.plist @@ -2,6 +2,16 @@ + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + NSSupportsAutomaticGraphicsSwitching + + SUEnableAutomaticChecks + + SUPublicEDKey + lADDn605NxEPyLBxNujTTvhCaq45bX+VBq9gGxbTcLA= CFBundleDocumentTypes @@ -53,6 +63,8 @@ $(DOCUMENT_MODULE_NAME).TextDocument + SUFeedURL + https://updates.chimehq.com/com.chimehq.Edit/appcast.xml UTImportedTypeDeclarations diff --git a/Edit/Sources/AppDelegate.swift b/Edit/Sources/AppDelegate.swift index 9f22462..4358e3f 100644 --- a/Edit/Sources/AppDelegate.swift +++ b/Edit/Sources/AppDelegate.swift @@ -5,12 +5,14 @@ import SwiftUI import Document import ExtensionHost import PreferencesWindow +import Sparkle import Theme import Utility @main @MainActor final class AppDelegate: NSObject, NSApplicationDelegate { + private lazy var updaterController = SPUStandardUpdaterController(updaterDelegate: self, userDriverDelegate: nil) private let documentController: ProjectDocumentController private lazy var preferencesController: NSWindowController = { let window = NSWindow(contentRect: .zero, styleMask: [.closable, .titled], backing: .buffered, defer: true) @@ -53,4 +55,14 @@ extension AppDelegate { preferencesController.window?.center() preferencesController.showWindow(self) } + + @IBAction func checkForUpdates(_ sender: Any?) { + updaterController.checkForUpdates(sender) + } +} + +extension AppDelegate: SPUUpdaterDelegate { + nonisolated func allowedChannels(for updater: SPUUpdater) -> Set { + ["beta"] + } }