Skip to content

Commit

Permalink
fix: Infinite recursion and Incorrect deprecation notice in PathRunna…
Browse files Browse the repository at this point in the history
…ble (#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]>
  • Loading branch information
georgenavarro and pepicrft authored Dec 19, 2024
1 parent d3df426 commit 503473d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public extension XCScheme {
runnable as? PathRunnable
}
set {
self.pathRunnable = newValue
runnable = newValue
}
}

Expand Down Expand Up @@ -87,7 +87,6 @@ public extension XCScheme {

// MARK: - Init

@available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.")
public init(runnable: Runnable?,
buildConfiguration: String,
preActions: [ExecutionAction] = [],
Expand All @@ -97,7 +96,6 @@ public extension XCScheme {
selectedLauncherIdentifier: String = XCScheme.defaultLauncher,
launchStyle: Style = .auto,
askForAppToLaunch: Bool? = nil,
pathRunnable _: PathRunnable? = nil,
customWorkingDirectory: String? = nil,
useCustomWorkingDirectory: Bool = false,
ignoresPersistentStateOnLaunch: Bool = false,
Expand Down Expand Up @@ -170,8 +168,9 @@ public extension XCScheme {
super.init(preActions, postActions)
}

@available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.")
public convenience init(
pathRunnable: PathRunnable?,
runnable: Runnable?,
buildConfiguration: String,
preActions: [ExecutionAction] = [],
postActions: [ExecutionAction] = [],
Expand All @@ -180,6 +179,7 @@ public extension XCScheme {
selectedLauncherIdentifier: String = XCScheme.defaultLauncher,
launchStyle: Style = .auto,
askForAppToLaunch: Bool? = nil,
pathRunnable: PathRunnable?,
customWorkingDirectory: String? = nil,
useCustomWorkingDirectory: Bool = false,
ignoresPersistentStateOnLaunch: Bool = false,
Expand Down Expand Up @@ -222,7 +222,6 @@ public extension XCScheme {
selectedLauncherIdentifier: selectedLauncherIdentifier,
launchStyle: launchStyle,
askForAppToLaunch: askForAppToLaunch,
pathRunnable: pathRunnable,
customWorkingDirectory: customWorkingDirectory,
useCustomWorkingDirectory: useCustomWorkingDirectory,
ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch,
Expand Down

0 comments on commit 503473d

Please sign in to comment.