From 29af9af3f35834be5907f6f7533a11515117662f Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Wed, 1 Apr 2020 13:17:09 -0700 Subject: [PATCH] [AltServer] Updates Carthage dependencies for Xcode 11.4 --- Cartfile.resolved | 2 +- .../LaunchAtLogin.xcodeproj/project.pbxproj | 32 ++++----- .../xcschemes/LaunchAtLogin.xcscheme | 2 +- .../xcschemes/LaunchAtLoginHelper.xcscheme | 2 +- .../LaunchAtLogin/LaunchAtLogin/Info.plist | 2 +- .../LaunchAtLogin/LaunchAtLogin.swift | 2 + Carthage/Checkouts/LaunchAtLogin/readme.md | 68 ++++++++++--------- 7 files changed, 57 insertions(+), 53 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index 9f3a542e..bc0bf778 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "sindresorhus/LaunchAtLogin" "v2.5.0" +github "sindresorhus/LaunchAtLogin" "v3.0.0" diff --git a/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/project.pbxproj b/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/project.pbxproj index 2a4d2942..851ca848 100644 --- a/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/project.pbxproj +++ b/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -151,16 +151,16 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Sindre Sorhus"; TargetAttributes = { E32E9B621EB87D7B000FEEE9 = { CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = ""; + LastSwiftMigration = 1020; }; E32E9B731EB87EA3000FEEE9 = { CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = ""; + LastSwiftMigration = 1020; SystemCapabilities = { com.apple.HardenedRuntime = { enabled = 1; @@ -173,8 +173,8 @@ }; }; buildConfigurationList = E32E9B5D1EB87D7B000FEEE9 /* Build configuration list for PBXProject "LaunchAtLogin" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = English; + compatibilityVersion = "Xcode 11.0"; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -295,6 +295,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; VALID_ARCHS = x86_64; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -350,6 +351,7 @@ SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; VALID_ARCHS = x86_64; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -364,7 +366,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = YG56YK5RN5; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -376,13 +378,13 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); + MARKETING_VERSION = 3.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.sindresorhus.LaunchAtLogin; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -394,7 +396,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = YG56YK5RN5; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -406,11 +408,11 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); + MARKETING_VERSION = 3.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.sindresorhus.LaunchAtLogin; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -418,10 +420,10 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_ENTITLEMENTS = LaunchAtLoginHelper/LaunchAtLoginHelper.entitlements; - CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = YG56YK5RN5; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = LaunchAtLoginHelper/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -432,7 +434,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -440,10 +441,10 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_ENTITLEMENTS = LaunchAtLoginHelper/LaunchAtLoginHelper.entitlements; - CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = YG56YK5RN5; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = LaunchAtLoginHelper/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -454,7 +455,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/xcshareddata/xcschemes/LaunchAtLogin.xcscheme b/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/xcshareddata/xcschemes/LaunchAtLogin.xcscheme index 81af23c7..d8b20f0d 100644 --- a/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/xcshareddata/xcschemes/LaunchAtLogin.xcscheme +++ b/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/xcshareddata/xcschemes/LaunchAtLogin.xcscheme @@ -1,6 +1,6 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.5.0 + $(MARKETING_VERSION) CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright diff --git a/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin/LaunchAtLogin.swift b/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin/LaunchAtLogin.swift index c0050c9f..6c77ee6f 100644 --- a/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin/LaunchAtLogin.swift +++ b/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin/LaunchAtLogin.swift @@ -9,7 +9,9 @@ public struct LaunchAtLogin { guard let jobs = (SMCopyAllJobDictionaries(kSMDomainUserLaunchd).takeRetainedValue() as? [[String: AnyObject]]) else { return false } + let job = jobs.first { $0["Label"] as! String == id } + return job?["OnDemand"] as? Bool ?? false } set { diff --git a/Carthage/Checkouts/LaunchAtLogin/readme.md b/Carthage/Checkouts/LaunchAtLogin/readme.md index 5cc5a311..6505bdaa 100644 --- a/Carthage/Checkouts/LaunchAtLogin/readme.md +++ b/Carthage/Checkouts/LaunchAtLogin/readme.md @@ -1,20 +1,16 @@ # LaunchAtLogin -> Add "Launch at Login" functionality to your macOS app in seconds +> Add “Launch at Login” functionality to your macOS app in seconds It's usually quite a [convoluted and error-prone process](before-after.md) to add this. **No more!** -This package works with both sandboxed and non-sandboxed apps and it's App Store compatible and used in my [Lungo](https://blog.sindresorhus.com/lungo-b364a6c2745f) and [Battery Indicator](https://sindresorhus.com/battery-indicator) apps. - -*You might also find my [`create-dmg`](https://github.com/sindresorhus/create-dmg) project useful if you're publishing your app outside the App Store.* - +This package works with both sandboxed and non-sandboxed apps and it's App Store compatible and used in apps like [Plash](https://github.com/sindresorhus/Plash), [Dato](https://sindresorhus.com/dato), [Lungo](https://sindresorhus.com/lungo), and [Battery Indicator](https://sindresorhus.com/battery-indicator). ## Requirements - macOS 10.12+ -- Xcode 10+ -- Swift 4.2+ - +- Xcode 11+ +- Swift 5+ ## Install @@ -24,33 +20,14 @@ This package works with both sandboxed and non-sandboxed apps and it's App Store github "sindresorhus/LaunchAtLogin" ``` -#### CocoaPods - -```ruby -pod 'LaunchAtLogin' -``` - - - - - - ## Usage Add a new ["Run Script Phase"](http://stackoverflow.com/a/39633955/64949) below "Embed Frameworks" in "Build Phases" with the following: -Carthage: - ```sh "${PROJECT_DIR}/Carthage/Build/Mac/LaunchAtLogin.framework/Resources/copy-helper.sh" ``` -CocoaPods: - -```sh -"${PROJECT_DIR}/Pods/LaunchAtLogin/LaunchAtLogin/copy-helper.sh" -``` - Use it in your app: ```swift @@ -65,22 +42,47 @@ print(LaunchAtLogin.isEnabled) //=> true ``` -*Note that the [Mac App Store guidelines](https://developer.apple.com/app-store/review/guidelines/) requires "launch at login" functionality to be enabled in response to a user action. This is usually solved by making it a preference that is disabled by default.* +No need to store any state to UserDefaults. +*Note that the [Mac App Store guidelines](https://developer.apple.com/app-store/review/guidelines/) requires “launch at login” functionality to be enabled in response to a user action. This is usually solved by making it a preference that is disabled by default. Many apps also let the user activate it in a welcome screen.* ## How does it work? The framework bundles the helper app needed to launch your app and copies it into your app at build time. +## FAQ + +#### My app doesn't show up in “System Preferences › Users & Groups › Login Items” + +[This is the expected behavior](https://stackoverflow.com/a/15104481/64949), unfortunately. + +#### My app doesn't launch at login when testing + +This is usually caused by having one or more older builds of your app laying around somewhere on the system, and macOS picking one of those instead, which doesn't have the launch helper, and thus fails to start. + +Some things you can try: +- Bump the version & build of your app so macOS is more likely to pick it. +- Delete the [`DerivedData` directory](https://mgrebenets.github.io/mobile%20ci/2015/02/01/xcode-derived-data). +- Ensure you don't have any other builds laying around somewhere. + +Some helpful Stack Overflow answers: +- https://stackoverflow.com/a/43281810/64949 +- https://stackoverflow.com/a/51683190/64949 +- https://stackoverflow.com/a/53110832/64949 +- https://stackoverflow.com/a/53110852/64949 + +#### Can you support CocoaPods? + +CocoaPods used to be supported, but [it did not work well](https://github.com/sindresorhus/LaunchAtLogin/issues/22) and there was no easy way to fix it, so support was dropped. Even though you mainly use CocoaPods, you can still use Carthage just for this package without any problems. + +#### I'm getting a `'SMCopyAllJobDictionaries' was deprecated in OS X 10.10` warning + +Apple deprecated that API without providing an alternative. Apple engineers have [stated that it's still the preferred API to use](https://github.com/alexzielenski/StartAtLoginController/issues/12#issuecomment-307525807). I plan to use it as long as it's available. There are workarounds I can implement if Apple ever removes the API, so rest assured, this module will be made to work even then. If you want to see this resolved, submit a [Feedback Assistant](https://feedbackassistant.apple.com) report with [the following text](https://github.com/feedback-assistant/reports/issues/16). There's unfortunately still [no way to suppress warnings in Swift](https://stackoverflow.com/a/32861678/64949). ## Related - [Defaults](https://github.com/sindresorhus/Defaults) - Swifty and modern UserDefaults - [Preferences](https://github.com/sindresorhus/Preferences) - Add a preferences window to your macOS app in minutes - [DockProgress](https://github.com/sindresorhus/DockProgress) - Show progress in your app's Dock icon +- [create-dmg](https://github.com/sindresorhus/create-dmg) - Create a good-looking DMG for your macOS app in seconds - [More…](https://github.com/search?q=user%3Asindresorhus+language%3Aswift) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com)