Path: blob/main/components/supervisor-api/generate-java.sh
2492 views
#!/bin/bash1# Copyright (c) 2022 Gitpod GmbH. All rights reserved.2# Licensed under the GNU Affero General Public License (AGPL).3# See License.AGPL.txt in the project root for license information.45# replace Java reserved keywords6sed -i 's/private = 0;/private_visibility = 0;/g' status.proto7sed -i 's/public = 1;/public_visibility = 1;/g' status.proto89PROTOC_GEN_GRPC_JAVA_PATH=/tmp/protoc-gen-grpc-java1011if [ ! -f $PROTOC_GEN_GRPC_JAVA_PATH ]; then12curl -sSo $PROTOC_GEN_GRPC_JAVA_PATH https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/1.49.0/protoc-gen-grpc-java-1.49.0-linux-x86_64.exe13chmod +x $PROTOC_GEN_GRPC_JAVA_PATH14fi1516OUT_DIR=java/src/main/java/1718mkdir -p $OUT_DIR1920protoc \21-I. -Ithird_party \22--plugin=protoc-gen-grpc-java=$PROTOC_GEN_GRPC_JAVA_PATH \23--grpc-java_out=$OUT_DIR \24--java_out=$OUT_DIR \25./*.proto2627# revert Java reserved keywords28sed -i 's/private_visibility = 0;/private = 0;/g' status.proto29sed -i 's/public_visibility = 1;/public = 1;/g' status.proto303132