generate java sdk

pull/330/merge
Darien Raymond 2017-01-26 23:41:39 +01:00
parent b2683a8bf0
commit 216fb544cd
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 3 deletions

View File

@ -19,8 +19,8 @@ var protocMap = map[string]string{
"linux": filepath.Join(os.Getenv("GOPATH"), "src", "v2ray.com", "core", ".dev", "protoc", "linux", "protoc"), "linux": filepath.Join(os.Getenv("GOPATH"), "src", "v2ray.com", "core", ".dev", "protoc", "linux", "protoc"),
} }
func sdkPath(reporoot, lang string) string { func sdkPath(lang string) string {
path := filepath.Join(reporoot, ".dev", "sdk", lang) path := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "v2ray", "sdk-"+lang, "proto")
os.MkdirAll(path, os.ModePerm) os.MkdirAll(path, os.ModePerm)
return path return path
} }
@ -51,7 +51,7 @@ func main() {
}) })
for _, files := range protofiles { for _, files := range protofiles {
args := []string{"--proto_path", gosrc, "--go_out", gosrc} args := []string{"--proto_path", gosrc, "--go_out", gosrc, "--java_out", sdkPath("java")}
args = append(args, files...) args = append(args, files...)
cmd := exec.Command(protoc, args...) cmd := exec.Command(protoc, args...)
cmd.Env = append(cmd.Env, os.Environ()...) cmd.Env = append(cmd.Env, os.Environ()...)