-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Exposed method to write project, workspace, schemes and breakpoints #215
Conversation
c052ea5
to
5e1aac5
Compare
CHANGELOG.md
Outdated
@@ -9,6 +9,7 @@ | |||
|
|||
### Changed | |||
- **Breaking:** `XCWorkspace.Data` renamed to `XCWorkspaceData` and removed `references`. | |||
- Added methods to get paths to workspace, project and breakpoints and shemes files, added public methods to write them separatery. |
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.
Don't forget to add your GitHub handle at the end here @ilyapuchka 😛
Sources/xcproj/XcodeProj.swift
Outdated
/// | ||
/// - Parameter path: `.xcodeproj` file path | ||
/// - Returns: worspace file path relative to the given path. | ||
public func workspacePath(_ path: Path) -> Path { |
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.
I think this method can be static since it doesn't need anything from the XcodeProj
instance.
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.
I'd add a simple unit test to make sure the path si properly generated.
Sources/xcproj/XcodeProj.swift
Outdated
/// | ||
/// - Parameter path: `.xcodeproj` file path | ||
/// - Returns: project file path relative to the given path. | ||
public func projectPath(_ path: Path) -> Path { |
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.
Same comment here regarding making this method static and testing it.
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.
What about naming it pbxprojPath
to make it consistent with the write method?
Sources/xcproj/XcodeProj.swift
Outdated
/// - Parameter path: `.xcodeproj` file path | ||
/// - Returns: shared data path relative to the given path. | ||
public func sharedDataPath(_ path: Path) -> Path { | ||
return path + "xcshareddata" |
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.
Same comment regarding making it static and testing it
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.
Actually the same comment applies to all the path methods that you added 😜
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.
Just left some minor comments @ilyapuchka. Great job on this PR 👏 . Once addressed feel free to merge it since you got another thumb up. If I'm not wrong, you should have received an invitation to be a contributor of the organization. That gives you permissions to merge PRs.
By the way! A downside of keeping a |
0e58ab0
to
c847ab3
Compare
c847ab3
to
19bb5c5
Compare
All code review comments addressed, but I can't merge this myself yet. |
@ilyapuchka you have to accept invitation to @xcodeswift contributors team.
|
@allu22 I didn't get invitation yet =) |
I sent you the invitation again @ilyapuchka |
👍 |
Short description 📝
When writing project with
XcodeProj.write
there is no control over what parts of it will be written, so i.e. workspace and schemes are being overridden when only project changes. Together with #214 it leads to unneeded changes.Solution 📦
There are public methods to write scheme, workspace, project etc. but methods used by
XcodeProj.write
provide more functionality and automatically write data in correct paths, when writing project throughpbxproj.write
requires to construct correct path to project file manually. Also added public methods to get those paths to give users more flexibility, i.e. to write individual scheme file instead of overriding all schemes folder.This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)