-
Notifications
You must be signed in to change notification settings - Fork 3
/
updateProtos
executable file
·39 lines (28 loc) · 1.07 KB
/
updateProtos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
echo "Generating protocol buffer files..."
mkdir -p ProtocolBuffers/ && cd ProtocolBuffers/
mkdir -p GeneratedSources/TextToSpeech/
# 1 - Fetch GRPC Swift & Generate GRPC Plugin
# The plugin must be ready at .build/release/protoc-gen-grpc-swift
git clone https://github.com/grpc/grpc-swift.git
cd grpc-swift
git fetch --all --tags
git checkout 1.0.0
make plugins
# 2 - Fetch Google Apis for Protocol Buffers files
cd ..
git clone https://github.com/googleapis/googleapis.git
cd googleapis
pwd
# TODO: Install if does not exists
# brew install protobuf
protoc google/cloud/texttospeech/v1beta1/*.proto \
--plugin=../grpc-swift/protoc-gen-swift \
--swift_opt=Visibility=Public \
--swift_out=../GeneratedSources/TextToSpeech/
protoc google/cloud/texttospeech/v1beta1/*.proto \
--plugin=../grpc-swift/protoc-gen-grpc-swift \
--grpc-swift_opt=Visibility=Public \
--grpc-swift_out=../GeneratedSources/TextToSpeech/
cp ../GeneratedSources/TextToSpeech/google/cloud/texttospeech/v1beta1/* ../../Sources/SwiftGoogleCloudTTS/ProtoModels/
printf "\e[32mDone!\e[m\n"