From c81473bb2c62dbdf2068562a15fd2d1ca8f62a23 Mon Sep 17 00:00:00 2001 From: "Takuto NAKAMURA (Kyome)" Date: Tue, 26 Nov 2024 16:39:39 +0900 Subject: [PATCH 1/2] Added workaround for mac catalyst --- Examples/Examples.xcodeproj/project.pbxproj | 16 ++++++++++------ .../ExamplesForSwiftUI.entitlements | 10 ++++++++++ Plugins/PrepareLicenseList/main.swift | 13 +++++++++++-- 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 Examples/ExamplesForSwiftUI/ExamplesForSwiftUI.entitlements diff --git a/Examples/Examples.xcodeproj/project.pbxproj b/Examples/Examples.xcodeproj/project.pbxproj index 07c2f19..2c17436 100644 --- a/Examples/Examples.xcodeproj/project.pbxproj +++ b/Examples/Examples.xcodeproj/project.pbxproj @@ -23,6 +23,7 @@ /* Begin PBXFileReference section */ 188460622C37EDE2005C370A /* LicenseList */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = LicenseList; path = ..; sourceTree = ""; }; + 188707F02CF5882D00E5A6CF /* ExamplesForSwiftUI.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ExamplesForSwiftUI.entitlements; sourceTree = ""; }; 18FCC4412C37E4550052500D /* ExamplesForSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExamplesForSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; 18FCC4432C37E4550052500D /* ExamplesForSwiftUIApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExamplesForSwiftUIApp.swift; sourceTree = ""; }; 18FCC4452C37E4550052500D /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -81,6 +82,7 @@ 18FCC4422C37E4550052500D /* ExamplesForSwiftUI */ = { isa = PBXGroup; children = ( + 188707F02CF5882D00E5A6CF /* ExamplesForSwiftUI.entitlements */, 18FCC4432C37E4550052500D /* ExamplesForSwiftUIApp.swift */, 18FCC4452C37E4550052500D /* ContentView.swift */, 18FCC4472C37E4560052500D /* Assets.xcassets */, @@ -394,10 +396,11 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = ExamplesForSwiftUI/ExamplesForSwiftUI.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"ExamplesForSwiftUI/Preview Content\""; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = VHY32ZU4KA; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -413,12 +416,12 @@ PRODUCT_BUNDLE_IDENTIFIER = com.cybozu.swiftui.examples; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = NO; + SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,3"; + TARGETED_DEVICE_FAMILY = "1,2,3"; }; name = Debug; }; @@ -427,10 +430,11 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = ExamplesForSwiftUI/ExamplesForSwiftUI.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"ExamplesForSwiftUI/Preview Content\""; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = VHY32ZU4KA; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -446,12 +450,12 @@ PRODUCT_BUNDLE_IDENTIFIER = com.cybozu.swiftui.examples; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = NO; + SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,3"; + TARGETED_DEVICE_FAMILY = "1,2,3"; }; name = Release; }; diff --git a/Examples/ExamplesForSwiftUI/ExamplesForSwiftUI.entitlements b/Examples/ExamplesForSwiftUI/ExamplesForSwiftUI.entitlements new file mode 100644 index 0000000..ee95ab7 --- /dev/null +++ b/Examples/ExamplesForSwiftUI/ExamplesForSwiftUI.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/Plugins/PrepareLicenseList/main.swift b/Plugins/PrepareLicenseList/main.swift index 57e8a7a..eb0b989 100644 --- a/Plugins/PrepareLicenseList/main.swift +++ b/Plugins/PrepareLicenseList/main.swift @@ -34,10 +34,19 @@ struct PrepareLicenseList: BuildToolPlugin { // This command works with the plugin specified in `Package.swift`. func createBuildCommands(context: PluginContext, target: Target) async throws -> [Command] { + let sourcePackagesPath = try sourcePackages(context.pluginWorkDirectory) + // Workaround for Mac Catalyst + let debugMacCatalystPath = sourcePackagesPath.removingLastComponent() + .appending(["Build", "Products", "Debug-maccatalyst"]) + let executablePath: Path = if FileManager.default.fileExists(atPath: debugMacCatalystPath.string) { + debugMacCatalystPath.appending(["spp"]) + } else { + try context.tool(named: "spp").path + } return [ makeBuildCommand( - executablePath: try context.tool(named: "spp").path, - sourcePackagesPath: try sourcePackages(context.pluginWorkDirectory), + executablePath: executablePath, + sourcePackagesPath: sourcePackagesPath, outputPath: context.pluginWorkDirectory ) ] From 856b25f7caa2e239c5d3f0e18332e517dc0cc073 Mon Sep 17 00:00:00 2001 From: "Takuto NAKAMURA (Kyome)" Date: Tue, 26 Nov 2024 17:04:30 +0900 Subject: [PATCH 2/2] Added mac catalyst to Platforms. --- Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Package.swift b/Package.swift index 6444e33..7a10f7e 100644 --- a/Package.swift +++ b/Package.swift @@ -6,6 +6,7 @@ let package = Package( name: "LicenseList", platforms: [ .iOS(.v15), + .macCatalyst(.v15), .tvOS(.v17), ], products: [