Skip to content

Commit 503473d

Browse files
fix: Infinite recursion and Incorrect deprecation notice in PathRunnable (#889)
* Fixed infinite recursion in the setter LaunchAction.pathRunnable * Moved the deprecation notice to the correct initializer * Fixed up inits as suggested in review * Fix linting issues --------- Co-authored-by: Pedro <[email protected]>
1 parent d3df426 commit 503473d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public extension XCScheme {
4848
runnable as? PathRunnable
4949
}
5050
set {
51-
self.pathRunnable = newValue
51+
runnable = newValue
5252
}
5353
}
5454

@@ -87,7 +87,6 @@ public extension XCScheme {
8787

8888
// MARK: - Init
8989

90-
@available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.")
9190
public init(runnable: Runnable?,
9291
buildConfiguration: String,
9392
preActions: [ExecutionAction] = [],
@@ -97,7 +96,6 @@ public extension XCScheme {
9796
selectedLauncherIdentifier: String = XCScheme.defaultLauncher,
9897
launchStyle: Style = .auto,
9998
askForAppToLaunch: Bool? = nil,
100-
pathRunnable _: PathRunnable? = nil,
10199
customWorkingDirectory: String? = nil,
102100
useCustomWorkingDirectory: Bool = false,
103101
ignoresPersistentStateOnLaunch: Bool = false,
@@ -170,8 +168,9 @@ public extension XCScheme {
170168
super.init(preActions, postActions)
171169
}
172170

171+
@available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.")
173172
public convenience init(
174-
pathRunnable: PathRunnable?,
173+
runnable: Runnable?,
175174
buildConfiguration: String,
176175
preActions: [ExecutionAction] = [],
177176
postActions: [ExecutionAction] = [],
@@ -180,6 +179,7 @@ public extension XCScheme {
180179
selectedLauncherIdentifier: String = XCScheme.defaultLauncher,
181180
launchStyle: Style = .auto,
182181
askForAppToLaunch: Bool? = nil,
182+
pathRunnable: PathRunnable?,
183183
customWorkingDirectory: String? = nil,
184184
useCustomWorkingDirectory: Bool = false,
185185
ignoresPersistentStateOnLaunch: Bool = false,
@@ -222,7 +222,6 @@ public extension XCScheme {
222222
selectedLauncherIdentifier: selectedLauncherIdentifier,
223223
launchStyle: launchStyle,
224224
askForAppToLaunch: askForAppToLaunch,
225-
pathRunnable: pathRunnable,
226225
customWorkingDirectory: customWorkingDirectory,
227226
useCustomWorkingDirectory: useCustomWorkingDirectory,
228227
ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch,

0 commit comments

Comments
 (0)