@@ -42,7 +42,16 @@ public extension XCScheme {
4242 public var buildConfiguration : String
4343 public var launchStyle : Style
4444 public var askForAppToLaunch : Bool ?
45- public var pathRunnable : PathRunnable ?
45+ public var pathRunnable : PathRunnable ? {
46+ // For backwards compatibility
47+ get {
48+ runnable as? PathRunnable
49+ }
50+ set {
51+ self . pathRunnable = newValue
52+ }
53+ }
54+
4655 public var customWorkingDirectory : String ?
4756 public var useCustomWorkingDirectory : Bool
4857 public var ignoresPersistentStateOnLaunch : Bool
@@ -78,6 +87,7 @@ public extension XCScheme {
7887
7988 // MARK: - Init
8089
90+ @available ( * , deprecated, message: " Use the init() that consolidates pathRunnable and runnable into a single parameter. " )
8191 public init ( runnable: Runnable ? ,
8292 buildConfiguration: String ,
8393 preActions: [ ExecutionAction ] = [ ] ,
@@ -87,7 +97,7 @@ public extension XCScheme {
8797 selectedLauncherIdentifier: String = XCScheme . defaultLauncher,
8898 launchStyle: Style = . auto,
8999 askForAppToLaunch: Bool ? = nil ,
90- pathRunnable: PathRunnable ? = nil ,
100+ pathRunnable _ : PathRunnable ? = nil ,
91101 customWorkingDirectory: String ? = nil ,
92102 useCustomWorkingDirectory: Bool = false ,
93103 ignoresPersistentStateOnLaunch: Bool = false ,
@@ -126,7 +136,6 @@ public extension XCScheme {
126136 self . selectedDebuggerIdentifier = selectedDebuggerIdentifier
127137 self . selectedLauncherIdentifier = selectedLauncherIdentifier
128138 self . askForAppToLaunch = askForAppToLaunch
129- self . pathRunnable = pathRunnable
130139 self . customWorkingDirectory = customWorkingDirectory
131140 self . useCustomWorkingDirectory = useCustomWorkingDirectory
132141 self . ignoresPersistentStateOnLaunch = ignoresPersistentStateOnLaunch
@@ -161,6 +170,93 @@ public extension XCScheme {
161170 super. init ( preActions, postActions)
162171 }
163172
173+ public convenience init (
174+ pathRunnable: PathRunnable ? ,
175+ buildConfiguration: String ,
176+ preActions: [ ExecutionAction ] = [ ] ,
177+ postActions: [ ExecutionAction ] = [ ] ,
178+ macroExpansion: BuildableReference ? = nil ,
179+ selectedDebuggerIdentifier: String = XCScheme . defaultDebugger,
180+ selectedLauncherIdentifier: String = XCScheme . defaultLauncher,
181+ launchStyle: Style = . auto,
182+ askForAppToLaunch: Bool ? = nil ,
183+ customWorkingDirectory: String ? = nil ,
184+ useCustomWorkingDirectory: Bool = false ,
185+ ignoresPersistentStateOnLaunch: Bool = false ,
186+ debugDocumentVersioning: Bool = true ,
187+ debugServiceExtension: String = LaunchAction . defaultDebugServiceExtension,
188+ allowLocationSimulation: Bool = true ,
189+ locationScenarioReference: LocationScenarioReference ? = nil ,
190+ enableGPUFrameCaptureMode: GPUFrameCaptureMode = LaunchAction . defaultGPUFrameCaptureMode,
191+ disableGPUValidationMode: Bool = false ,
192+ enableGPUShaderValidationMode: Bool = false ,
193+ showGraphicsOverview: Bool = false ,
194+ logGraphicsOverview: Bool = false ,
195+ enableAddressSanitizer: Bool = false ,
196+ enableASanStackUseAfterReturn: Bool = false ,
197+ enableThreadSanitizer: Bool = false ,
198+ stopOnEveryThreadSanitizerIssue: Bool = false ,
199+ enableUBSanitizer: Bool = false ,
200+ stopOnEveryUBSanitizerIssue: Bool = false ,
201+ disableMainThreadChecker: Bool = false ,
202+ disablePerformanceAntipatternChecker: Bool = false ,
203+ stopOnEveryMainThreadCheckerIssue: Bool = false ,
204+ additionalOptions: [ AdditionalOption ] = [ ] ,
205+ commandlineArguments: CommandLineArguments ? = nil ,
206+ environmentVariables: [ EnvironmentVariable ] ? = nil ,
207+ language: String ? = nil ,
208+ region: String ? = nil ,
209+ showNonLocalizedStrings: Bool = false ,
210+ launchAutomaticallySubstyle: String ? = nil ,
211+ storeKitConfigurationFileReference: StoreKitConfigurationFileReference ? = nil ,
212+ customLaunchCommand: String ? = nil ,
213+ customLLDBInitFile: String ? = nil
214+ ) {
215+ self . init (
216+ runnable: pathRunnable,
217+ buildConfiguration: buildConfiguration,
218+ preActions: preActions,
219+ postActions: postActions,
220+ macroExpansion: macroExpansion,
221+ selectedDebuggerIdentifier: selectedDebuggerIdentifier,
222+ selectedLauncherIdentifier: selectedLauncherIdentifier,
223+ launchStyle: launchStyle,
224+ askForAppToLaunch: askForAppToLaunch,
225+ pathRunnable: pathRunnable,
226+ customWorkingDirectory: customWorkingDirectory,
227+ useCustomWorkingDirectory: useCustomWorkingDirectory,
228+ ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch,
229+ debugDocumentVersioning: debugDocumentVersioning,
230+ debugServiceExtension: debugServiceExtension,
231+ allowLocationSimulation: allowLocationSimulation,
232+ locationScenarioReference: locationScenarioReference,
233+ enableGPUFrameCaptureMode: enableGPUFrameCaptureMode,
234+ disableGPUValidationMode: disableGPUValidationMode,
235+ enableGPUShaderValidationMode: enableGPUShaderValidationMode,
236+ showGraphicsOverview: showGraphicsOverview,
237+ logGraphicsOverview: logGraphicsOverview,
238+ enableAddressSanitizer: enableAddressSanitizer,
239+ enableASanStackUseAfterReturn: enableASanStackUseAfterReturn,
240+ enableThreadSanitizer: enableThreadSanitizer,
241+ stopOnEveryThreadSanitizerIssue: stopOnEveryThreadSanitizerIssue,
242+ enableUBSanitizer: enableUBSanitizer,
243+ stopOnEveryUBSanitizerIssue: stopOnEveryUBSanitizerIssue,
244+ disableMainThreadChecker: disableMainThreadChecker,
245+ disablePerformanceAntipatternChecker: disablePerformanceAntipatternChecker,
246+ stopOnEveryMainThreadCheckerIssue: stopOnEveryMainThreadCheckerIssue,
247+ additionalOptions: additionalOptions,
248+ commandlineArguments: commandlineArguments,
249+ environmentVariables: environmentVariables,
250+ language: language,
251+ region: region,
252+ showNonLocalizedStrings: showNonLocalizedStrings,
253+ launchAutomaticallySubstyle: launchAutomaticallySubstyle,
254+ storeKitConfigurationFileReference: storeKitConfigurationFileReference,
255+ customLaunchCommand: customLaunchCommand,
256+ customLLDBInitFile: customLLDBInitFile
257+ )
258+ }
259+
164260 // swiftlint:disable:next function_body_length
165261 override init ( element: AEXMLElement ) throws {
166262 buildConfiguration = element. attributes [ " buildConfiguration " ] ?? LaunchAction . defaultBuildConfiguration
@@ -177,15 +273,13 @@ public extension XCScheme {
177273 // Runnable
178274 let buildableProductRunnableElement = element [ " BuildableProductRunnable " ]
179275 let remoteRunnableElement = element [ " RemoteRunnable " ]
276+ let pathRunnable = element [ " PathRunnable " ]
180277 if buildableProductRunnableElement. error == nil {
181278 runnable = try BuildableProductRunnable ( element: buildableProductRunnableElement)
182279 } else if remoteRunnableElement. error == nil {
183280 runnable = try RemoteRunnable ( element: remoteRunnableElement)
184- }
185-
186- let pathRunnable = element [ " PathRunnable " ]
187- if pathRunnable. error == nil {
188- self . pathRunnable = try PathRunnable ( element: pathRunnable)
281+ } else if pathRunnable. error == nil {
282+ runnable = try PathRunnable ( element: pathRunnable)
189283 }
190284
191285 let buildableReferenceElement = element [ " MacroExpansion " ] [ " BuildableReference " ]
@@ -324,10 +418,6 @@ public extension XCScheme {
324418 element. addChild ( runnable. xmlElement ( ) )
325419 }
326420
327- if let pathRunnable {
328- element. addChild ( pathRunnable. xmlElement ( ) )
329- }
330-
331421 if let locationScenarioReference {
332422 element. addChild ( locationScenarioReference. xmlElement ( ) )
333423 }
@@ -395,7 +485,6 @@ public extension XCScheme {
395485 buildConfiguration == rhs. buildConfiguration &&
396486 launchStyle == rhs. launchStyle &&
397487 askForAppToLaunch == rhs. askForAppToLaunch &&
398- pathRunnable == rhs. pathRunnable &&
399488 customWorkingDirectory == rhs. customWorkingDirectory &&
400489 useCustomWorkingDirectory == rhs. useCustomWorkingDirectory &&
401490 ignoresPersistentStateOnLaunch == rhs. ignoresPersistentStateOnLaunch &&
0 commit comments