-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathgenerate-flatbuffer.sh
More file actions
executable file
·24 lines (20 loc) · 900 Bytes
/
generate-flatbuffer.sh
File metadata and controls
executable file
·24 lines (20 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
set -e
VERSION="22.10.26"
if [[ -f "./flatc" ]]; then
PATH="./:$PATH"
fi
if [[ "$(flatc --version)" != "flatc version $VERSION" ]]; then
echo "Flatc must be $VERSION"
exit 1
fi
rm -rf protocol/java/src
rm -rf protocol/cpp/include/solarxr_protocol/generated
rm -rf protocol/typescript/src
rm -rf protocol/rust/src/generated
rm -rf protocol/kotlin/src
flatc --java --gen-object-api --gen-all -o ./protocol/java/src -I ./schema/ ./schema/all.fbs && \
flatc --cpp --scoped-enums --gen-all -o ./protocol/cpp/include/solarxr_protocol/generated -I ./schema/ ./schema/all.fbs && \
flatc --ts --gen-object-api --gen-all -o ./protocol/typescript/src -I ./schema/ ./schema/all.fbs && \
flatc --rust --rust-module-root-file --gen-all -o ./protocol/rust/src/generated ./schema/all.fbs && \
flatc --kotlin --gen-jvmstatic --gen-all -o ./protocol/kotlin/src -I ./schema/ ./schema/all.fbs