I have 100+ files with .idl
extension and I would like to use these to generate C and C++ headers. The IDL files are considered sources and the auto-generated headers are not checked in to the repo.
Is there a way in Bazel to glob
all files with .idl
extension in a directory and generate corresponding headers?
The unrolled shell commands would look something like:
custom_tool ABC.idl -o out/ABC.h
custom_tool DEF.idl -o out/DEF.h
custom_tool ABC.idl -o out/ABC.hpp --cpp
custom_tool DEF.idl -o out/DEF.hpp --cpp
custom_tool ABC.idl -o out/ABC_skel.h --skel
custom_tool DEF.idl -o out/DEF_skel.h --skel
custom_tool ABC.idl -o out/ABC_skel.hpp --cpp --skel
custom_tool DEF.idl -o out/DEF_skel.hpp --cpp --skel
...
I was hoping to use genrule
in an Android.bp
file but I would be OK with a separate .bzl
file to help with the custom commands.
I’m stuck on creating the outs
list/filegroup which resembles the glob
ed srcs
filegroup of IDLs.
nhaas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.