From 98516a29e9c0e2586ac73b4c0bad8a379c95d358 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Fri, 2 May 2025 15:35:17 +0500 Subject: [PATCH 1/3] feat: add the App Clip's URL to the Run action --- Sources/XcodeGraph/Models/RunAction.swift | 11 ++++++++--- .../Mappers/Schemes/XCSchemeMapper.swift | 3 ++- Tests/XcodeGraphTests/Models/RunActionTests.swift | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Sources/XcodeGraph/Models/RunAction.swift b/Sources/XcodeGraph/Models/RunAction.swift index a0c2e092..b97d1fa3 100644 --- a/Sources/XcodeGraph/Models/RunAction.swift +++ b/Sources/XcodeGraph/Models/RunAction.swift @@ -17,6 +17,7 @@ public struct RunAction: Equatable, Codable, Sendable { public let metalOptions: MetalOptions? public let expandVariableFromTarget: TargetReference? public let launchStyle: LaunchStyle + public let appClipInvocationURLString: String? // MARK: - Init @@ -33,7 +34,8 @@ public struct RunAction: Equatable, Codable, Sendable { diagnosticsOptions: SchemeDiagnosticsOptions, metalOptions: MetalOptions? = nil, expandVariableFromTarget: TargetReference? = nil, - launchStyle: LaunchStyle = .automatically + launchStyle: LaunchStyle = .automatically, + appClipInvocationURLString: String? ) { self.configurationName = configurationName self.attachDebugger = attachDebugger @@ -48,6 +50,7 @@ public struct RunAction: Equatable, Codable, Sendable { self.metalOptions = metalOptions self.expandVariableFromTarget = expandVariableFromTarget self.launchStyle = launchStyle + self.appClipInvocationURLString = appClipInvocationURLString } } @@ -72,7 +75,8 @@ public struct RunAction: Equatable, Codable, Sendable { apiValidation: true ), expandVariableFromTarget: TargetReference? = nil, - launchStyle: LaunchStyle = .automatically + launchStyle: LaunchStyle = .automatically, + appClipInvocationURLString: String? = nil ) -> RunAction { RunAction( configurationName: configurationName, @@ -87,7 +91,8 @@ public struct RunAction: Equatable, Codable, Sendable { diagnosticsOptions: diagnosticsOptions, metalOptions: metalOptions, expandVariableFromTarget: expandVariableFromTarget, - launchStyle: launchStyle + launchStyle: launchStyle, + appClipInvocationURLString: appClipInvocationURLString ) } } diff --git a/Sources/XcodeGraphMapper/Mappers/Schemes/XCSchemeMapper.swift b/Sources/XcodeGraphMapper/Mappers/Schemes/XCSchemeMapper.swift index 6d84897c..e2335b19 100644 --- a/Sources/XcodeGraphMapper/Mappers/Schemes/XCSchemeMapper.swift +++ b/Sources/XcodeGraphMapper/Mappers/Schemes/XCSchemeMapper.swift @@ -218,7 +218,8 @@ struct XCSchemeMapper: SchemeMapping { filePath: nil, arguments: arguments, options: RunActionOptions(), - diagnosticsOptions: diagnosticsOptions + diagnosticsOptions: diagnosticsOptions, + appClipInvocationURLString: action.appClipInvocationURLString ) } diff --git a/Tests/XcodeGraphTests/Models/RunActionTests.swift b/Tests/XcodeGraphTests/Models/RunActionTests.swift index aa68ca45..a456d555 100644 --- a/Tests/XcodeGraphTests/Models/RunActionTests.swift +++ b/Tests/XcodeGraphTests/Models/RunActionTests.swift @@ -31,7 +31,8 @@ final class RunActionTests: XCTestCase { diagnosticsOptions: SchemeDiagnosticsOptions( mainThreadCheckerEnabled: true, performanceAntipatternCheckerEnabled: true - ) + ), + appClipInvocationURLString: "app-clips-url" ) // Then From de8fd782f6d12da698b1e3efa7591637f08446ff Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sun, 8 Jun 2025 12:05:03 +0400 Subject: [PATCH 2/3] feat: change parsing of App Clips data from a string to a URL --- Sources/XcodeGraph/Models/RunAction.swift | 10 +++++----- .../Mappers/Schemes/XCSchemeMapper.swift | 2 +- Tests/XcodeGraphTests/Models/RunActionTests.swift | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/XcodeGraph/Models/RunAction.swift b/Sources/XcodeGraph/Models/RunAction.swift index b97d1fa3..cc6a483d 100644 --- a/Sources/XcodeGraph/Models/RunAction.swift +++ b/Sources/XcodeGraph/Models/RunAction.swift @@ -17,7 +17,7 @@ public struct RunAction: Equatable, Codable, Sendable { public let metalOptions: MetalOptions? public let expandVariableFromTarget: TargetReference? public let launchStyle: LaunchStyle - public let appClipInvocationURLString: String? + public let appClipInvocationURL: URL? // MARK: - Init @@ -35,7 +35,7 @@ public struct RunAction: Equatable, Codable, Sendable { metalOptions: MetalOptions? = nil, expandVariableFromTarget: TargetReference? = nil, launchStyle: LaunchStyle = .automatically, - appClipInvocationURLString: String? + appClipInvocationURL: URL? ) { self.configurationName = configurationName self.attachDebugger = attachDebugger @@ -50,7 +50,7 @@ public struct RunAction: Equatable, Codable, Sendable { self.metalOptions = metalOptions self.expandVariableFromTarget = expandVariableFromTarget self.launchStyle = launchStyle - self.appClipInvocationURLString = appClipInvocationURLString + self.appClipInvocationURL = appClipInvocationURL } } @@ -76,7 +76,7 @@ public struct RunAction: Equatable, Codable, Sendable { ), expandVariableFromTarget: TargetReference? = nil, launchStyle: LaunchStyle = .automatically, - appClipInvocationURLString: String? = nil + appClipInvocationURL: URL? = nil ) -> RunAction { RunAction( configurationName: configurationName, @@ -92,7 +92,7 @@ public struct RunAction: Equatable, Codable, Sendable { metalOptions: metalOptions, expandVariableFromTarget: expandVariableFromTarget, launchStyle: launchStyle, - appClipInvocationURLString: appClipInvocationURLString + appClipInvocationURL: appClipInvocationURL ) } } diff --git a/Sources/XcodeGraphMapper/Mappers/Schemes/XCSchemeMapper.swift b/Sources/XcodeGraphMapper/Mappers/Schemes/XCSchemeMapper.swift index e2335b19..70fc0687 100644 --- a/Sources/XcodeGraphMapper/Mappers/Schemes/XCSchemeMapper.swift +++ b/Sources/XcodeGraphMapper/Mappers/Schemes/XCSchemeMapper.swift @@ -219,7 +219,7 @@ struct XCSchemeMapper: SchemeMapping { arguments: arguments, options: RunActionOptions(), diagnosticsOptions: diagnosticsOptions, - appClipInvocationURLString: action.appClipInvocationURLString + appClipInvocationURL: action.appClipInvocationURLString.flatMap { URL(string: $0) } ) } diff --git a/Tests/XcodeGraphTests/Models/RunActionTests.swift b/Tests/XcodeGraphTests/Models/RunActionTests.swift index a456d555..0b8b3d67 100644 --- a/Tests/XcodeGraphTests/Models/RunActionTests.swift +++ b/Tests/XcodeGraphTests/Models/RunActionTests.swift @@ -32,7 +32,7 @@ final class RunActionTests: XCTestCase { mainThreadCheckerEnabled: true, performanceAntipatternCheckerEnabled: true ), - appClipInvocationURLString: "app-clips-url" + appClipInvocationURL: URL(string: "https://app-clips-url.com/example") ) // Then From 21e54c7199839b207b0c7c00bdfa63186a18e0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fo=C5=99t?= Date: Mon, 30 Jun 2025 14:39:47 +0200 Subject: [PATCH 3/3] Update Sources/XcodeGraph/Models/RunAction.swift --- Sources/XcodeGraph/Models/RunAction.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeGraph/Models/RunAction.swift b/Sources/XcodeGraph/Models/RunAction.swift index cc6a483d..6515d5f6 100644 --- a/Sources/XcodeGraph/Models/RunAction.swift +++ b/Sources/XcodeGraph/Models/RunAction.swift @@ -35,7 +35,7 @@ public struct RunAction: Equatable, Codable, Sendable { metalOptions: MetalOptions? = nil, expandVariableFromTarget: TargetReference? = nil, launchStyle: LaunchStyle = .automatically, - appClipInvocationURL: URL? + appClipInvocationURL: URL? = nil ) { self.configurationName = configurationName self.attachDebugger = attachDebugger