Import foxglove schemas repo
This has to do a couple of things:
* Actually import the repo as an http_archive.
* Modify the cc_static_flatbuffer rule to allow it to handle a
flatbuffer target with multiple fbs files.
* Move foxglove-related third_party files into one directory.
Change-Id: I0123fc8037b107019f9c29b781418c9a03639eca
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/aos/flatbuffers_static.py b/aos/flatbuffers_static.py
index 199c5b9..3bd28fe 100644
--- a/aos/flatbuffers_static.py
+++ b/aos/flatbuffers_static.py
@@ -8,12 +8,26 @@
def main(argv):
- if len(argv) != 4:
+ if len(argv) != 5:
+ print(
+ f"Incorrect number of arguments {len(argv)} to flatbuffers_static."
+ )
+ print(argv)
return 1
input_path = sys.argv[1]
output_path = sys.argv[2]
function = sys.argv[3].split("::")
+ bfbs_name = sys.argv[4]
+ if bfbs_name != '-':
+ inputs = input_path.split(' ')
+ valid_paths = [path for path in inputs if path.endswith(bfbs_name)]
+ if len(valid_paths) != 1:
+ print(
+ f"Expected exactly one match for {bfbs_name}; got {valid_paths}."
+ )
+ return 1
+ input_path = valid_paths[0]
include_guard = output_path.replace('/', '_').replace('-', '_').replace(
'.', '_').upper() + '_'