print "CROSSWALK_BRANCH in VERSION file is unavailable" sys.exit(1) count = 1 index = 0 for version_tmp in VERSION_TYPES: os.system('cp ../index.html www/index.html') os.system('sed -i "s/{expectedVersion}/%s/g" www/index.html' % EXCEPTED_VERSIONS[index]) comm.replaceUserString( project_path, 'www/index.html', '{expectedVersion}', EXCEPTED_VERSIONS[index]) print version_tmp print EXCEPTED_VERSIONS[index] comm.installWebviewPlugin(BUILD_PARAMETERS.pkgmode, version_tmp) comm.build(app_name, pack_arch_tmp) apk_source = os.path.join(project_path, "platforms", "android", "build", "outputs", "apk", "android%sdebug.apk" % apk_name_arch) apk_dest = os.path.join(current_path_tmp, "CrosswalkVersion_%s_%d.apk" % (comm.CROSSWALK_BRANCH, count)) if not comm.doCopy(apk_source, apk_dest): sys.exit(1) count = count + 1 comm.removeWebviewPlugin() comm.installWebviewPlugin(BUILD_PARAMETERS.pkgmode) os.system('sed -i "s/<preference name=\\"xwalkVersion\\" value=\\".*/<preference name=\\"xwalkVersion\\"' \ ' value=\\"%s\\" \/>/g" config.xml' % version_tmp) comm.build(app_name, pack_arch_tmp)
comm.installCrosswalk(BUILD_PARAMETERS.pkgmode) else: print "CROSSWALK_BRANCH in VERSION file is unavailable" sys.exit(1) count = 1 index = 0 for version_tmp in VERSION_TYPES: os.system('cp ../index.html www/index.html') os.system('sed -i "s/{expectedVersion}/%s/g" www/index.html' % EXCEPTED_VERSIONS[index]) comm.replaceUserString(project_path, 'www/index.html', '{expectedVersion}', EXCEPTED_VERSIONS[index]) print version_tmp print EXCEPTED_VERSIONS[index] comm.installWebviewPlugin(BUILD_PARAMETERS.pkgmode, version_tmp) comm.build(app_name) apk_source = os.path.join(project_path, "platforms", "android", "build", "outputs", "apk", "android-%s-debug.apk" % pkg_arch_tmp) apk_dest = os.path.join( current_path_tmp, "CrosswalkVersion_%s_%d.apk" % (comm.CROSSWALK_BRANCH, count)) comm.doCopy(apk_source, apk_dest) count = count + 1 comm.removeWebviewPlugin() comm.installWebviewPlugin(BUILD_PARAMETERS.pkgmode) os.system('sed -i "s/<preference name=\\"xwalkVersion\\" value=\\".*/<preference name=\\"xwalkVersion\\"' \
app_name = "SharedModeLibraryDownload" pkg_name = "com.example.sharedModeLibraryDownload" current_path_tmp = os.getcwd() comm.create(app_name, pkg_name, current_path_tmp) menifest_path = os.path.join(current_path_tmp, app_name, "platforms", "android") comm.replaceUserString( menifest_path, 'AndroidManifest.xml', 'android:supportsRtl="true">', 'android:supportsRtl="true">\n <meta-data android:name="xwalk_apk_url" android:value="' + BUILD_PARAMETERS.url + '" />') comm.replaceUserString( menifest_path, 'AndroidManifest.xml', '</manifest>', ' <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />\n</manifest>') if comm.CROSSWALK_BRANCH == "beta": comm.installWebviewPlugin("shared", "org.xwalk:xwalk_shared_library_beta:%s" % comm.CROSSWALK_VERSION) else: comm.installWebviewPlugin("shared", "%s" % comm.CROSSWALK_VERSION) comm.build(app_name) comm.run(app_name) comm.checkBuildResult() comm.checkRunResult(pkg_name)