Reputation: 86
I've written a toy libtooling based tool that does some analysis/source rewriting over ObjectiveC code. How do I run it over an iOS Xcode project?
I've looked at compiling the application through commandline/clang, but I haven't got it to work yet. Is it possible to chain my tool with xcodebuild? Or is there a better way to run the tool over an Xcode project?
Upvotes: 1
Views: 498
Reputation: 11
I think what you need is JSON-Compilation-Database.
You can use xctool to generate a json compilation databse (xctool has a reporter that generate this thing, see the readme.)
The json compilation database is just a json file which contains all the compiler options (say, the header search path, the frame work search path) that need to pass to the clang and libtooling based tools.
Upvotes: 1
Reputation: 3458
If you want your tool to generate errors and warnings in code it should be a clang plugin and you can just change your project clang flags to load the plugin.
In your case it seems like you are using libtooling that alters the source code, you can simply add your script to your project build process prior to the "Compile Sources" stage.
Upvotes: 0