mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-25 13:18:40 +00:00
Add Annotations for Monster schema and example buffer
This commit is contained in:
@@ -97,6 +97,12 @@ def flatc_reflection(options, location, target):
|
|||||||
shutil.move(str(new_reflection_path), str(original_reflection_path))
|
shutil.move(str(new_reflection_path), str(original_reflection_path))
|
||||||
shutil.rmtree(str(Path(reflection_path, temp_dir)))
|
shutil.rmtree(str(Path(reflection_path, temp_dir)))
|
||||||
|
|
||||||
|
def flatc_annotate(schema, file, include=None, cwd=tests_path):
|
||||||
|
cmd = [str(flatc_path)]
|
||||||
|
if include:
|
||||||
|
cmd += ["-I"] + [include]
|
||||||
|
cmd += ["--annotate", schema, file]
|
||||||
|
result = subprocess.run(cmd, cwd=str(cwd), check=True)
|
||||||
|
|
||||||
# Glob a pattern relative to file path
|
# Glob a pattern relative to file path
|
||||||
def glob(path, pattern):
|
def glob(path, pattern):
|
||||||
@@ -272,6 +278,19 @@ flatc(
|
|||||||
schema="monster_test.fbs",
|
schema="monster_test.fbs",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Generate the annotated binary of the monster_test binary schema.
|
||||||
|
flatc_annotate(
|
||||||
|
schema="../reflection/reflection.fbs",
|
||||||
|
file="monster_test.bfbs",
|
||||||
|
include="include_test"
|
||||||
|
)
|
||||||
|
|
||||||
|
flatc_annotate(
|
||||||
|
schema="monster_test.fbs",
|
||||||
|
file="monsterdata_test.mon",
|
||||||
|
include="include_test"
|
||||||
|
)
|
||||||
|
|
||||||
flatc(
|
flatc(
|
||||||
CPP_OPTS
|
CPP_OPTS
|
||||||
+ NO_INCL_OPTS
|
+ NO_INCL_OPTS
|
||||||
|
|||||||
6647
tests/monster_test.afb
Normal file
6647
tests/monster_test.afb
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user