forked from getgauge/gauge-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genproto.sh
executable file
·26 lines (20 loc) · 1.06 KB
/
genproto.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
#!/bin/sh
# *----------------------------------------------------------------
# * Copyright (c) ThoughtWorks, Inc.
# * Licensed under the Apache License, Version 2.0
# * See LICENSE.txt in the project root for license information.
# *----------------------------------------------------------------*/
#Using protoc version 2.6.1
for filename in gauge-proto/*.proto; do
newName="$filename-bkp"
sed 's/option java_package = "com.thoughtworks.gauge";/option java_package = "gauge.messages";/' "$filename" > "$newName"
rm "$filename"
cp "$newName" "$filename"
rm "$newName"
done
mvn protobuf:compile-custom protobuf:compile
cp target/generated-sources/protobuf/java/gauge/messages/Messages.java src/main/java/gauge/messages
cp target/generated-sources/protobuf/java/gauge/messages/Spec.java src/main/java/gauge/messages
cp target/generated-sources/protobuf/java/gauge/messages/Services.java src/main/java/gauge/messages
cp target/generated-sources/protobuf/grpc-java/gauge/messages/RunnerGrpc.java src/main/java/gauge/messages
cd gauge-proto && git checkout . && cd ..