-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate.sh
38 lines (30 loc) · 1.21 KB
/
generate.sh
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
#!/bin/bash
set -ex
if [ -d swift-protobuf ]
then
pushd swift-protobuf
git reset --hard 1.20.3
popd
else
git -c advice.detachedHead=false clone --depth 1 --branch 1.20.3 https://github.com/apple/swift-protobuf.git
fi
pushd swift-protobuf
swift build -c release
popd
if [ -d grpc-swift ]
then
pushd grpc-swift
git reset --hard 1.13.1
popd
else
git -c advice.detachedHead=false clone --depth 1 --branch 1.13.1 https://github.com/grpc/grpc-swift.git
fi
pushd grpc-swift
swift build -c release
popd
mkdir -p Sources/MicroSwitch/Model/generated &&
protoc main.proto --swift_out=./Sources/MicroSwitch/Model/generated --grpc-swift_opt=Client=false,Server=true --grpc-swift_out=./Sources/MicroSwitch/Model/generated --plugin=./swift-protobuf/.build/release/protoc-gen-swift --plugin=./grpc-swift/.build/release/protoc-gen-grpc-swift &&
echo "MicroSwitch done"
mkdir -p Sources/MicroClient/Model/generated &&
protoc main.proto --swift_out=./Sources/MicroClient/Model/generated --grpc-swift_opt=Client=true,Server=false --grpc-swift_out=./Sources/MicroClient/Model/generated --plugin=./swift-protobuf/.build/release/protoc-gen-swift --plugin=./grpc-swift/.build/release/protoc-gen-grpc-swift &&
echo "MicroClient done"