-
Notifications
You must be signed in to change notification settings - Fork 458
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: Xcode 16.0 support #942
Draft
Brett-Best
wants to merge
5
commits into
CocoaPods:master
Choose a base branch
from
Brett-Best:feature/Xcode-16.0-Support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f29aa8a
Updated `constants.rb` to include Xcode 16.0 object version
Brett-Best 4151dda
Added root object attribute for `preferredProjectObjectVersion`
Brett-Best 013bba2
Updated object versions for Xcode 16.0b6
Brett-Best a437b26
Added support for `PBXFileSystemSynchronizedRootGroup`s
Brett-Best 2b87c2c
Added support for `PBXFileSystemSynchronizedBuildFileExceptionSet`s
Brett-Best 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 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
This file contains 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
15 changes: 15 additions & 0 deletions
15
lib/xcodeproj/project/object/file_system_synchronized_root_group.rb
This file contains 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Xcodeproj | ||
class Project | ||
module Object | ||
# This class represents a file system synchronized root group. | ||
class PBXFileSystemSynchronizedRootGroup < AbstractObject | ||
attribute :path, String | ||
attribute :source_tree, String, 'group' | ||
def display_name | ||
return path if path | ||
super | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
@Brett-Best thank you for working on this!
Unfortunately, from what I was able to gather, the implementation is a tiny bit incomplete.
There are a few attributes that
PBXFileSystemSynchronizedRootGroup
has in common withPBXGroup
, such as tabs/indent properties.There are also some properties unique to
PBXFileSystemSynchronizedRootGroup
that need to be added, such asexplicitFileTypes
,explicitFolders
and exceptions (which require a furtherPBXFileSystemSynchronizedBuildFileExceptionSet
object to represent).Without this, I believe the representation will be incomplete and cause crashes.
I can recommend this article on synchronized groups by @pepicrft or this Tuist PR by the same for further info.
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.
Thanks for the reply, yeah, it would be nice if the project file specification was published somewhere 🙃.
Yep, I expect if the project file uses these additional attributes that warnings/errors/crashes should be emitted.
I basically just added support to unblock the current utilization of the
PBXFileSystemSynchronizedRootGroup
in a project I was working on.I may or may not end up updating this PR with the additional types, given CocoaPods is now in maintenance mode 😄.
Unfortunately, can't migrate off of CocoaPods to SPM yet because React Native 😢
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.
You know, I don't think you're that far away! There are only a few things missing:
PBXGroup
toPBXFileSystemSynchronizedRootGroup
:name
,uses_tabs
,indent_width
,tab_width
,wraps_lines
PBXFileSystemSynchronizedRootGroup
:explicit_file_types
(typeHash
)explicit_folders
(typeArray
)exceptions
(relation, has_many of typePBXFileSystemSynchronizedBuildFileExceptionSet
)PBXFileSystemSynchronizedBuildFileExceptionSet
with attributes:target
(relation, has_oneAbstractTarget
)membership_exceptions
(typeArray
)public_headers
(typeArray
)private_headers
(typeArray
)additional_compiler_flags_by_relative_path
(typeHash
)attributes_by_relative_path
(typeHash
)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.
Thanks for the reply, I've run into a new issue:
When a build configuration uses an xcconfig in the new folders the baseConfigurationReference is removed and replaced with baseConfigurationReferenceAnchor (PBXFileSystemSynchronizedRootGroup) and baseConfigurationReferenceRelativePath.
I managed to add that to the
xcodeproj
mostly fine but on the cocoapods side it needs some love at least in this section:https://github.com/CocoaPods/CocoaPods/blob/85e6d43ca63f8acf0bb3f3d910e8ff1f6558a4e8/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb#L44-L66
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.
Another issue is that my change adds
file_system_synchronized_groups
to all entries which is fine but when you edit the project file in Xcode, it removes the entries that are empty arrays.Would you have any idea how I can stop Xcodeproj from adding empty array entries?
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 issue above with the
exceptions
key of aPBXFileSystemSynchronizedRootGroup
.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.
@Brett-Best I've looked at the rest of the uses of
has_many
- I think it's not possible to avoid initializing the emptyObjectList
. Is this causing any issues? From what I know, many other things generated byXcodeproj
get modified by Xcode, and this has never been a concern.In any case, great work! There are just a few more attributes to add, I think all of those are simple value types:
PBXGroup
toPBXFileSystemSynchronizedRootGroup
:name
,uses_tabs
,indent_width
,tab_width
,wraps_lines
PBXFileSystemSynchronizedRootGroup
:explicit_file_types
(typeHash
)explicit_folders
(typeArray
)PBXFileSystemSynchronizedBuildFileExceptionSet
:public_headers
(typeArray
)private_headers
(typeArray
)additional_compiler_flags_by_relative_path
(typeHash
)attributes_by_relative_path
(typeHash
)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.
@igor-makarov along with the additional attributes listed, hopefully they don't also add empty groups.
Yes it is an issue, other things in the
Pod
project can sometimes change if you open it in Xcode to inspect the settings etc but this far less likely to be done on a day to day basis.Whereas changing the settings of your own project is much more common.
Where I work atm we have churn of this getting added in / removed.
As a workaround I did come up with some regex but I couldn't get it to work on shell cause multiline hah...