-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathgenerate-protobuf-files.sh
executable file
·40 lines (33 loc) · 1.94 KB
/
generate-protobuf-files.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
39
40
#!/bin/bash
# Updates swift protobuf files
set -e
echo "Updating protobuf files"
cd swift-homomorphic-encryption-protobuf
echo "Removing HomomorphicEncryptionProtobuf swift protobuf files"
rm ../Sources/HomomorphicEncryptionProtobuf/generated/*.pb.swift
echo "Regenerating HomomorphicEncryptionProtobuf swift protobuf files"
find apple/swift_homomorphic_encryption/v1/ -name "*.proto" -exec protoc --swift_opt=Visibility=Public --swift_opt=FileNaming=PathToUnderscores --swift_out ../Sources/HomomorphicEncryptionProtobuf/generated {} \;
echo "Removing PrivateInformationRetrievalProtobuf swift protobuf files"
rm ../Sources/PrivateInformationRetrievalProtobuf/generated/*.pb.swift
echo "Regenerating PrivateInformationRetrievalProtobuf swift protobuf files"
find apple/swift_homomorphic_encryption/pir/ \
apple/swift_homomorphic_encryption/api/shared/v1/ \
apple/swift_homomorphic_encryption/api/pir/v1/ \
-name "*.proto" -exec protoc \
--swift_opt=ProtoPathModuleMappings=../Sources/PrivateInformationRetrievalProtobuf/protobuf_module_mappings.txtpb \
--swift_opt=Visibility=Public \
--swift_opt=FileNaming=PathToUnderscores \
--swift_out ../Sources/PrivateInformationRetrievalProtobuf/generated {} \;
echo "Removing PrivateNearestNeighborSearchProtobuf swift protobuf files"
rm ../Sources/PrivateNearestNeighborSearchProtobuf/generated/*.pb.swift
echo "Regenerating PrivateNearestNeighborSearchProtobuf swift protobuf files"
find apple/swift_homomorphic_encryption/pnns/ \
apple/swift_homomorphic_encryption/api/shared/v1/ \
apple/swift_homomorphic_encryption/api/pnns/v1/ \
-name "*.proto" -exec protoc \
--swift_opt=ProtoPathModuleMappings=../Sources/PrivateNearestNeighborSearchProtobuf/protobuf_module_mappings.txtpb \
--swift_opt=Visibility=Public \
--swift_opt=FileNaming=PathToUnderscores \
--swift_out ../Sources/PrivateNearestNeighborSearchProtobuf/generated {} \;
cd -
echo "Done updating protobuf files"