Skip to content

Commit

Permalink
Sparkle integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed May 12, 2024
1 parent 4f6425e commit 85650c4
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Configurations/Project.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions Edit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -2414,6 +2416,7 @@
C97918D92A9E080C0046EAF1 /* ViewPlus */,
C900A7C92A9E94B4000556A6 /* ExtendableHost */,
C9CDEB8E2B56ACA3009E252A /* MainOffender */,
C93F72262BF0F9290021ACF3 /* Sparkle */,
);
productName = Edit;
productReference = C9FE52992A7525D000CACA1A /* Chime.app */;
Expand Down Expand Up @@ -2847,6 +2850,7 @@
C9BFA1A12BBF4FA200E86487 /* XCRemoteSwiftPackageReference "nsui" */,
C9BFA1AE2BC0927A00E86487 /* XCRemoteSwiftPackageReference "Glyph" */,
C9E0BA3A2BD2EB05007AF034 /* XCRemoteSwiftPackageReference "ThemePark" */,
C93F72252BF0F9290021ACF3 /* XCRemoteSwiftPackageReference "Sparkle" */,
);
productRefGroup = C9FE529A2A7525D000CACA1A /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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" */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "e47bbfe67e141f3d63da0aa136990875f57fad0ee48affe6b39c948f30de42c0",
"originHash" : "bd19efcfc07bbe866e787909e54f1c2855bcfd99b9737e4272ebbf41ec8dcbe1",
"pins" : [
{
"identity" : "asyncxpcconnection",
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions Edit/Resources/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
<action selector="showPreferences:" target="-1" id="aSQ-sP-elf"/>
</connections>
</menuItem>
<menuItem title="Check for Updates…" id="vbn-l7-zJ2">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="-1" id="t5U-NW-n8N"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
Expand Down
5 changes: 5 additions & 0 deletions Edit/Resources/Edit.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<array>
<string>$(APP_GROUP)</string>
</array>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)-spks</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)-spki</string>
</array>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
Expand Down
12 changes: 12 additions & 0 deletions Edit/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSSupportsAutomaticTermination</key>
<true/>
<key>NSSupportsSuddenTermination</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>SUEnableAutomaticChecks</key>
<true/>
<key>SUPublicEDKey</key>
<string>lADDn605NxEPyLBxNujTTvhCaq45bX+VBq9gGxbTcLA=</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
Expand Down Expand Up @@ -53,6 +63,8 @@
<string>$(DOCUMENT_MODULE_NAME).TextDocument</string>
</dict>
</array>
<key>SUFeedURL</key>
<string>https://updates.chimehq.com/com.chimehq.Edit/appcast.xml</string>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
Expand Down
12 changes: 12 additions & 0 deletions Edit/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<String> {
["beta"]
}
}

0 comments on commit 85650c4

Please sign in to comment.