[Jenkins] Make build as failed when generating bindings fails

This commit is contained in:
lm 2014-03-27 14:28:40 +08:00
parent 18ce311011
commit edd14e6765
2 changed files with 13 additions and 4 deletions

View File

@ -1,9 +1,16 @@
#!/usr/bin/python #!/usr/bin/python
import os import os
import sys
ret = 0
genbindings_dirs = ['tolua'] genbindings_dirs = ['tolua']
for item in genbindings_dirs: for item in genbindings_dirs:
os.chdir("tools/" + item) os.chdir("tools/" + item)
os.system('python genbindings.py') ret = os.system('python genbindings.py')
os.chdir("../..") os.chdir("../..")
if(ret != 0):
ret = 1
break
sys.exit(ret)

View File

@ -103,16 +103,18 @@ def main():
# Generate binding glue codes # Generate binding glue codes
if(branch == 'develop'): if(branch == 'develop'):
os.system("python tools/jenkins-scripts/gen_jsb.py") ret = os.system("python tools/jenkins-scripts/gen_jsb.py")
elif(branch == 'master'): elif(branch == 'master'):
os.chdir('tools/tojs') os.chdir('tools/tojs')
if(platform.system() == 'Windows'): if(platform.system() == 'Windows'):
os.environ['NDK_ROOT'] = os.environ['NDK_ROOT_R8E'] os.environ['NDK_ROOT'] = os.environ['NDK_ROOT_R8E']
os.system("genbindings-win32.bat") ret = os.system("genbindings-win32.bat")
os.environ['NDK_ROOT'] = os.environ['NDK_ROOT_R9B'] os.environ['NDK_ROOT'] = os.environ['NDK_ROOT_R9B']
else: else:
os.system("./genbindings.sh") ret = os.system("./genbindings.sh")
os.chdir('../..') os.chdir('../..')
if(ret != 0):
return(1)
#make temp dir #make temp dir
print "current dir is: " + os.environ['WORKSPACE'] print "current dir is: " + os.environ['WORKSPACE']