Skip to content
18 changes: 13 additions & 5 deletions Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ public extension XCScheme {
public var launchStyle: Style
public var askForAppToLaunch: Bool?
public var pathRunnable: PathRunnable? {
// For backwards compatibility
runnable as? PathRunnable
// For backwards compatibility
get {
runnable as? PathRunnable
}
set {
self.pathRunnable = newValue
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pepicrft Looks like this was supposed to be self.runnable = newValue. Xcode is warning about infinite recursion since it is essentially calling it's own setter.

}
}

public var customWorkingDirectory: String?
public var useCustomWorkingDirectory: Bool
public var ignoresPersistentStateOnLaunch: Bool
Expand Down Expand Up @@ -81,6 +87,7 @@ public extension XCScheme {

// MARK: - Init

@available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pepicrft I think this deprecation warning was attached to the wrong init since the other convenience init now only accepts a PathRunnable

public init(runnable: Runnable?,
buildConfiguration: String,
preActions: [ExecutionAction] = [],
Expand All @@ -90,6 +97,7 @@ 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 @@ -163,7 +171,7 @@ public extension XCScheme {
}

public convenience init(
runnable: Runnable?,
pathRunnable: PathRunnable?,
buildConfiguration: String,
preActions: [ExecutionAction] = [],
postActions: [ExecutionAction] = [],
Expand All @@ -172,7 +180,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 @@ -206,7 +213,7 @@ public extension XCScheme {
customLLDBInitFile: String? = nil
) {
self.init(
runnable: pathRunnable ?? runnable,
runnable: pathRunnable,
buildConfiguration: buildConfiguration,
preActions: preActions,
postActions: postActions,
Expand All @@ -215,6 +222,7 @@ public extension XCScheme {
selectedLauncherIdentifier: selectedLauncherIdentifier,
launchStyle: launchStyle,
askForAppToLaunch: askForAppToLaunch,
pathRunnable: pathRunnable,
customWorkingDirectory: customWorkingDirectory,
useCustomWorkingDirectory: useCustomWorkingDirectory,
ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch,
Expand Down
Loading