add --debugjs (don´t uglify the js) option to cordova/build.sh for easier remote debugging

This commit is contained in:
“thoatbk” 2014-12-11 01:17:12 +01:00
parent a1f95a4cbf
commit 96b58d2cfc
2 changed files with 21 additions and 6 deletions

View File

@ -238,6 +238,7 @@ module.exports = function(grunt) {
grunt.registerTask('default', ['shell:dev', 'nggettext_compile', 'concat', 'cssmin']);
grunt.registerTask('dist', ['shell:prod', 'nggettext_compile', 'concat', 'cssmin', 'uglify', 'copy:dist']);
grunt.registerTask('dist-dbg', ['shell:dev', 'nggettext_compile', 'concat', 'cssmin', 'copy:dist']);
grunt.registerTask('prod', ['shell:prod', 'nggettext_compile', 'concat', 'cssmin', 'uglify']);
grunt.registerTask('translate', ['nggettext_extract']);
grunt.registerTask('docs', ['jsdoc']);

View File

@ -24,18 +24,24 @@ VERSION=`cut -d '"' -f2 $BUILDDIR/../version.js`
SKIPIOS=false
CLEAR=false
DBGJS=false
# Check Args
if [[ $1 = "--android" || $2 = "--android" ]]
if [[ $1 = "--android" || $2 = "--android" || $3 = "--android" ]]
then
SKIPIOS=true
fi
if [[ $1 = "--clear" || $2 = "--clear" ]]
if [[ $1 = "--clear" || $2 = "--clear" || $3 = "--clear" ]]
then
CLEAR=true
fi
if [[ $1 = "--dbgjs" || $2 = "--dbgjs" || $3 = "--dbgjs" ]]
then
DBGJS=true
fi
echo "${OpenColor}${Green}* Checking dependencies...${CloseColor}"
command -v cordova >/dev/null 2>&1 || { echo >&2 "Cordova is not present, please install it: sudo npm -g cordova."; exit 1; }
@ -88,10 +94,18 @@ if [ ! -d $PROJECT ]; then
fi
echo "${OpenColor}${Green}* Generating copay bundle...${CloseColor}"
cd $BUILDDIR/..
grunt dist
checkOK
if $DBGJS
then
echo "${OpenColor}${Green}* Generating copay bundle (debug js)...${CloseColor}"
cd $BUILDDIR/..
grunt dist-dbg
checkOK
else
echo "${OpenColor}${Green}* Generating copay bundle...${CloseColor}"
cd $BUILDDIR/..
grunt dist
checkOK
fi
echo "${OpenColor}${Green}* Coping files...${CloseColor}"
cd $BUILDDIR/..