Make package naming meet Go requirements and

This commit is contained in:
MYLS 2018-09-26 13:20:22 +08:00
parent 3c7ebec0dd
commit d6d61cf4d1
5 changed files with 19 additions and 7 deletions

6
.gitignore vendored
View File

@ -73,3 +73,9 @@ $RECYCLE.BIN/
# End of https://www.gitignore.io/api/windows,osx,linux,jebtrain
# For this project
/gen/
# End this project

View File

@ -4,7 +4,7 @@ package bdchain.api;
import "bdchain/api/common.proto";
option go_package = "bdchain/api/ac_chain";
option go_package = "bdchain/api/grpc/acchain";
option java_package = "bdchain.api.grpc";
option java_outer_classname = "AccountingChainProto";
option java_multiple_files = true;

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package bdchain.api;
option go_package = "bdchain/api/common";
option go_package = "bdchain/api/grpc/common";
option java_package = "bdchain.api.grpc";
option java_outer_classname = "CommonProto";
option java_multiple_files = true;

View File

@ -5,7 +5,7 @@ package bdchain.api;
import "google/protobuf/empty.proto";
import "bdchain/api/common.proto";
option go_package = "bdchain/api/tx_ledger";
option go_package = "bdchain/api/grpc/txledger";
option java_package = "bdchain.api.grpc";
option java_outer_classname = "TransactionLedgerProto";
option java_multiple_files = true;

14
gen.bat
View File

@ -1,4 +1,10 @@
mkdir gen\go
protoc -I . --go_out=plugins=grpc:gen/go bdchain/api/common.proto
protoc -I . --go_out=plugins=grpc:gen/go bdchain/api/tx_ledger.proto
protoc -I . --go_out=plugins=grpc:gen/go bdchain/api/ac_chain.proto
@echo off
set dir=.\gen\go
if not exist %dir% mkdir %dir%
protoc -I . --go_out=plugins=grpc:%dir% bdchain/api/common.proto
protoc -I . --go_out=plugins=grpc:%dir% bdchain/api/tx_ledger.proto
protoc -I . --go_out=plugins=grpc:%dir% bdchain/api/ac_chain.proto
echo All Done!
pause.