@@ -8,17 +8,10 @@ import (
8
8
"runtime"
9
9
"strings"
10
10
11
+ "v2ray.com/core"
11
12
"v2ray.com/core/common"
12
13
)
13
14
14
- var protoFilesUsingProtocGenGoFast = map [string ]bool {"proxy/vless/encoding/addons.proto" : true }
15
-
16
- var protocMap = map [string ]string {
17
- "windows" : filepath .Join (".dev" , "protoc" , "windows" , "protoc.exe" ),
18
- "darwin" : filepath .Join (".dev" , "protoc" , "macos" , "protoc" ),
19
- "linux" : filepath .Join (".dev" , "protoc" , "linux" , "protoc" ),
20
- }
21
-
22
15
func main () {
23
16
pwd , wdErr := os .Getwd ()
24
17
if wdErr != nil {
@@ -27,7 +20,7 @@ func main() {
27
20
}
28
21
29
22
GOBIN := common .GetGOBIN ()
30
- protoc := protocMap [runtime .GOOS ]
23
+ protoc := core . ProtocMap [runtime .GOOS ]
31
24
32
25
protoFilesMap := make (map [string ][]string )
33
26
walkErr := filepath .Walk ("./" , func (path string , info os.FileInfo , err error ) error {
@@ -56,7 +49,7 @@ func main() {
56
49
for _ , files := range protoFilesMap {
57
50
for _ , relProtoFile := range files {
58
51
var args []string
59
- if protoFilesUsingProtocGenGoFast [relProtoFile ] {
52
+ if core . ProtoFilesUsingProtocGenGoFast [relProtoFile ] {
60
53
args = []string {"--gofast_out" , pwd , "--plugin" , "protoc-gen-gofast=" + GOBIN + "/protoc-gen-gofast" }
61
54
} else {
62
55
args = []string {"--go_out" , pwd , "--go-grpc_out" , pwd , "--plugin" , "protoc-gen-go=" + GOBIN + "/protoc-gen-go" , "--plugin" , "protoc-gen-go-grpc=" + GOBIN + "/protoc-gen-go-grpc" }
0 commit comments