Hi all,
TL;DR: How to get all the virtual includes used by cc_binary/cc_library rules?
I'm trying to conveniently use Bazel for competitive programming purposes.
One can say that it's overthinking, but I'm mostly curious of boundaries Bazel allows me to explore rather than having substantial request.
Here's some background: usually competitive programming contests take some input in given format from stdin and print output in stdout. Judge systems usually accepts several languages, however the primary one is bare cpp. For the local development it's handy to automate some testing as well as use prewritten code (rules vary between the systems, but the majority accepts prewritten code).
I already implemented rule that takes Bazel executable target and tests it against all pairs of tests (represented with pair of text files) with default checker and interactor. That comes in handy to test sources I just created.
When it comes to combining all code I used, usually it's either jump-to-definition + copy/paste library, however it can be exhausting to do if library is huge. I already have a tool that combines all the library headers into a single file, however I still need to pass all path members to search at. It works like following:
./expander -I path/to/lib1 -I path/to/lib2 source.cpp -o expanded.cpp
Can I get those -Is from Bazel? More specifically, can I took all cc_binary/cc_library header paths to pass them into my script that expanding those files?
Best,
Denys.