From 96b58d2cfce0d3fc8913988d089c38ac0cd4de96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cthoatbk=E2=80=9D?= <“thomas@butterkiss.com”> Date: Thu, 11 Dec 2014 01:17:12 +0100 Subject: [PATCH] =?UTF-8?q?add=20--debugjs=20(don=C2=B4t=20uglify=20the=20?= =?UTF-8?q?js)=20option=20to=20cordova/build.sh=20for=20easier=20remote=20?= =?UTF-8?q?debugging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gruntfile.js | 1 + cordova/build.sh | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 097f9689c..d0c634215 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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']); diff --git a/cordova/build.sh b/cordova/build.sh index a638ea1e4..ba05ebf7b 100755 --- a/cordova/build.sh +++ b/cordova/build.sh @@ -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/..