Created
August 27, 2014 19:14
-
-
Save jperl/19d1322187b1756fe3e2 to your computer and use it in GitHub Desktop.
Grunt tasks to add and build crosswalk for cordova project using grunt shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crosswalk = { | |
folder: { | |
arm: 'tools/crosswalk-cordova-7.36.154.13-arm', | |
x86: 'tools/crosswalk-cordova-7.36.154.13-x86' | |
} | |
}; | |
// https://crosswalk-project.org/#documentation/cordova/migrate_an_application | |
var addCrosswalk = { | |
command: [ | |
'rm -Rf platforms/android/CordovaLib/*', | |
'cp -a ' + crosswalk.folder.arm + '/framework/* platforms/android/CordovaLib/', | |
'cp -a ' + crosswalk.folder.arm + '/VERSION platforms/android/', | |
// TODO add ACCESS_WIFI_STATE permission to AndroidManifest | |
'cp -a ' + crosswalk.folder.x86 + '/framework/xwalk_core_library/libs/* ' + | |
'platforms/android/CordovaLib/xwalk_core_library/libs/' | |
].join('&&') | |
}; | |
var buildCrosswalk = { | |
command: [ | |
'export ANDROID_HOME=$(dirname $(dirname $(which android)))', | |
'cd platforms/android/CordovaLib/', | |
'android update project --subprojects --path . --target "android-19"', | |
'ant debug', | |
// remove files generated by cordova during previous build | |
'cd ..', | |
'rm -Rf ant-gen', | |
'rm -Rf ant-build', | |
// build the apk | |
'cd ../..', | |
'cordova build android' | |
].join('&&') | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment