summaryrefslogtreecommitdiff
path: root/scripts/generate_code.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/generate_code.py')
-rwxr-xr-xscripts/generate_code.py43
1 files changed, 19 insertions, 24 deletions
diff --git a/scripts/generate_code.py b/scripts/generate_code.py
index 1a622ab8..4ee15719 100755
--- a/scripts/generate_code.py
+++ b/scripts/generate_code.py
@@ -24,6 +24,7 @@ from util import flatc, root_path, tests_path, args, flatc_path
# Specify the other paths that will be referenced
swift_code_gen = Path(root_path, "tests/swift/tests/CodeGenerationTests")
+ts_code_gen = Path(root_path, "tests/ts")
samples_path = Path(root_path, "samples")
reflection_path = Path(root_path, "reflection")
@@ -142,10 +143,10 @@ flatc(
flatc(
NO_INCL_OPTS
+ TS_OPTS,
- schema="monster_test.fbs",
- prefix="ts",
- include="include_test",
- data="monsterdata_test.json",
+ cwd=ts_code_gen,
+ schema="../monster_test.fbs",
+ include="../include_test",
+ data="../monsterdata_test.json",
)
flatc(
@@ -210,37 +211,31 @@ flatc(
flatc(
BASE_OPTS + TS_OPTS,
- prefix="ts/union_vector",
- schema="union_vector/union_vector.fbs",
+ cwd=ts_code_gen,
+ prefix="union_vector",
+ schema="../union_vector/union_vector.fbs",
)
flatc(
BASE_OPTS + TS_OPTS + ["--gen-name-strings", "--gen-mutable"],
- include="include_test",
- prefix="ts",
- schema="monster_test.fbs",
-)
-
-# Generate the complete flat file TS of monster.
-flatc(
- ["--ts", "--gen-all", "--ts-flat-files"],
- include="include_test",
- schema="monster_test.fbs",
- prefix="ts/ts-flat-files"
+ cwd=ts_code_gen,
+ include="../include_test",
+ schema="../monster_test.fbs",
)
flatc(
BASE_OPTS + TS_OPTS + ["-b"],
- include="include_test",
- prefix="ts",
- schema="monster_test.fbs",
- data="unicode_test.json",
+ cwd=ts_code_gen,
+ include="../include_test",
+ schema="../monster_test.fbs",
+ data="../unicode_test.json",
)
flatc(
BASE_OPTS + TS_OPTS + ["--gen-name-strings"],
- prefix="ts/union_vector",
- schema="union_vector/union_vector.fbs",
+ cwd=ts_code_gen,
+ prefix="union_vector",
+ schema="../union_vector/union_vector.fbs",
)
flatc(
@@ -340,7 +335,7 @@ flatc(
# Optional Scalars
optional_scalars_schema = "optional_scalars.fbs"
flatc(["--java", "--kotlin", "--lobster"], schema=optional_scalars_schema)
-flatc(TS_OPTS, schema=optional_scalars_schema, prefix="ts")
+flatc(TS_OPTS, cwd=ts_code_gen, schema="../optional_scalars.fbs")
flatc(["--csharp", "--python", "--gen-object-api"], schema=optional_scalars_schema)