From c9cb275d2ffa585eff92319a9ac39f341a66b57e Mon Sep 17 00:00:00 2001 From: Pedro Date: Tue, 12 Aug 2025 18:48:18 +0200 Subject: [PATCH 1/2] Make Target.metadata mutable and mark prune as deprecated --- Package.resolved | 10 +++++----- Sources/XcodeGraph/Models/Target.swift | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Package.resolved b/Package.resolved index 595f4f95..5b52b851 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "505645cbb783e49767bfc742c0bb9feef1221fa8bd51dda3c6497ea1c2598b4c", + "originHash" : "3723bf697fd3c9deb411523eef2023627c93557d8d2729d3e438c927a4be3b5c", "pins" : [ { "identity" : "aexml", @@ -33,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/FileSystem.git", "state" : { - "revision" : "23bcf23ce85edb653817a34c42c5140b16a6132c", - "version" : "0.11.5" + "revision" : "d2f49d5a9f8ada3b6e1a2bc4254d715b214d5753", + "version" : "0.11.8" } }, { @@ -168,8 +168,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tuist/XcodeProj", "state" : { - "revision" : "9799bb429fda8e360f4c535af1716bebc89fb235", - "version" : "9.4.3" + "revision" : "e1f2a4365669e02272b2f381b13a2378b15fb485", + "version" : "9.5.0" } }, { diff --git a/Sources/XcodeGraph/Models/Target.swift b/Sources/XcodeGraph/Models/Target.swift index 56deb909..52cb9341 100644 --- a/Sources/XcodeGraph/Models/Target.swift +++ b/Sources/XcodeGraph/Models/Target.swift @@ -56,11 +56,16 @@ public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { public var playgrounds: [AbsolutePath] public let additionalFiles: [FileElement] public var buildRules: [BuildRule] + @available(*, deprecated, message: """ + The prune attribute coupled XcodeGraph to a particular use-case of Tuist and therefore + we removed it in favor of using metadata as an in-memory context holder that can be leveraged + using conventional tags. + """) public var prune: Bool public let mergedBinaryType: MergedBinaryType public let mergeable: Bool public let onDemandResourcesTags: OnDemandResourcesTags? - public let metadata: TargetMetadata + public var metadata: TargetMetadata public let type: TargetType public let packages: [AbsolutePath] public let buildableFolders: [BuildableFolder] From b919ac4cfc7a3367b3e2556393ed6a5c9f49b016 Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 13 Aug 2025 18:19:35 +0200 Subject: [PATCH 2/2] add extra properties --- Sources/XcodeGraph/Models/RunAction.swift | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Sources/XcodeGraph/Models/RunAction.swift b/Sources/XcodeGraph/Models/RunAction.swift index 6515d5f6..400e9030 100644 --- a/Sources/XcodeGraph/Models/RunAction.swift +++ b/Sources/XcodeGraph/Models/RunAction.swift @@ -18,6 +18,8 @@ public struct RunAction: Equatable, Codable, Sendable { public let expandVariableFromTarget: TargetReference? public let launchStyle: LaunchStyle public let appClipInvocationURL: URL? + public var customWorkingDirectory: AbsolutePath? + public var useCustomWorkingDirectory: Bool // MARK: - Init @@ -35,7 +37,9 @@ public struct RunAction: Equatable, Codable, Sendable { metalOptions: MetalOptions? = nil, expandVariableFromTarget: TargetReference? = nil, launchStyle: LaunchStyle = .automatically, - appClipInvocationURL: URL? = nil + appClipInvocationURL: URL? = nil, + customWorkingDirectory: AbsolutePath? = nil, + useCustomWorkingDirectory: Bool = false ) { self.configurationName = configurationName self.attachDebugger = attachDebugger @@ -51,6 +55,8 @@ public struct RunAction: Equatable, Codable, Sendable { self.expandVariableFromTarget = expandVariableFromTarget self.launchStyle = launchStyle self.appClipInvocationURL = appClipInvocationURL + self.customWorkingDirectory = customWorkingDirectory + self.useCustomWorkingDirectory = useCustomWorkingDirectory } } @@ -76,7 +82,9 @@ public struct RunAction: Equatable, Codable, Sendable { ), expandVariableFromTarget: TargetReference? = nil, launchStyle: LaunchStyle = .automatically, - appClipInvocationURL: URL? = nil + appClipInvocationURL: URL? = nil, + customWorkingDirectory: AbsolutePath? = nil, + useCustomWorkingDirectory: Bool = false ) -> RunAction { RunAction( configurationName: configurationName, @@ -92,7 +100,9 @@ public struct RunAction: Equatable, Codable, Sendable { metalOptions: metalOptions, expandVariableFromTarget: expandVariableFromTarget, launchStyle: launchStyle, - appClipInvocationURL: appClipInvocationURL + appClipInvocationURL: appClipInvocationURL, + customWorkingDirectory: customWorkingDirectory, + useCustomWorkingDirectory: useCustomWorkingDirectory ) } }