-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswift.yml
35 lines (32 loc) · 1.14 KB
/
swift.yml
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
services:
protoc-swift:
image: ghcr.io/akasandra/protoc-swift:1.3
build:
context: .
dockerfile: swift.Dockerfile
restart: no
logging:
driver: "json-file"
options:
max-size: "1k"
max-file: "3"
entrypoint:
- /bin/sh
- -c
- |
if [ ! -f /source/$${PROTOC_PATH}/*.proto ]; then echo "Nothing .proto in source/$${PROTOC_PATH}"; exit 2; fi
echo "List of Protobuf files to compile:"
find "/source/$${PROTOC_PATH}" -type f
mkdir -p "/source/$${PROTOC_PATH_SWIFT}"
echo "Delete old generated files"
find "/source/$${PROTOC_PATH_SWIFT}" -name '*pb.swift' -o -name '*grpc.swift' | xargs rm -f
echo "Generate files at: source/$${PROTOC_PATH_SWIFT}"
protoc \
--proto_path="/source/$${PROTOC_PATH}" \
--swift_out="/source/$${PROTOC_PATH_SWIFT}" \
--experimental_allow_proto3_optional \
--grpc-swift_out="/source/$${PROTOC_PATH_SWIFT}" \
--swift_opt=Visibility=Public \
--grpc-swift_opt=Visibility=Public \
\
`echo $(find "/source/$${PROTOC_PATH}" -type f)`