Support folder-based .xcconfig references in XCConfigIntegrator #12811
+31
−21
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 ma
2D2A
rked 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.
Support folder-based .xcconfig references in XCConfigIntegrator
Problem
When an Xcode project uses a folder reference (blue folder) for its
.xcconfig
files, CocoaPods’XCConfigIntegrator
only checks thebaseConfigurationReference
and ignores thebase_configuration_reference_anchor
andbase_configuration_reference_relative_path
. As a result, runningpod install
will overwrite the user’s custom.xcconfig
file withPods-*.xcconfig
, breaking custom build configurations.Related Properties
base_configuration_reference_anchor
:PBXFileSystemSynchronizedRootGroup
, representing a special attribute for folder references.XCConfigIntegrator
.base_configuration_reference_relative_path
:String
, representing the relative path of the.xcconfig
file within the folder reference.Solution
We updated the
set_target_xcconfig
method inXCConfigIntegrator
to properly handle folder-based.xcconfig
files.Improvements
Handling folder-based
.xcconfig
files:base_configuration_reference_anchor
andbase_configuration_reference_relative_path
to handle folder-based configuration files.Improved warning messages:
UI.warn
to include folder reference and relative path information, making the issue clearer.Benefits
.xcconfig
through folder references can retain their custom configurations..xcconfig
behavior remains unaffected.Known Issue
Currently, the
#{path}
displayed inUI.warn
does not accurately represent the intended relative path. Calculating the relative path correctly for display purposes remains a challenge, requiring further improvements.Testing
.xcconfig
setups.pod install
preserves the correct base configuration in all scenarios.References
#12806