From edd14e676539106c212e676556c730e2e0984841 Mon Sep 17 00:00:00 2001 From: lm Date: Thu, 27 Mar 2014 14:28:40 +0800 Subject: [PATCH] [Jenkins] Make build as failed when generating bindings fails --- tools/jenkins-scripts/gen_jsb.py | 9 ++++++++- tools/jenkins-scripts/pull-request-builder.py | 8 +++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/jenkins-scripts/gen_jsb.py b/tools/jenkins-scripts/gen_jsb.py index 0d18dbacf3..1403b49400 100644 --- a/tools/jenkins-scripts/gen_jsb.py +++ b/tools/jenkins-scripts/gen_jsb.py @@ -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) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index c9d753bffe..8b6b8909f6 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -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']