From b441aa46ae0b3d57508c3e44c685e76feeee09a0 Mon Sep 17 00:00:00 2001 From: Charlie Scheer Date: Tue, 21 May 2024 12:48:09 -0600 Subject: [PATCH] Added SimplenoteIntents extension to Simplenote Mac Project --- Simplenote.xcodeproj/project.pbxproj | 190 +++++++++++++++++- .../xcschemes/SimplenoteIntents.xcscheme | 97 +++++++++ SimplenoteIntents/Info.plist | 20 ++ SimplenoteIntents/IntentHandler.swift | 20 ++ 4 files changed, 326 insertions(+), 1 deletion(-) create mode 100644 Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteIntents.xcscheme create mode 100644 SimplenoteIntents/Info.plist create mode 100644 SimplenoteIntents/IntentHandler.swift diff --git a/Simplenote.xcodeproj/project.pbxproj b/Simplenote.xcodeproj/project.pbxproj index 75283985e..126a2a967 100644 --- a/Simplenote.xcodeproj/project.pbxproj +++ b/Simplenote.xcodeproj/project.pbxproj @@ -472,6 +472,8 @@ BA71EC252BC88FFC00F42CB1 /* NSManagedObjectContext+Simplenote.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA52005C2BC88397003F1B75 /* NSManagedObjectContext+Simplenote.swift */; }; BA78AF6F2B5B2BBA00DCF896 /* AutomatticTracks in Frameworks */ = {isa = PBXBuildFile; productRef = BA78AF6E2B5B2BBA00DCF896 /* AutomatticTracks */; }; BA78AF712B5B2BC300DCF896 /* AutomatticTracks in Frameworks */ = {isa = PBXBuildFile; productRef = BA78AF702B5B2BC300DCF896 /* AutomatticTracks */; }; + BA8CF21C2BFD20770087F33D /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA8CF21B2BFD20770087F33D /* Intents.framework */; }; + BA8CF21F2BFD20780087F33D /* IntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA8CF21E2BFD20780087F33D /* IntentHandler.swift */; }; BA938CEC26ACFF4A00BE5A1D /* Remote.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA938CEB26ACFF4A00BE5A1D /* Remote.swift */; }; BA938CEE26AD055400BE5A1D /* AccountVerificationController+TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA938CED26AD055400BE5A1D /* AccountVerificationController+TestHelpers.swift */; }; BAA0A87A26B9F0B50006260E /* RemoteError.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAA0A87926B9F0B50006260E /* RemoteError.swift */; }; @@ -518,6 +520,13 @@ remoteGlobalIDString = 26F72A8714032D2A00A7935E; remoteInfo = Simplenote; }; + BA8CF2242BFD21560087F33D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 26F72A7F14032D2900A7935E /* Project object */; + proxyType = 1; + remoteGlobalIDString = BA8CF2192BFD20770087F33D; + remoteInfo = SimplenoteIntents; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -880,6 +889,10 @@ BA52005C2BC88397003F1B75 /* NSManagedObjectContext+Simplenote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Simplenote.swift"; sourceTree = ""; }; BA553F0727065E20007737E9 /* FontSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontSettings.swift; sourceTree = ""; }; BA5F020426BB57F000581E92 /* NSAlert+Simplenote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSAlert+Simplenote.swift"; sourceTree = ""; }; + BA8CF21A2BFD20770087F33D /* SimplenoteIntents.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SimplenoteIntents.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + BA8CF21B2BFD20770087F33D /* Intents.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Intents.framework; path = System/Library/Frameworks/Intents.framework; sourceTree = SDKROOT; }; + BA8CF21E2BFD20780087F33D /* IntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentHandler.swift; sourceTree = ""; }; + BA8CF2202BFD20780087F33D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BA938CEB26ACFF4A00BE5A1D /* Remote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Remote.swift; sourceTree = ""; }; BA938CED26AD055400BE5A1D /* AccountVerificationController+TestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AccountVerificationController+TestHelpers.swift"; sourceTree = ""; }; BAA0A87926B9F0B50006260E /* RemoteError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoteError.swift; sourceTree = ""; }; @@ -938,6 +951,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BA8CF2172BFD20770087F33D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BA8CF21C2BFD20770087F33D /* Intents.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -958,6 +979,7 @@ 26F72A9214032D2A00A7935E /* Simplenote */, B5CBB06A241976230003C271 /* SimplenoteTests */, 26DBB1F61405A6E600186392 /* External */, + BA8CF21D2BFD20770087F33D /* SimplenoteIntents */, 26F72A8914032D2A00A7935E /* Products */, 26F72A8B14032D2A00A7935E /* Frameworks */, 8343BE2DC268495E77AD67DF /* Pods */, @@ -971,6 +993,7 @@ 26F72A8814032D2A00A7935E /* Simplenote.app */, 466FFF2F17CC10A800399652 /* Simplenote.app */, B5CBB069241976230003C271 /* SimplenoteTests.xctest */, + BA8CF21A2BFD20770087F33D /* SimplenoteIntents.appex */, ); name = Products; sourceTree = ""; @@ -991,6 +1014,7 @@ 0F7AA366214AF89DB7A1C687 /* Pods_Automattic_Simplenote.framework */, 86F72E095CFE66DE228AE8CA /* Pods_Automattic_Simplenote_AppStore.framework */, 22D95A169BF4BF7DEABC4021 /* Pods_Automattic_SimplenoteTests.framework */, + BA8CF21B2BFD20770087F33D /* Intents.framework */, ); name = Frameworks; sourceTree = ""; @@ -1703,6 +1727,15 @@ name = Preferences; sourceTree = ""; }; + BA8CF21D2BFD20770087F33D /* SimplenoteIntents */ = { + isa = PBXGroup; + children = ( + BA8CF21E2BFD20780087F33D /* IntentHandler.swift */, + BA8CF2202BFD20780087F33D /* Info.plist */, + ); + path = SimplenoteIntents; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -1722,6 +1755,7 @@ buildRules = ( ); dependencies = ( + BA8CF2252BFD21560087F33D /* PBXTargetDependency */, B52D0ECD230DCEA8003F799D /* PBXTargetDependency */, ); name = Simplenote; @@ -1782,6 +1816,25 @@ productReference = B5CBB069241976230003C271 /* SimplenoteTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + BA8CF2192BFD20770087F33D /* SimplenoteIntents */ = { + isa = PBXNativeTarget; + buildConfigurationList = BA8CF2232BFD20780087F33D /* Build configuration list for PBXNativeTarget "SimplenoteIntents" */; + buildPhases = ( + BA8CF2162BFD20770087F33D /* Sources */, + BA8CF2172BFD20770087F33D /* Frameworks */, + BA8CF2182BFD20770087F33D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SimplenoteIntents; + packageProductDependencies = ( + ); + productName = SimplenoteIntents; + productReference = BA8CF21A2BFD20770087F33D /* SimplenoteIntents.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -1789,7 +1842,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 1130; + LastSwiftUpdateCheck = 1530; LastUpgradeCheck = 1530; ORGANIZATIONNAME = Simperium; TargetAttributes = { @@ -1812,6 +1865,9 @@ ProvisioningStyle = Manual; TestTargetID = 26F72A8714032D2A00A7935E; }; + BA8CF2192BFD20770087F33D = { + CreatedOnToolsVersion = 15.3; + }; }; }; buildConfigurationList = 26F72A8214032D2900A7935E /* Build configuration list for PBXProject "Simplenote" */; @@ -1856,6 +1912,7 @@ 466FFEA617CC10A800399652 /* Simplenote-AppStore */, B52D0EC5230DCAD7003F799D /* SimplenoteSecrets */, B5CBB068241976230003C271 /* SimplenoteTests */, + BA8CF2192BFD20770087F33D /* SimplenoteIntents */, ); }; /* End PBXProject section */ @@ -1926,6 +1983,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BA8CF2182BFD20770087F33D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -2527,6 +2591,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BA8CF2162BFD20770087F33D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BA8CF21F2BFD20780087F33D /* IntentHandler.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -2545,6 +2617,11 @@ target = 26F72A8714032D2A00A7935E /* Simplenote */; targetProxy = B5CBB06E241976230003C271 /* PBXContainerItemProxy */; }; + BA8CF2252BFD21560087F33D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BA8CF2192BFD20770087F33D /* SimplenoteIntents */; + targetProxy = BA8CF2242BFD21560087F33D /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -3055,6 +3132,108 @@ }; name = Release; }; + BA8CF2212BFD20780087F33D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ZL97FBBQH7; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = SimplenoteIntents/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = SimplenoteIntents; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 Simperium. All rights reserved."; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.automattic.SimplenoteMac.SimplenoteIntents; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_OBJC_BRIDGING_HEADER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + BA8CF2222BFD20780087F33D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ZL97FBBQH7; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = SimplenoteIntents/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = SimplenoteIntents; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 Simperium. All rights reserved."; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.automattic.SimplenoteMac.SimplenoteIntents; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_OBJC_BRIDGING_HEADER = ""; + SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -3103,6 +3282,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + BA8CF2232BFD20780087F33D /* Build configuration list for PBXNativeTarget "SimplenoteIntents" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BA8CF2212BFD20780087F33D /* Debug */, + BA8CF2222BFD20780087F33D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ diff --git a/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteIntents.xcscheme b/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteIntents.xcscheme new file mode 100644 index 000000000..952aa1436 --- /dev/null +++ b/Simplenote.xcodeproj/xcshareddata/xcschemes/SimplenoteIntents.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SimplenoteIntents/Info.plist b/SimplenoteIntents/Info.plist new file mode 100644 index 000000000..ee646a161 --- /dev/null +++ b/SimplenoteIntents/Info.plist @@ -0,0 +1,20 @@ + + + + + NSExtension + + NSExtensionAttributes + + IntentsRestrictedWhileLocked + + IntentsSupported + + + NSExtensionPointIdentifier + com.apple.intents-service + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).IntentHandler + + + diff --git a/SimplenoteIntents/IntentHandler.swift b/SimplenoteIntents/IntentHandler.swift new file mode 100644 index 000000000..66ac05d1d --- /dev/null +++ b/SimplenoteIntents/IntentHandler.swift @@ -0,0 +1,20 @@ +// +// IntentHandler.swift +// SimplenoteIntents +// +// Created by Charlie Scheer on 5/21/24. +// Copyright © 2024 Simperium. All rights reserved. +// + +import Intents + +class IntentHandler: INExtension { + + override func handler(for intent: INIntent) -> Any { + // This is the default implementation. If you want different objects to handle different intents, + // you can override this and return the handler you want for that particular intent. + + return self + } + +}