feat: add path to XcodeProj and XCWorkspace#892
Merged
fortmarek merged 2 commits intotuist:mainfrom Dec 21, 2024
Merged
Conversation
fortmarek
reviewed
Dec 20, 2024
Member
fortmarek
left a comment
There was a problem hiding this comment.
I'd also add path to the XCWorkspace: https://github.com/tuist/XcodeProj/blob/main/Sources/XcodeProj/Workspace/XCWorkspace.swift
I'll leave it up to you if you wanna do it in this PR or in a subsequent one.
fortmarek
approved these changes
Dec 21, 2024
fortmarek
approved these changes
Dec 21, 2024
Member
|
We also really need to migrate the paths from |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves tuist/XcodeGraph#87 (comment)
Short description 📝
This PR introduces an optional
projectPathproperty toXcodeProj, allowing the project to be initialized and managed without requiring a file system path. It maintains full backward compatibility for existing users while offering more flexibility for in-memory project constructions or integrations with path management logic outside ofXcodeProj.Solution 📦
The
projectPathproperty is now optional. When loading from a file system path,projectPathis set automatically. If users createXcodeProjinstances in memory using the new initializer,projectPathcan remainnil. This approach preserves existing behavior while enabling new use cases, such as working withXcodeProjin environments where a project might not yet exist on disk.Implementation 👩💻👨💻
projectPath: Path?as an optional property inXcodeProj.init(path:)to setprojectPathwhen loading from disk.XcodeProjinstances without aprojectPath.projectPathin the equality check to distinguish between projects referencing different directories.