From 1e691b95f4c1d7942fde1bdd93fce454764e4522 Mon Sep 17 00:00:00 2001 From: qiuzhong Date: Thu, 3 Nov 2016 09:04:04 +0800 Subject: [PATCH] [cca]Add the cordova-android@6.0.0 for cca Add cordova-android 6.0.0 explicitly for cca build. Impacted tests(approved): new 0, update 2, delete 0 Unit test platform: Crosswalk Project for Android 23.53.589.0 Unit test result summary: pass 2, fail 0, block 0 BUG=https://crosswalk-project.org/jira/browse/CTS-1916 --- .../cordova-sampleapp-android-tests/sampleapp/CIRC_build.py | 2 +- .../cordova-sampleapp-android-tests/sampleapp/Eh_build.py | 2 +- cordova/cordova-sampleapp-android-tests/sampleapp/comm.py | 4 ++-- tools/build/pack_cordova_sample.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cordova/cordova-sampleapp-android-tests/sampleapp/CIRC_build.py b/cordova/cordova-sampleapp-android-tests/sampleapp/CIRC_build.py index 27195fb03..ca983fe4e 100755 --- a/cordova/cordova-sampleapp-android-tests/sampleapp/CIRC_build.py +++ b/cordova/cordova-sampleapp-android-tests/sampleapp/CIRC_build.py @@ -41,7 +41,7 @@ def test_build(self): comm.setUp() app_name = "CIRC" sample_src_pref = "/tmp/crosswalk-demos/circ" - comm.buildGoogleApp(app_name, sample_src_pref, self) + comm.buildGoogleApp(app_name, sample_src_pref, self, "6.0.0") if __name__ == '__main__': unittest.main() diff --git a/cordova/cordova-sampleapp-android-tests/sampleapp/Eh_build.py b/cordova/cordova-sampleapp-android-tests/sampleapp/Eh_build.py index 2b59c25a5..c88a0c7a6 100755 --- a/cordova/cordova-sampleapp-android-tests/sampleapp/Eh_build.py +++ b/cordova/cordova-sampleapp-android-tests/sampleapp/Eh_build.py @@ -41,7 +41,7 @@ def test_build(self): comm.setUp() app_name = "Eh" sample_src_pref = "/tmp/crosswalk-demos/workshop-cca-eh" - comm.buildGoogleApp(app_name, sample_src_pref, self) + comm.buildGoogleApp(app_name, sample_src_pref, self, "6.0.0") if __name__ == '__main__': unittest.main() diff --git a/cordova/cordova-sampleapp-android-tests/sampleapp/comm.py b/cordova/cordova-sampleapp-android-tests/sampleapp/comm.py index 2c2e9951d..a8314deb1 100755 --- a/cordova/cordova-sampleapp-android-tests/sampleapp/comm.py +++ b/cordova/cordova-sampleapp-android-tests/sampleapp/comm.py @@ -181,7 +181,7 @@ def create(appname, pkgname, mode, sourcecodepath, replace_index_list, self, ext do_remove(glob.glob(os.path.join(project_root, "www"))) do_copy(sourcecodepath, os.path.join(tool_path, appname, "www")) -def buildGoogleApp(appname, sourcecodepath, self): +def buildGoogleApp(appname, sourcecodepath, self, cordova_android_ver): os.chdir(tool_path) if os.path.exists(os.path.join(tool_path, appname)): print "Existing %s project, try to clean up..." % appname @@ -209,7 +209,7 @@ def buildGoogleApp(appname, sourcecodepath, self): os.chdir(os.path.join(tool_path, appname)) print "Add android platforms to this project --------------> START" - add_android_cmd = "cca platform add android" + add_android_cmd = "cca platform add android@%s" % cordova_android_ver addstatus = commands.getstatusoutput(add_android_cmd) self.assertEquals(0, addstatus[0]) diff --git a/tools/build/pack_cordova_sample.py b/tools/build/pack_cordova_sample.py index 18a9595fa..becbcc318 100755 --- a/tools/build/pack_cordova_sample.py +++ b/tools/build/pack_cordova_sample.py @@ -448,7 +448,7 @@ def copyCordovaCliApk(app_name, orig_dir, apk_name_arch="armv7", apk_name_mode=" return True -def packGoogleApp(app_name=None): +def packGoogleApp(app_name=None, cordova_android_ver): project_root = os.path.join(BUILD_ROOT, app_name) orig_dir = os.getcwd() buildstatus = commands.getstatusoutput("cca -v") @@ -530,7 +530,7 @@ def packGoogleApp(app_name=None): '', ' \n') - add_cmd = "cca platform add android" + add_cmd = "cca platform add android@%s" % cordova_android_ver if not doCMD(add_cmd, DEFAULT_CMD_TIMEOUT * 2): os.chdir(orig_dir) return False @@ -858,7 +858,7 @@ def packAPP(app_name=None): if not packMobileSpec(app_name): return False elif checkContains(app_name, "CIRC") or checkContains(app_name, "EH"): - if not packGoogleApp(app_name): + if not packGoogleApp(app_name, "6.0.0"): return False else: if not packSampleApp_cli(app_name):