1
This commit is contained in:
parent
b44f1b9c11
commit
1ef1686057
@ -40,16 +40,19 @@ def need_rebuild(pb_files):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def rebuild(cpp_out, python_out, pb_files):
|
def rebuild(cpp_out, python_out, java_out, pb_files):
|
||||||
def genParams():
|
def genParams():
|
||||||
cpp_param = ''
|
cpp_param = ''
|
||||||
py_param = ''
|
py_param = ''
|
||||||
|
java_param = ''
|
||||||
for pb_file in pb_files:
|
for pb_file in pb_files:
|
||||||
if cpp_out != '':
|
if cpp_out != '':
|
||||||
cpp_param += 'protoc --proto_path=../tools/protobuild --cpp_out=%s ../tools/protobuild/%s.proto && ' % (cpp_out, pb_file)
|
cpp_param += 'protoc --proto_path=../tools/protobuild --cpp_out=%s ../tools/protobuild/%s.proto && ' % (cpp_out, pb_file)
|
||||||
if python_out != '':
|
if python_out != '':
|
||||||
py_param += '../../third_party/tools/bin/protoc --proto_path=../tools/protobuild --python_out=%s ../tools/protobuild/%s.proto && ' % (python_out, pb_file)
|
py_param += '../../third_party/tools/bin/protoc --proto_path=../tools/protobuild --python_out=%s ../tools/protobuild/%s.proto && ' % (python_out, pb_file)
|
||||||
return cpp_param + py_param + ' echo ""'
|
if java_out != '':
|
||||||
|
py_param += '../../third_party/tools/bin/protoc --proto_path=../tools/protobuild --java_out=%s ../tools/protobuild/%s.proto && ' % (java_out, pb_file)
|
||||||
|
return cpp_param + py_param + java_param + ' echo ""'
|
||||||
global g_is_terminated
|
global g_is_terminated
|
||||||
try:
|
try:
|
||||||
# print(genParams())
|
# print(genParams())
|
||||||
@ -95,6 +98,13 @@ parser.add_option(
|
|||||||
default = '',
|
default = '',
|
||||||
help = "",
|
help = "",
|
||||||
)
|
)
|
||||||
|
parser.add_option(
|
||||||
|
"",
|
||||||
|
"--java_out",
|
||||||
|
dest = "java_out",
|
||||||
|
default = '',
|
||||||
|
help = "",
|
||||||
|
)
|
||||||
parser.add_option(
|
parser.add_option(
|
||||||
"",
|
"",
|
||||||
"--pb_files",
|
"--pb_files",
|
||||||
@ -106,6 +116,6 @@ if not options.nohooks:
|
|||||||
repair_githooks()
|
repair_githooks()
|
||||||
|
|
||||||
if need_rebuild(options.pb_files.split(',')):
|
if need_rebuild(options.pb_files.split(',')):
|
||||||
rebuild(options.cpp_out, options.python_out, options.pb_files.split(','))
|
rebuild(options.cpp_out, options.python_out, options.java_out, options.pb_files.split(','))
|
||||||
else:
|
else:
|
||||||
print('pb files already is the latest')
|
print('pb files already is the latest')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user