-
Notifications
You must be signed in to change notification settings - Fork 845
Feature: Custom Working Directory #1543
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
Feature: Custom Working Directory #1543
Conversation
…ties to `Scheme.Run`
… generating `XCScheme.LaunchAction`
…useCustomWorkingDirectory` properties
Sources/ProjectSpec/Scheme.swift
Outdated
@@ -523,6 +530,8 @@ extension Scheme.Run: JSONObjectConvertible { | |||
} | |||
customLLDBInit = jsonDictionary.json(atKeyPath: "customLLDBInit") | |||
macroExpansion = jsonDictionary.json(atKeyPath: "macroExpansion") | |||
customWorkingDirectory = jsonDictionary.json(atKeyPath: "customWorkingDirectory") | |||
useCustomWorkingDirectory = jsonDictionary.json(atKeyPath: "useCustomWorkingDirectory") ?? Scheme.Run.useCustomWorkingDirectoryDefault |
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.
We'll need to write these values in toJSONValue
as well
customWorkingDirectory: scheme.run?.customWorkingDirectory, | ||
useCustomWorkingDirectory: scheme.run?.useCustomWorkingDirectory ?? Scheme.Run.useCustomWorkingDirectoryDefault, |
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.
We could drop the useCustomWorkingDirectory
property entirely and use a non nil value of customWorkingDirectory for this. What are your thoughts? Do you have need to set these separately?
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.
No, I don't have that need so I'll apply your suggestions 👍🏼
…he customWorkingDirectory is set to non nil
…rkingDirectory based on the value of Schema.Run.customWorkingDirectory
@yonaskolb I've applied your suggestions and added a check to make sure that |
…s no longer user defined.
I wanted the ability to set the current working directory in the run action:
XcodeProj already supports this so I just added two new properties to
Scheme.Run
so that they can be passed toXCScheme.LaunchAction
during the generation process.