Example #1
0
            "xwalk_%s_library:%s" % (pkg_mode_tmp, comm.CROSSWALK_VERSION),
            "%s" % (comm.CROSSWALK_VERSION)]
    EXCEPTED_VERSIONS = [latestVersion, latestVersion, latestVersion, latestVersion, \
            comm.CROSSWALK_VERSION, comm.CROSSWALK_VERSION, comm.CROSSWALK_VERSION]

elif comm.CROSSWALK_BRANCH == "canary":
    VERSION_TYPES = [
        "org.xwalk:xwalk_%s_library:%s" %
        (pkg_mode_tmp, comm.CROSSWALK_VERSION),
        "xwalk_%s_library:%s" % (pkg_mode_tmp, comm.CROSSWALK_VERSION),
        "%s" % (comm.CROSSWALK_VERSION)
    ]
    EXCEPTED_VERSIONS = [
        comm.CROSSWALK_VERSION, comm.CROSSWALK_VERSION, comm.CROSSWALK_VERSION
    ]
    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)
Example #2
0
        "--mode",
        dest="pkgmode",
        help="specify the apk mode, e.g. shared, embedded")
    global BUILD_PARAMETERS
    (BUILD_PARAMETERS, args) = opts_parser.parse_args()
except Exception as e:
    print "Got wrong options: %s, exit ..." % e
    sys.exit(1)
if not BUILD_PARAMETERS.pkgmode:
    print "Please add the -m parameter for the pkgmode"
    sys.exit(1)
elif BUILD_PARAMETERS.pkgmode and not BUILD_PARAMETERS.pkgmode in PKG_MODES:
    print "Wrong pkg-mode, only support: %s, exit ..." % PKG_MODES
    sys.exit(1)

comm.installCrosswalk(BUILD_PARAMETERS.pkgmode)
app_name = "CordovaPackage"
pkg_name = "com.example.cordovaPackage2"

current_path_tmp = os.getcwd()
cordova_android_path = os.path.join(current_path_tmp, "cordova-android")
if os.path.exists(cordova_android_path):
    comm.doRemove([cordova_android_path])
os.system("git clone https://github.com/apache/cordova-android.git")

project_path = os.path.join(current_path_tmp, app_name)
if os.path.exists(project_path):
    comm.doRemove([project_path])

os.system("cordova-android/bin/create %s %s %s" % (app_name, pkg_name, app_name))
os.chdir(project_path)
Example #3
0
        "-u",
        "--url",
        dest="url",
        help="specify the url, e.g. http://host/XWalkRuntimeLib.apk")
    global BUILD_PARAMETERS
    (BUILD_PARAMETERS, args) = opts_parser.parse_args()
except Exception as e:
    print "Got wrong options: %s, exit ..." % e
    sys.exit(1)

if not BUILD_PARAMETERS.url:
    print "Please add the -u parameter for the url of XWalkRuntimeLib.apk"
    sys.exit(1)


comm.installCrosswalk("shared")

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',