go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/milo/ui/scripts/gen_proto.sh (about) 1 # Copyright 2023 The LUCI Authors. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 cd "$(dirname "$0")" 16 17 rm -rf ../src/proto 18 mkdir ../src/proto 19 cd ../../../../../ 20 21 # Use ts-proto instead of the official grpc-web because it is RPC framework 22 # agnostic. This is curcial because we use a non-standard protocol (pRPC) for 23 # client-server communication. 24 protoc \ 25 --plugin=./go.chromium.org/luci/milo/ui/node_modules/.bin/protoc-gen-ts_proto \ 26 -I=./go.chromium.org/luci/common/proto/googleapis \ 27 -I=./ \ 28 --ts_proto_out=./go.chromium.org/luci/milo/ui/src/proto \ 29 \ 30 `# Add '.pb' so it can be ignored by presubmit upload checks.` \ 31 --ts_proto_opt=fileSuffix=.pb \ 32 \ 33 --ts_proto_opt=forceLong=string,esModuleInterop=true \ 34 --ts_proto_opt=removeEnumPrefix=true,unrecognizedEnum=false \ 35 --ts_proto_opt=useDate=string,useReadonlyTypes=true \ 36 \ 37 ./go.chromium.org/luci/analysis/proto/v1/changepoints.proto \ 38 ./go.chromium.org/luci/analysis/proto/v1/clusters.proto \ 39 ./go.chromium.org/luci/analysis/proto/v1/test_history.proto \ 40 ./go.chromium.org/luci/analysis/proto/v1/test_variant_branches.proto \ 41 ./go.chromium.org/luci/bisection/proto/v1/analyses.proto \ 42 ./go.chromium.org/luci/buildbucket/proto/builder_service.proto \ 43 ./go.chromium.org/luci/buildbucket/proto/builds_service.proto \ 44 ./go.chromium.org/luci/luci_notify/api/service/v1/alerts.proto \ 45 ./go.chromium.org/luci/milo/proto/v1/rpc.proto \ 46 ./go.chromium.org/luci/resultdb/proto/v1/resultdb.proto \ 47 ./go.chromium.org/luci/swarming/proto/api_v2/swarming.proto \ 48 ./go.chromium.org/luci/tree_status/proto/v1/tree_status.proto \ 49 ./infra/appengine/sheriff-o-matic/proto/v1/alerts.proto \