How can I use BUCK build with a pod that has several files with the same name?
(I asked on SO but I'm not sure which one is the preferred channel)
I'm trying to use BUCK with the Realm pod that has several files with the same name. My buck build is failing with
In target '//Pods:Realm', 'Realm/history.hpp' maps to the following header files:
- /BuckSample/Pods/Realm/include/core/realm/sync/history.hpp
- /BuckSample/Pods/Realm/include/core/realm/history.hpp
Please rename one of them or export one of them to a different path.
In the module, those files are imported as
#include <realm/history.hpp>
#include <realm/sync/history.hpp>
but it seems that BUCK is trying to map both of them to Realm/history.hpp How can I tell BUCK to only map to the full path and not just the filename as well?
There are a few ways to change the way headers are mapped in Buck.
On Apple rules, there is the header_prefix_path argument
On cxx rules, there is the header_namespace argument
And on both, the headers parameter allows specifying a dictionary, where the value is the path to the header and the key is the path you want it accessible by. So you could have a dictionary like
headers = {
"history.hpp": "history.hpp",
"synchistory.hpp": "sync/history.hpp",
}
(I'm not suggesting those are the names you should use, just illustrating how it works)
So it turns out Realm is really not a straightforwards pod, including submodules and some scripts to be run when generating the project. I think I've been able to deal with the header mappings, but that's not enough to get things to work. If you want to have a look I've set up a debug project trying:
- building from the code downloaded with cocoapods (commit)
- using the framework downloaded directly (commit)
Are you planning for a direct support of Pod / Carthage so that modules imports is much simpler?
@gsabran Do you want to add your working versions here to the this sample Buck project? https://github.com/airbnb/BuckSample/blob/master/Pods/BUCK