-
-
Notifications
You must be signed in to change notification settings - Fork 346
refactor: Update PathRunnable so that it subclasses Runnable #883
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cb186a9
Made the buildableReference parameter of Runnable's init an optional β¦
georgenavarro 8c4f164
Refactored PathRunnable to subclass from Runnable.
georgenavarro 50f4d28
Removed pathRunnable property from LaunchAction
georgenavarro 3c07bf5
Brought back pathRunnable var on LaunchAction as a computed var for bβ¦
georgenavarro c6d73d9
Removed excessive isEqual check in PathRunnable's == implementation
georgenavarro 7d90c53
Added support for PathRunnable in ProfileAction
georgenavarro e656f7d
Added a convenience init method to LaunchAction with a PathRunnable pβ¦
georgenavarro ad3e91b
Make the inits non-breaking
pepicrft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| } | ||
| } | ||
|
|
||
| public var customWorkingDirectory: String? | ||
| public var useCustomWorkingDirectory: Bool | ||
| public var ignoresPersistentStateOnLaunch: Bool | ||
|
|
@@ -81,6 +87,7 @@ public extension XCScheme { | |
|
|
||
| // MARK: - Init | ||
|
|
||
| @available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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] = [], | ||
|
|
@@ -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, | ||
|
|
@@ -163,7 +171,7 @@ public extension XCScheme { | |
| } | ||
|
|
||
| public convenience init( | ||
| runnable: Runnable?, | ||
| pathRunnable: PathRunnable?, | ||
| buildConfiguration: String, | ||
| preActions: [ExecutionAction] = [], | ||
| postActions: [ExecutionAction] = [], | ||
|
|
@@ -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, | ||
|
|
@@ -206,7 +213,7 @@ public extension XCScheme { | |
| customLLDBInitFile: String? = nil | ||
| ) { | ||
| self.init( | ||
| runnable: pathRunnable ?? runnable, | ||
| runnable: pathRunnable, | ||
| buildConfiguration: buildConfiguration, | ||
| preActions: preActions, | ||
| postActions: postActions, | ||
|
|
@@ -215,6 +222,7 @@ public extension XCScheme { | |
| selectedLauncherIdentifier: selectedLauncherIdentifier, | ||
| launchStyle: launchStyle, | ||
| askForAppToLaunch: askForAppToLaunch, | ||
| pathRunnable: pathRunnable, | ||
| customWorkingDirectory: customWorkingDirectory, | ||
| useCustomWorkingDirectory: useCustomWorkingDirectory, | ||
| ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch, | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.