2021-11-29 21:11:27 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# simple sanity checking for repo
|
|
|
|
|
if [ ! -d "../Meshtastic-protobufs" ]; then
|
|
|
|
|
echo "Please check out the https://github.com/meshtastic/Meshtastic-protobufs the parent directory."
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# simple sanity checking for executable
|
|
|
|
|
if [ ! -x "`which protoc`" ]; then
|
2022-05-29 20:43:24 -05:00
|
|
|
echo "Please install swift-protobuf by running: brew install swift-protobuf"
|
2021-11-29 21:11:27 -08:00
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
pdir=$(realpath "../Meshtastic-protobufs")
|
2022-06-24 08:00:18 -07:00
|
|
|
sdir=$(realpath "./Meshtastic/Protobufs")
|
2022-03-21 08:24:52 -07:00
|
|
|
echo "pdir:$pdir sdir:$sdir"
|
2022-08-11 23:34:09 -07:00
|
|
|
pfiles="admin.proto apponly.proto cannedmessages.proto channel.proto config.proto device_metadata.proto deviceonly.proto localonly.proto mesh.proto module_config.proto mqtt.proto portnums.proto remote_hardware.proto
|
2022-06-11 09:50:25 -07:00
|
|
|
storeforward.proto telemetry.proto"
|
2021-11-29 21:11:27 -08:00
|
|
|
for pf in $pfiles
|
|
|
|
|
do
|
|
|
|
|
echo "Generating $pf..."
|
|
|
|
|
protoc --swift_out=${sdir} --proto_path=${pdir} $pf
|
|
|
|
|
done
|
|
|
|
|
echo "Done generating the swift files from the proto files."
|
|
|
|
|
echo "Build, test, and commit changes."
|