Skip to content
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

Load Xcode Project-Relative XCConfig Files #238

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

briantkelley
Copy link
Contributor

@briantkelley briantkelley commented Mar 2, 2018

Short description 📝

If an xcconfig file includes another xcconfig file with a relative path, Xcode will first attempt to load the included file relative to the including xcconfig's path. If that fails, Xcode will attempt to load the included xcconfig file relative to the Xcode project.

Solution 📦

Add the Xcode Project Path as an optional parameter to the XCConfig initializer, so we can use that to resolve the include's relative path.

I went with making it an optional parameter instead of required to maintain source compatibility and to de-empahasize this less used feature. Open to making it required, however.


This change is Reviewable

@toshi0383
Copy link
Contributor

I didn’t know about this behavior.👀
Just wondering, but what if the xcodeproj is included from other xcodeproj from different directory?
Does it resolve to $(SRCROOT) or how does it work?

If an xcconfig file includes another xcconfig file with a relative path, Xcode will first attempt to load the included file relative to the including xcconfig's path. If that fails, Xcode will attempt to load the included xcconfig file relative to the Xcode project. Add support for the latter form of include resolution.
@briantkelley briantkelley force-pushed the xcconfig-proj-relative branch from e927d8f to 0c55b0e Compare March 2, 2018 16:42
@briantkelley
Copy link
Contributor Author

@toshi0383 Yeah, it's similar to $(SRCROOT). It resolves against the Xcode project using the xcconfig file that caused the relative include, so it's consistent regardless of whether an Xcode project is or isn't included in another Xcode project.

@briantkelley briantkelley merged commit 557e1d8 into master Mar 2, 2018
@briantkelley briantkelley deleted the xcconfig-proj-relative branch March 2, 2018 18:48
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.

3 participants