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

Introduce --include-existing option #8

Merged
merged 18 commits into from
May 1, 2017
Merged

Conversation

toshi0383
Copy link
Owner

@toshi0383 toshi0383 commented Apr 30, 2017

Added --include-existing option (default true).
If the project already has configured xcconfigs, this option automatically adds #include to the xcconfig.

e.g. App.xcodeproj has been setup using CocoaPods

$ xcconfig-extractor App.xcodeproj configs
$ grep include configs/*
configs/App-Debug.xcconfig:#include "../Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"
configs/App-Release.xcconfig:#include "../Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"
configs/AppTests-Debug.xcconfig:#include "../Pods/Target Support Files/Pods-AppTests/Pods-AppTests.debug.xcconfig"
configs/AppTests-Release.xcconfig:#include "../Pods/Target Support Files/Pods-AppTests/Pods-AppTests.release.xcconfig"

@toshi0383 toshi0383 closed this Apr 30, 2017
@toshi0383 toshi0383 deleted the include-existing-option branch April 30, 2017 11:39
@toshi0383 toshi0383 restored the include-existing-option branch April 30, 2017 11:39
@toshi0383 toshi0383 reopened this Apr 30, 2017
@toshi0383
Copy link
Owner Author

toshi0383 commented Apr 30, 2017

# before
<     LD_RUNPATH_SEARCH_PATHS =  '@executable_path/Frameworks' '@loader_path/Frameworks' @executable_path/Frameworks
---
# after
>     LD_RUNPATH_SEARCH_PATHS =  @executable_path/Frameworks

'@executable_path/Frameworks' '@loader_path/Frameworks' is from CocoaPods' Pods-App.release.xcconfig.
LD_RUNPATH_SEARCH_PATHS is defined as $(inherited) @executable_path/Frameworks in generated App-Release.xcconfig which #includes Pods-App.release.xcconfig.
By #include ing, LD_RUNPATH_SEARCH_PATHS is overwritten. So CocoaPods configuration is ignored because there is nothing to "inherit" in Build Time.

FRAMEWORK_SEARCH_PATHS is in almost same simulation, but it's defined in generated Release.xcconfig which doesn't #include anything. So it's eventually inherited by Pods-App.release.xcconfig in this case.

SeeAlso: https://pewpewthespells.com/blog/xcconfig_guide.html#BuildSettingInheritance

I'm going to try to find a solution for this.

Update:
It turns out that we don't ever need @loader_path for app target. It ends up the same path as @executable_path. Test target needs it though.
https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath

@toshi0383
Copy link
Owner Author

CocoaPods says it's okay to #include and overwrite CocoaPods' xcconfig.
So... I can say that this is a problem of Xcode rather than xcconfig-extractor. There should be a way to inherit a variable from #includeing xcconfig.

@toshi0383 toshi0383 force-pushed the include-existing-option branch from f260181 to b75bce9 Compare April 30, 2017 15:13
@toshi0383 toshi0383 force-pushed the include-existing-option branch from b75bce9 to 2bf4cd2 Compare April 30, 2017 15:15
self.sourceTree = o["sourceTree"] as! String
guard isa == .PBXFileReference else {
return nil
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

clean up

return nil
}
}
public init?(from id: Any?, objects: [String: Any]) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

should be implemented as a protocol extention?

@toshi0383
Copy link
Owner Author

@toshi0383 toshi0383 merged commit ccb3d1d into master May 1, 2017
@toshi0383 toshi0383 deleted the include-existing-option branch May 1, 2017 02:14
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.

1 participant