Skip to content

Add support for Xcode 16 and synchronized groups#985

Merged
amorde merged 14 commits into
CocoaPods:masterfrom
gui17aume:feature/xcode16-synchronized-groups
Oct 26, 2024
Merged

Add support for Xcode 16 and synchronized groups#985
amorde merged 14 commits into
CocoaPods:masterfrom
gui17aume:feature/xcode16-synchronized-groups

Conversation

@gui17aume
Copy link
Copy Markdown

@gui17aume gui17aume commented Oct 25, 2024

This PR aims to support Xcode 16 project files and especially the new file system synchronized groups.

It is based on the work done by @Brett-Best in this other PR: #942 👍

Changes

  • Add the new object version 77
  • Add types and fields related to file system synchronized groups :
  PBXNativeTarget
+   fileSystemSynchronizedGroups

+ PBXFileSystemSynchronizedRootGroup
+   exceptions
+   explicitFileTypes
+   explicitFolders
+   indentWidth
+   path
+   sourceTree
+   tabWidth
+   usesTabs
+   wrapsLines

+ PBXFileSystemSynchronizedBuildFileExceptionSet
+   additionalCompilerFlagsByRelativePath
+   attributesByRelativePath
+   membershipExceptions
+   platformFiltersByRelativePath
+   privateHeaders
+   publicHeaders
+   target

+ PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet
+   buildPhase
+   membershipExceptions
+   platformFiltersByRelativePath

  XCBuildConfiguration
+   baseConfigurationReferenceAnchor
+   baseConfigurationReferenceRelativePath

Copy link
Copy Markdown
Member

@amorde amorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Brett-Best and @gui17aume both for contributing this 🙏

I'm going to do some follow up testing & updates for Xcode 16 and then will ship a new release.

@drewolbrich
Copy link
Copy Markdown

Thank you @gui17aume and @Brett-Best !!
❤️❤️❤️

attribute :platform_filters_by_relative_path, Hash

def display_name
"Exceptions for \"#{GroupableHelper.parent(self).display_name}\" folder in \"#{target.name}\" target"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you have this explicit string here vs what Xcode itself generates here: PBXFileSystemSynchronizedBuildFileExceptionSet

Xcode replaces this string with that when editing the project file, so we're seeing a back-and-forth diff of this comment being edited by both parties.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked in Xcode 16.2RC and this string format is what is used on my projects still.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1000

oh I'm on 16.1, let me try 16.2 real quick to verify

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm Xcode 16.2 RC still reverts this comment:

  1. we're calling fastlane increment_version_number_in_xcodeproj, which just does project = Xcodeproj::Project.open, edits a build setting, then does project.save
  2. this custom comment then gets added
  3. move a package/group/file in Xcode that is tracked in the project file
  4. the comment now becomes PBXFileSystemSynchronizedBuildFileExceptionSet

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also happens on our project.

Along with the formatting back and forths:
Xcode 16.2 uses condensed format:

/* Begin PBXFileSystemSynchronizedRootGroup section */
		E12863882D59E53C00CA99E1 /* Sources */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (E12864172D59E53D00CA99E1 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, E12864182D59E53D00CA99E1 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Sources; sourceTree = "<group>"; };
		E128641E2D59E56300CA99E1 /* Resources */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (E12864252D59E56300CA99E1 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Resources; sourceTree = "<group>"; };
		E128660E2D59E79800CA99E1 /* TestApp */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = TestApp; sourceTree = "<group>"; };
		E12866192D59E7B000CA99E1 /* UnitTests */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = UnitTests; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */

Xcodeproj 1.27.0 uses petty printed:

/* Begin PBXFileSystemSynchronizedRootGroup section */
		E12863882D59E53C00CA99E1 /* Sources */ = {
			isa = PBXFileSystemSynchronizedRootGroup;
			exceptions = (
				E12864172D59E53D00CA99E1 /* Exceptions for "Sources" folder in "IntentsExtensionUI" target */,
				E12864182D59E53D00CA99E1 /* Exceptions for "Sources" folder in "WidgetExtension" target */,
			);
			explicitFileTypes = {
			};
			explicitFolders = (
			);
			path = Sources;
			sourceTree = "<group>";
		};
		E128641E2D59E56300CA99E1 /* Resources */ = {
			isa = PBXFileSystemSynchronizedRootGroup;
			exceptions = (
				E12864252D59E56300CA99E1 /* Exceptions for "Resources" folder in "IntentsExtensionUI" target */,
			);
			explicitFileTypes = {
			};
			explicitFolders = (
			);
			path = Resources;
			sourceTree = "<group>";
		};
		E128660E2D59E79800CA99E1 /* TestApp */ = {
			isa = PBXFileSystemSynchronizedRootGroup;
			exceptions = (
			);
			explicitFileTypes = {
			};
			explicitFolders = (
			);
			path = TestApp;
			sourceTree = "<group>";
		};
		E12866192D59E7B000CA99E1 /* UnitTests */ = {
			isa = PBXFileSystemSynchronizedRootGroup;
			exceptions = (
			);
			explicitFileTypes = {
			};
			explicitFolders = (
			);
			path = UnitTests;
			sourceTree = "<group>";
		};
/* End PBXFileSystemSynchronizedRootGroup section */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants