diff --git a/Tests/XcodeTests/UIKitProject/MyWidget/AppIntent.swift b/Tests/XcodeTests/UIKitProject/MyWidget/AppIntent.swift deleted file mode 100644 index 0ad5cc1611..0000000000 --- a/Tests/XcodeTests/UIKitProject/MyWidget/AppIntent.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// AppIntent.swift -// MyWidget -// -// Created by Ian Leitch on 30.10.23. -// - -import WidgetKit -import AppIntents - -struct ConfigurationAppIntent: WidgetConfigurationIntent { - static var title: LocalizedStringResource = "Configuration" - static var description = IntentDescription("This is an example widget.") - - // An example configurable parameter. - @Parameter(title: "Favorite Emoji", default: "😃") - var favoriteEmoji: String -} diff --git a/Tests/XcodeTests/UIKitProject/MyWidget/MyWidget.swift b/Tests/XcodeTests/UIKitProject/MyWidget/MyWidget.swift deleted file mode 100644 index 67c5456fcc..0000000000 --- a/Tests/XcodeTests/UIKitProject/MyWidget/MyWidget.swift +++ /dev/null @@ -1,92 +0,0 @@ -// -// MyWidget.swift -// MyWidget -// -// Created by Ian Leitch on 30.10.23. -// - -import WidgetKit -import SwiftUI - -struct Provider: AppIntentTimelineProvider { - func placeholder(in context: Context) -> SimpleEntry { - SimpleEntry(date: Date(), configuration: ConfigurationAppIntent()) - } - - func snapshot(for configuration: ConfigurationAppIntent, in context: Context) async -> SimpleEntry { - SimpleEntry(date: Date(), configuration: configuration) - } - - func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline { - var entries: [SimpleEntry] = [] - - // Generate a timeline consisting of five entries an hour apart, starting from the current date. - let currentDate = Date() - for hourOffset in 0 ..< 5 { - let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! - let entry = SimpleEntry(date: entryDate, configuration: configuration) - entries.append(entry) - } - - return Timeline(entries: entries, policy: .atEnd) - } - - func recommendations() -> [AppIntentRecommendation] { - // Create an array with all the preconfigured widgets to show. - [AppIntentRecommendation(intent: ConfigurationAppIntent(), description: "Example Widget")] - } -} - -struct SimpleEntry: TimelineEntry { - let date: Date - let configuration: ConfigurationAppIntent -} - -struct MyWidgetEntryView : View { - var entry: Provider.Entry - - var body: some View { - VStack { - HStack { - Text("Time:") - Text(entry.date, style: .time) - } - - Text("Favorite Emoji:") - Text(entry.configuration.favoriteEmoji) - } - } -} - -@main -struct MyWidget: Widget { - let kind: String = "MyWidget" - - var body: some WidgetConfiguration { - AppIntentConfiguration(kind: kind, intent: ConfigurationAppIntent.self, provider: Provider()) { entry in - MyWidgetEntryView(entry: entry) - .containerBackground(.fill.tertiary, for: .widget) - } - } -} - -extension ConfigurationAppIntent { - fileprivate static var smiley: ConfigurationAppIntent { - let intent = ConfigurationAppIntent() - intent.favoriteEmoji = "😀" - return intent - } - - fileprivate static var starEyes: ConfigurationAppIntent { - let intent = ConfigurationAppIntent() - intent.favoriteEmoji = "🤩" - return intent - } -} - -#Preview(as: .accessoryRectangular) { - MyWidget() -} timeline: { - SimpleEntry(date: .now, configuration: .smiley) - SimpleEntry(date: .now, configuration: .starEyes) -} diff --git a/Tests/XcodeTests/UIKitProject/UIKitProject.xcodeproj/project.pbxproj b/Tests/XcodeTests/UIKitProject/UIKitProject.xcodeproj/project.pbxproj index 9f725f1d10..6b4065d078 100644 --- a/Tests/XcodeTests/UIKitProject/UIKitProject.xcodeproj/project.pbxproj +++ b/Tests/XcodeTests/UIKitProject/UIKitProject.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -26,18 +26,17 @@ 3C9B06E725547C3800E45614 /* StoryboardViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C9B06E625547C3800E45614 /* StoryboardViewController.storyboard */; }; 3C9B06EA25547CEC00E45614 /* StoryboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C9B06E925547CEC00E45614 /* StoryboardViewController.swift */; }; 3C9EFBA82684E1B70071E973 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 3C9EFBA62684E1B70071E973 /* Model.xcdatamodeld */; }; + 3CBEB9D22AEFC25B00F5947D /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CFFB5A82AEF8FDE002EFB86 /* WidgetKit.framework */; }; + 3CBEB9D32AEFC25B00F5947D /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CFFB5AA2AEF8FDE002EFB86 /* SwiftUI.framework */; }; + 3CBEB9D62AEFC25B00F5947D /* WatchWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBEB9D52AEFC25B00F5947D /* WatchWidget.swift */; }; + 3CBEB9D92AEFC25C00F5947D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3CBEB9D82AEFC25C00F5947D /* Assets.xcassets */; }; + 3CBEB9DB2AEFC25C00F5947D /* WatchWidget.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3CBEB9D72AEFC25B00F5947D /* WatchWidget.intentdefinition */; }; 3CD46111256C034C00856DAC /* MultiTargetStruct.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD46107256C02FE00856DAC /* MultiTargetStruct.swift */; }; 3CD46115256C034D00856DAC /* MultiTargetStruct.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD46107256C02FE00856DAC /* MultiTargetStruct.swift */; }; 3CD8FF922683ACBB001951CD /* EntityValueTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD8FF912683ACBB001951CD /* EntityValueTransformer.swift */; }; 3CE3F7CC2685DEFB0047231C /* OldModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 3CE3F7CA2685DEFB0047231C /* OldModel.xcdatamodeld */; }; 3CE3F7CE2685DF0F0047231C /* ModelMapping.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 3CE3F7CD2685DF0F0047231C /* ModelMapping.xcmappingmodel */; }; 3CE3F7D02685E07C0047231C /* CustomEntityMigrationPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CE3F7CF2685E07C0047231C /* CustomEntityMigrationPolicy.swift */; }; - 3CFFB5A92AEF8FDE002EFB86 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CFFB5A82AEF8FDE002EFB86 /* WidgetKit.framework */; }; - 3CFFB5AB2AEF8FDE002EFB86 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CFFB5AA2AEF8FDE002EFB86 /* SwiftUI.framework */; }; - 3CFFB5AE2AEF8FDE002EFB86 /* MyWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CFFB5AD2AEF8FDE002EFB86 /* MyWidget.swift */; }; - 3CFFB5B02AEF8FDE002EFB86 /* AppIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CFFB5AF2AEF8FDE002EFB86 /* AppIntent.swift */; }; - 3CFFB5B22AEF8FDF002EFB86 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3CFFB5B12AEF8FDF002EFB86 /* Assets.xcassets */; }; - 3CFFB5B72AEF9038002EFB86 /* MultiTargetStruct.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD46107256C02FE00856DAC /* MultiTargetStruct.swift */; }; 73AF86CD2968A93900BED352 /* LocalPackageTarget in Frameworks */ = {isa = PBXBuildFile; productRef = 73AF86CC2968A93900BED352 /* LocalPackageTarget */; }; /* End PBXBuildFile section */ @@ -115,18 +114,18 @@ 3C9B06E625547C3800E45614 /* StoryboardViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = StoryboardViewController.storyboard; sourceTree = ""; }; 3C9B06E925547CEC00E45614 /* StoryboardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoryboardViewController.swift; sourceTree = ""; }; 3C9EFBA72684E1B70071E973 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; }; + 3CBEB9D12AEFC25B00F5947D /* WatchWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = WatchWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 3CBEB9D52AEFC25B00F5947D /* WatchWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchWidget.swift; sourceTree = ""; }; + 3CBEB9D72AEFC25B00F5947D /* WatchWidget.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = WatchWidget.intentdefinition; sourceTree = ""; }; + 3CBEB9D82AEFC25C00F5947D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3CBEB9DA2AEFC25C00F5947D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3CD46107256C02FE00856DAC /* MultiTargetStruct.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiTargetStruct.swift; sourceTree = ""; }; 3CD8FF912683ACBB001951CD /* EntityValueTransformer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntityValueTransformer.swift; sourceTree = ""; }; 3CE3F7CB2685DEFB0047231C /* OldModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = OldModel.xcdatamodel; sourceTree = ""; }; 3CE3F7CD2685DF0F0047231C /* ModelMapping.xcmappingmodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcmappingmodel; path = ModelMapping.xcmappingmodel; sourceTree = ""; }; 3CE3F7CF2685E07C0047231C /* CustomEntityMigrationPolicy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomEntityMigrationPolicy.swift; sourceTree = ""; }; - 3CFFB5A72AEF8FDE002EFB86 /* MyWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MyWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 3CFFB5A82AEF8FDE002EFB86 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; 3CFFB5AA2AEF8FDE002EFB86 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; - 3CFFB5AD2AEF8FDE002EFB86 /* MyWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyWidget.swift; sourceTree = ""; }; - 3CFFB5AF2AEF8FDE002EFB86 /* AppIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIntent.swift; sourceTree = ""; }; - 3CFFB5B12AEF8FDF002EFB86 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 3CFFB5B32AEF8FDF002EFB86 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 73AF86C3296881F900BED352 /* LocalPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = LocalPackage; path = LocalPackages/LocalPackage; sourceTree = ""; }; /* End PBXFileReference section */ @@ -161,12 +160,12 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 3CFFB5A42AEF8FDE002EFB86 /* Frameworks */ = { + 3CBEB9CE2AEFC25B00F5947D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3CFFB5AB2AEF8FDE002EFB86 /* SwiftUI.framework in Frameworks */, - 3CFFB5A92AEF8FDE002EFB86 /* WidgetKit.framework in Frameworks */, + 3CBEB9D32AEFC25B00F5947D /* SwiftUI.framework in Frameworks */, + 3CBEB9D22AEFC25B00F5947D /* WidgetKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -216,7 +215,7 @@ 3C1FECFE2556D5AB0001BD58 /* UIKitProjectTests */, 3C1FED182556D91C0001BD58 /* Target With Spaces */, 3C1A70B2256BBAB300E07E4A /* NotificationServiceExtension */, - 3CFFB5AC2AEF8FDE002EFB86 /* MyWidget */, + 3CBEB9D42AEFC25B00F5947D /* WatchWidget */, 3C84965B255405AD00900DA9 /* Products */, 73F8B878296880AC004B1A5E /* Frameworks */, ); @@ -229,7 +228,7 @@ 3C1FECFD2556D5AB0001BD58 /* UIKitProjectTests.xctest */, 3C1FED172556D91C0001BD58 /* Target_With_Spaces.framework */, 3C1A70B1256BBAB300E07E4A /* NotificationServiceExtension.appex */, - 3CFFB5A72AEF8FDE002EFB86 /* MyWidgetExtension.appex */, + 3CBEB9D12AEFC25B00F5947D /* WatchWidgetExtension.appex */, ); name = Products; sourceTree = ""; @@ -268,23 +267,23 @@ path = "Preview Content"; sourceTree = ""; }; - 3CD4610D256C032500856DAC /* MultiTarget */ = { + 3CBEB9D42AEFC25B00F5947D /* WatchWidget */ = { isa = PBXGroup; children = ( - 3CD46107256C02FE00856DAC /* MultiTargetStruct.swift */, + 3CBEB9D52AEFC25B00F5947D /* WatchWidget.swift */, + 3CBEB9D72AEFC25B00F5947D /* WatchWidget.intentdefinition */, + 3CBEB9D82AEFC25C00F5947D /* Assets.xcassets */, + 3CBEB9DA2AEFC25C00F5947D /* Info.plist */, ); - path = MultiTarget; + path = WatchWidget; sourceTree = ""; }; - 3CFFB5AC2AEF8FDE002EFB86 /* MyWidget */ = { + 3CD4610D256C032500856DAC /* MultiTarget */ = { isa = PBXGroup; children = ( - 3CFFB5AD2AEF8FDE002EFB86 /* MyWidget.swift */, - 3CFFB5AF2AEF8FDE002EFB86 /* AppIntent.swift */, - 3CFFB5B12AEF8FDF002EFB86 /* Assets.xcassets */, - 3CFFB5B32AEF8FDF002EFB86 /* Info.plist */, + 3CD46107256C02FE00856DAC /* MultiTargetStruct.swift */, ); - path = MyWidget; + path = MultiTarget; sourceTree = ""; }; 73AF86C2296881F900BED352 /* LocalPackages */ = { @@ -395,21 +394,21 @@ productReference = 3C84965A255405AD00900DA9 /* UIKitProject.app */; productType = "com.apple.product-type.application"; }; - 3CFFB5A62AEF8FDE002EFB86 /* MyWidgetExtension */ = { + 3CBEB9D02AEFC25B00F5947D /* WatchWidgetExtension */ = { isa = PBXNativeTarget; - buildConfigurationList = 3CFFB5B62AEF8FDF002EFB86 /* Build configuration list for PBXNativeTarget "MyWidgetExtension" */; + buildConfigurationList = 3CBEB9DC2AEFC25C00F5947D /* Build configuration list for PBXNativeTarget "WatchWidgetExtension" */; buildPhases = ( - 3CFFB5A32AEF8FDE002EFB86 /* Sources */, - 3CFFB5A42AEF8FDE002EFB86 /* Frameworks */, - 3CFFB5A52AEF8FDE002EFB86 /* Resources */, + 3CBEB9CD2AEFC25B00F5947D /* Sources */, + 3CBEB9CE2AEFC25B00F5947D /* Frameworks */, + 3CBEB9CF2AEFC25B00F5947D /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = MyWidgetExtension; - productName = MyWidgetExtension; - productReference = 3CFFB5A72AEF8FDE002EFB86 /* MyWidgetExtension.appex */; + name = WatchWidgetExtension; + productName = WatchWidgetExtension; + productReference = 3CBEB9D12AEFC25B00F5947D /* WatchWidgetExtension.appex */; productType = "com.apple.product-type.app-extension"; }; /* End PBXNativeTarget section */ @@ -418,7 +417,7 @@ 3C849652255405AD00900DA9 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1510; + LastSwiftUpdateCheck = 1430; LastUpgradeCheck = 1420; TargetAttributes = { 3C1A70B0256BBAB300E07E4A = { @@ -435,8 +434,8 @@ 3C849659255405AD00900DA9 = { CreatedOnToolsVersion = 12.2; }; - 3CFFB5A62AEF8FDE002EFB86 = { - CreatedOnToolsVersion = 15.1; + 3CBEB9D02AEFC25B00F5947D = { + CreatedOnToolsVersion = 14.3.1; }; }; }; @@ -457,7 +456,7 @@ 3C1FECFC2556D5AB0001BD58 /* UIKitProjectTests */, 3C1FED162556D91C0001BD58 /* Target With Spaces */, 3C1A70B0256BBAB300E07E4A /* NotificationServiceExtension */, - 3CFFB5A62AEF8FDE002EFB86 /* MyWidgetExtension */, + 3CBEB9D02AEFC25B00F5947D /* WatchWidgetExtension */, ); }; /* End PBXProject section */ @@ -497,11 +496,11 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 3CFFB5A52AEF8FDE002EFB86 /* Resources */ = { + 3CBEB9CF2AEFC25B00F5947D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3CFFB5B22AEF8FDF002EFB86 /* Assets.xcassets in Resources */, + 3CBEB9D92AEFC25C00F5947D /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -552,13 +551,12 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 3CFFB5A32AEF8FDE002EFB86 /* Sources */ = { + 3CBEB9CD2AEFC25B00F5947D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3CFFB5B72AEF9038002EFB86 /* MultiTargetStruct.swift in Sources */, - 3CFFB5AE2AEF8FDE002EFB86 /* MyWidget.swift in Sources */, - 3CFFB5B02AEF8FDE002EFB86 /* AppIntent.swift in Sources */, + 3CBEB9DB2AEFC25C00F5947D /* WatchWidget.intentdefinition in Sources */, + 3CBEB9D62AEFC25B00F5947D /* WatchWidget.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -902,20 +900,17 @@ }; name = Release; }; - 3CFFB5B42AEF8FDF002EFB86 /* Debug */ = { + 3CBEB9DD2AEFC25C00F5947D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = MyWidget/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = MyWidget; + INFOPLIST_FILE = WatchWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = WatchWidget; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -923,13 +918,11 @@ "@executable_path/../../Frameworks", "@executable_path/../../../../Frameworks", ); - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.github.ileitch.MyWidget; + PRODUCT_BUNDLE_IDENTIFIER = com.github.ileitch.WatchWidget; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; @@ -937,20 +930,17 @@ }; name = Debug; }; - 3CFFB5B52AEF8FDF002EFB86 /* Release */ = { + 3CBEB9DE2AEFC25C00F5947D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = MyWidget/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = MyWidget; + INFOPLIST_FILE = WatchWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = WatchWidget; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -958,9 +948,8 @@ "@executable_path/../../Frameworks", "@executable_path/../../../../Frameworks", ); - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.github.ileitch.MyWidget; + PRODUCT_BUNDLE_IDENTIFIER = com.github.ileitch.WatchWidget; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SKIP_INSTALL = YES; @@ -1019,11 +1008,11 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3CFFB5B62AEF8FDF002EFB86 /* Build configuration list for PBXNativeTarget "MyWidgetExtension" */ = { + 3CBEB9DC2AEFC25C00F5947D /* Build configuration list for PBXNativeTarget "WatchWidgetExtension" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3CFFB5B42AEF8FDF002EFB86 /* Debug */, - 3CFFB5B52AEF8FDF002EFB86 /* Release */, + 3CBEB9DD2AEFC25C00F5947D /* Debug */, + 3CBEB9DE2AEFC25C00F5947D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Tests/XcodeTests/UIKitProject/UIKitProject.xcodeproj/xcshareddata/xcschemes/UIKitProject.xcscheme b/Tests/XcodeTests/UIKitProject/UIKitProject.xcodeproj/xcshareddata/xcschemes/UIKitProject.xcscheme index 75a76b10d1..100fa2d94d 100644 --- a/Tests/XcodeTests/UIKitProject/UIKitProject.xcodeproj/xcshareddata/xcschemes/UIKitProject.xcscheme +++ b/Tests/XcodeTests/UIKitProject/UIKitProject.xcodeproj/xcshareddata/xcschemes/UIKitProject.xcscheme @@ -28,9 +28,9 @@ buildForAnalyzing = "YES"> diff --git a/Tests/XcodeTests/UIKitProject/MyWidget/Assets.xcassets/AccentColor.colorset/Contents.json b/Tests/XcodeTests/UIKitProject/WatchWidget/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from Tests/XcodeTests/UIKitProject/MyWidget/Assets.xcassets/AccentColor.colorset/Contents.json rename to Tests/XcodeTests/UIKitProject/WatchWidget/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/Tests/XcodeTests/UIKitProject/MyWidget/Assets.xcassets/AppIcon.appiconset/Contents.json b/Tests/XcodeTests/UIKitProject/WatchWidget/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Tests/XcodeTests/UIKitProject/MyWidget/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Tests/XcodeTests/UIKitProject/WatchWidget/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Tests/XcodeTests/UIKitProject/MyWidget/Assets.xcassets/Contents.json b/Tests/XcodeTests/UIKitProject/WatchWidget/Assets.xcassets/Contents.json similarity index 100% rename from Tests/XcodeTests/UIKitProject/MyWidget/Assets.xcassets/Contents.json rename to Tests/XcodeTests/UIKitProject/WatchWidget/Assets.xcassets/Contents.json diff --git a/Tests/XcodeTests/UIKitProject/MyWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json b/Tests/XcodeTests/UIKitProject/WatchWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json similarity index 100% rename from Tests/XcodeTests/UIKitProject/MyWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json rename to Tests/XcodeTests/UIKitProject/WatchWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json diff --git a/Tests/XcodeTests/UIKitProject/MyWidget/Info.plist b/Tests/XcodeTests/UIKitProject/WatchWidget/Info.plist similarity index 100% rename from Tests/XcodeTests/UIKitProject/MyWidget/Info.plist rename to Tests/XcodeTests/UIKitProject/WatchWidget/Info.plist diff --git a/Tests/XcodeTests/UIKitProject/WatchWidget/WatchWidget.intentdefinition b/Tests/XcodeTests/UIKitProject/WatchWidget/WatchWidget.intentdefinition new file mode 100644 index 0000000000..bdb404554a --- /dev/null +++ b/Tests/XcodeTests/UIKitProject/WatchWidget/WatchWidget.intentdefinition @@ -0,0 +1,59 @@ + + + + + INEnums + + INIntentDefinitionModelVersion + 1.2 + INIntentDefinitionNamespace + 88xZPY + INIntentDefinitionSystemVersion + 20A294 + INIntentDefinitionToolsBuildVersion + 12A6144 + INIntentDefinitionToolsVersion + 12.0 + INIntents + + + INIntentCategory + information + INIntentDescriptionID + tVvJ9c + INIntentEligibleForWidgets + + INIntentIneligibleForSuggestions + + INIntentName + Configuration + INIntentResponse + + INIntentResponseCodes + + + INIntentResponseCodeName + success + INIntentResponseCodeSuccess + + + + INIntentResponseCodeName + failure + + + + INIntentTitle + Configuration + INIntentTitleID + gpCwrM + INIntentType + Custom + INIntentVerb + View + + + INTypes + + + diff --git a/Tests/XcodeTests/UIKitProject/WatchWidget/WatchWidget.swift b/Tests/XcodeTests/UIKitProject/WatchWidget/WatchWidget.swift new file mode 100644 index 0000000000..63a5f354a1 --- /dev/null +++ b/Tests/XcodeTests/UIKitProject/WatchWidget/WatchWidget.swift @@ -0,0 +1,75 @@ +// +// WatchWidget.swift +// WatchWidget +// +// Created by Ian Leitch on 30.10.23. +// + +import WidgetKit +import SwiftUI +import Intents + +struct Provider: IntentTimelineProvider { + func placeholder(in context: Context) -> SimpleEntry { + SimpleEntry(date: Date(), configuration: ConfigurationIntent()) + } + + func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) { + let entry = SimpleEntry(date: Date(), configuration: configuration) + completion(entry) + } + + func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline) -> ()) { + var entries: [SimpleEntry] = [] + + // Generate a timeline consisting of five entries an hour apart, starting from the current date. + let currentDate = Date() + for hourOffset in 0 ..< 5 { + let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! + let entry = SimpleEntry(date: entryDate, configuration: configuration) + entries.append(entry) + } + + let timeline = Timeline(entries: entries, policy: .atEnd) + completion(timeline) + } + + func recommendations() -> [IntentRecommendation] { + return [ + IntentRecommendation(intent: ConfigurationIntent(), description: "My Intent Widget") + ] + } +} + +struct SimpleEntry: TimelineEntry { + let date: Date + let configuration: ConfigurationIntent +} + +struct WatchWidgetEntryView : View { + var entry: Provider.Entry + + var body: some View { + Text(entry.date, style: .time) + } +} + +@main +struct WatchWidget: Widget { + let kind: String = "WatchWidget" + + var body: some WidgetConfiguration { + IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in + WatchWidgetEntryView(entry: entry) + } + .configurationDisplayName("My Widget") + .description("This is an example widget.") + } +} + +struct WatchWidget_Previews: PreviewProvider { + static var previews: some View { + WatchWidgetEntryView(entry: SimpleEntry(date: Date(), configuration: ConfigurationIntent())) + .previewContext(WidgetPreviewContext(family: .accessoryRectangular)) + } +} diff --git a/Tests/XcodeTests/UIKitProjectTest.swift b/Tests/XcodeTests/UIKitProjectTest.swift index fb03da5fc4..3071424417 100644 --- a/Tests/XcodeTests/UIKitProjectTest.swift +++ b/Tests/XcodeTests/UIKitProjectTest.swift @@ -10,7 +10,7 @@ class UIKitProjectTest: SourceGraphTestCase { configuration.project = UIKitProjectPath.string configuration.schemes = ["UIKitProject"] - configuration.targets = ["UIKitProject", "NotificationServiceExtension", "MyWidgetExtension", + configuration.targets = ["UIKitProject", "NotificationServiceExtension", "WatchWidgetExtension", "UIKitProjectTests", "LocalPackage.LocalPackageTarget", "LocalPackage.LocalPackageTargetTests"]