-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswift.yml
More file actions
35 lines (32 loc) · 1.22 KB
/
swift.yml
File metadata and controls
35 lines (32 loc) · 1.22 KB
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:5.9.2
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/$${PROTO_SOURCES_DIR}/*.proto ]; then echo "Nothing .proto in source/$${PROTO_SOURCES_DIR}"; exit 2; fi
echo "List of Protobuf files to compile:"
find "/source/$${PROTO_SOURCES_DIR}" -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 --plugin=protoc-gen-swift=$(which protoc-gen-swift) \
--proto_path="/source/$${PROTO_SOURCES_DIR}" \
--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/$${PROTO_SOURCES_DIR}" -type f)`