[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
import os
import sys
ret = 0
genbindings_dirs = ['tolua']
for item in genbindings_dirs:
os.chdir("tools/" + item)
os.system('python genbindings.py')
ret = os.system('python genbindings.py')
os.chdir("../..")
if(ret != 0):
ret = 1
break
sys.exit(ret)

View File

@ -103,16 +103,18 @@ def main():
# Generate binding glue codes
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'):
os.chdir('tools/tojs')
if(platform.system() == 'Windows'):
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']
else:
os.system("./genbindings.sh")
ret = os.system("./genbindings.sh")
os.chdir('../..')
if(ret != 0):
return(1)
#make temp dir
print "current dir is: " + os.environ['WORKSPACE']