From 9e538fce481ca68d0ab7960ccd75989831dcd833 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 14 Oct 2014 17:31:53 +0800 Subject: [PATCH 1/2] fix jenkins sql table name --- tools/jenkins-scripts/pull-request-builder.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index 7338427e92..9af52b48e9 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -1,4 +1,4 @@ -#Github pull reqest builder for Jenkins +#Github pull reqest builder for Jenkins import json import os @@ -22,7 +22,7 @@ def set_description(desc, url): req_data = urllib.urlencode({'description': desc}) req = urllib2.Request(url + 'submitDescription', req_data) #print(os.environ['BUILD_URL']) - req.add_header('Content-Type', 'application/x-www-form-urlencoded') + req.add_header('Content-Type', 'application/x-www-form-urlencoded') base64string = base64.encodestring(os.environ['JENKINS_ADMIN']+ ":" + os.environ['JENKINS_ADMIN_PW']).replace('\n', '') req.add_header("Authorization", "Basic " + base64string) try: @@ -77,7 +77,7 @@ def close_db(db): def save_build_stats(db, pr, filename, size): cursor = db.cursor() - sql = "INSERT INTO %s (number, size, createdTime) VALUES(%d, %d, now())" % (filename, pr, size) + sql = "INSERT INTO \"%s\" (number, size, createdTime) VALUES(%d, %d, now())" % (filename, pr, size) print sql cursor.execute(sql) db.commit() @@ -118,11 +118,11 @@ def main(): print 'action: ' + action #pr = payload['pull_request'] - + url = payload['html_url'] print "url:" + url pr_desc = '

pr#' + str(pr_num) + ' is '+ action +'

' - + #get statuses url @@ -139,11 +139,11 @@ def main(): target_url = jenkins_url + 'job/' + job_name + '/' + build_number + '/' set_description(pr_desc, target_url) - - + + data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Build started..."} access_token = os.environ['GITHUB_ACCESS_TOKEN'] - Headers = {"Authorization":"token " + access_token} + Headers = {"Authorization":"token " + access_token} try: requests.post(statuses_url, data=json.dumps(data), headers=Headers, proxies = proxyDict) @@ -157,14 +157,14 @@ def main(): os.system("git checkout v3") os.system("git branch -D pull" + str(pr_num)) #clean workspace - print "Before checkout: git clean -xdf -f" + print "Before checkout: git clean -xdf -f" os.system("git clean -xdf -f") #fetch pull request to local repo git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" ret = os.system(git_fetch_pr) if(ret != 0): return(2) - + #checkout a new branch from v3 git_checkout = "git checkout -b " + "pull" + str(pr_num) os.system(git_checkout) @@ -175,9 +175,9 @@ def main(): if r.find('CONFLICT') > 0: print r return(3) - + # After checkout a new branch, clean workspace again - print "After checkout: git clean -xdf -f" + print "After checkout: git clean -xdf -f" os.system("git clean -xdf -f") #update submodule @@ -214,7 +214,7 @@ def main(): print platform.system() if(platform.system() == 'Darwin'): for item in PROJECTS: - cmd = "ln -s " + os.environ['WORKSPACE']+"/android_build_objs/ " + os.environ['WORKSPACE']+"/tests/"+item+"/proj.android/obj" + cmd = "ln -s " + os.environ['WORKSPACE']+"/android_build_objs/ " + os.environ['WORKSPACE']+"/tests/"+item+"/proj.android/obj" os.system(cmd) elif(platform.system() == 'Windows'): for item in PROJECTS: @@ -222,7 +222,7 @@ def main(): cmd = "mklink /J "+os.environ['WORKSPACE']+os.sep+"tests"+os.sep +p+os.sep+"proj.android"+os.sep+"obj " + os.environ['WORKSPACE']+os.sep+"android_build_objs" print cmd os.system(cmd) - + #build #TODO: add android-linux build #TODO: add mac build @@ -306,13 +306,13 @@ def main(): #get build result print "build finished and return " + str(ret) - + exit_code = 1 if ret == 0: exit_code = 0 else: exit_code = 1 - + #clean workspace os.system("cd " + os.environ['WORKSPACE']) os.system("git reset --hard") @@ -325,7 +325,7 @@ def main(): # -------------- main -------------- if __name__ == '__main__': sys_ret = 0 - try: + try: sys_ret = main() except: traceback.print_exc() From 39bce5c22fd9d657f664830e1f16f386fb346b09 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 14 Oct 2014 21:37:04 +0800 Subject: [PATCH 2/2] fix runtime error --- .../frameworks/runtime-src/Classes/AppDelegate.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp index af616c011e..53ae01817b 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -13,10 +13,6 @@ using namespace std; AppDelegate::AppDelegate() { -#if (COCOS2D_DEBUG > 0) - // NOTE:Please don't remove this call if you want to debug with Cocos Code IDE - initRuntime(); -#endif } AppDelegate::~AppDelegate() @@ -37,6 +33,11 @@ void AppDelegate::initGLContextAttrs() bool AppDelegate::applicationDidFinishLaunching() { +#if (COCOS2D_DEBUG > 0) + // NOTE:Please don't remove this call if you want to debug with Cocos Code IDE + initRuntime(); +#endif + // initialize director auto director = Director::getInstance(); auto glview = director->getOpenGLView();