Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Infinite recursion and Incorrect deprecation notice in PathRunnable #889

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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?,
Copy link
Collaborator

@kwridan kwridan Dec 10, 2024

Choose a reason for hiding this comment

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

this init has both runnable and pathRunnable :/

For the deprecation the following is needed:

// Consolidated init
init(
    runnable: Runnable?,
    // ....
)


@available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.")
init(
    runnable: Runnable?,
    // ....
    pathRunnable: PathRunnable?, // <-- without a default `= nil`,
    // ....
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with this, I'll prepare the change!

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
Loading