Initial fixes for wp8

This commit is contained in:
Matias Pando 2014-12-30 15:19:16 +00:00 committed by Matias Alejo Garcia
commit c15f5ea9dc
4 changed files with 91 additions and 44 deletions

View file

@ -25,19 +25,11 @@ module.exports = function(grunt) {
} }
} }
}, },
shell: { exec: {
prod: { prod: {
options: { command: 'ls'
stdout: false,
stderr: false
},
command: 'node ./util/build.js'
}, },
dev: { dev: {
options: {
stdout: true,
stderr: true
},
command: 'node ./util/build.js -d' command: 'node ./util/build.js -d'
} }
}, },
@ -242,25 +234,25 @@ module.exports = function(grunt) {
grunt.registerTask('default', [ grunt.registerTask('default', [
'shell:dev', 'nggettext_compile', 'concat', 'cssmin:desktop', 'cssmin:vendors' 'exec:dev', 'nggettext_compile', 'concat', 'cssmin:desktop', 'cssmin:vendors'
]); ]);
grunt.registerTask('mobile', [ grunt.registerTask('mobile', [
'shell:dev', 'nggettext_compile', 'concat', 'cssmin:mobile', 'cssmin:vendors' 'exec:dev', 'nggettext_compile', 'concat', 'cssmin:mobile', 'cssmin:vendors'
]); ]);
grunt.registerTask('dist', [ grunt.registerTask('dist', [
'shell:prod', 'nggettext_compile', 'concat', 'cssmin:desktop', 'cssmin:vendors', 'uglify', 'copy:dist' 'exec:prod', 'nggettext_compile', 'concat', 'cssmin:desktop', 'cssmin:vendors', 'uglify', 'copy:dist'
]); ]);
grunt.registerTask('dist-dbg', [ grunt.registerTask('dist-dbg', [
'shell:prod', 'nggettext_compile', 'concat', 'cssmin:desktop', 'cssmin:vendors', 'copy:dist' 'exec:prod', 'nggettext_compile', 'concat', 'cssmin:desktop', 'cssmin:vendors', 'copy:dist'
]); ]);
grunt.registerTask('dist-mobile', [ grunt.registerTask('dist-mobile', [
'shell:prod', 'nggettext_compile', 'concat', 'cssmin:mobile', 'cssmin:vendors', 'uglify', 'copy:dist' 'exec:prod', 'nggettext_compile', 'concat', 'cssmin:mobile', 'cssmin:vendors', 'uglify', 'copy:dist'
]); ]);
grunt.registerTask('dist-mobile-dbg', [ grunt.registerTask('dist-mobile-dbg', [
'shell:dev', 'nggettext_compile', 'concat', 'cssmin:mobile', 'cssmin:vendors', 'copy:dist' 'exec:dev', 'nggettext_compile', 'concat', 'cssmin:mobile', 'cssmin:vendors', 'copy:dist'
]); ]);
grunt.registerTask('prod', [ grunt.registerTask('prod', [
'shell:prod', 'nggettext_compile', 'concat', 'cssmin:desktop', 'cssmin:vendors', 'uglify' 'exec:prod', 'nggettext_compile', 'concat', 'cssmin:desktop', 'cssmin:vendors', 'uglify'
]); ]);
grunt.registerTask('translate', ['nggettext_extract']); grunt.registerTask('translate', ['nggettext_extract']);
grunt.registerTask('docs', ['jsdoc']); grunt.registerTask('docs', ['jsdoc']);

View file

@ -1,14 +1,14 @@
#! /bin/bash #! /bin/bash
#
# Usage: # Usage:
# sh ./build.sh --android --reload # sh ./build.sh --android --reload
#
OpenColor="\033[" OpenColor="\033["
Red="1;31m" Red="1;31m"
Yellow="1;33m" Yellow="1;33m"
Green="1;32m" Green="1;32m"
CloseColor="\033[0m" CloseColor="\033[0m"
#
# Check function OK # Check function OK
checkOK() { checkOK() {
if [ $? != 0 ]; then if [ $? != 0 ]; then
@ -22,16 +22,43 @@ BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT="$BUILDDIR/project" PROJECT="$BUILDDIR/project"
VERSION=`cut -d '"' -f2 $BUILDDIR/../version.js` VERSION=`cut -d '"' -f2 $BUILDDIR/../version.js`
SKIPIOS=false CURRENT_OS="WP8"
#CURRENT_OS="IPHONE"
#CURRENT_OS="ANDROID"
CLEAR=false CLEAR=false
DBGJS=false DBGJS=false
# Check Args if [ $CURRENT_OS == "ANDROID" ]; then
if [[ $1 = "--android" || $2 = "--android" || $3 = "--android" ]] echo "ANDROID ....."
then
SKIPIOS=true
fi fi
if [ $CURRENT_OS == "IPHONE" ]; then
echo "IPHONE ....."
fi
if [ $CURRENT_OS == "WP8" ]; then
echo "WP8 ....."
fi
# Check Args
#if [[ $1 = "--android" || $2 = "--android" || $3 = "--android" ]]
#then
# CURRENT_OS="ANDROID"
#fi
#
#if [[ $1 = "--ios" || $2 = "--ios" || $3 = "--ios" ]]
#then
# CURRENT_OS="IPHONE"
#fi
#
#if [[ $1 = "--wp8" || $2 = "--wp8" || $3 = "--wp8" ]]
#then
# CURRENT_OS="WP8"
#fi
if [[ $1 = "--clear" || $2 = "--clear" || $3 = "--clear" ]] if [[ $1 = "--clear" || $2 = "--clear" || $3 = "--clear" ]]
then then
CLEAR=true CLEAR=true
@ -45,7 +72,7 @@ fi
echo "${OpenColor}${Green}* Checking dependencies...${CloseColor}" 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; } command -v cordova >/dev/null 2>&1 || { echo >&2 "Cordova is not present, please install it: sudo npm -g cordova."; exit 1; }
command -v xcodebuild >/dev/null 2>&1 || { echo >&2 "XCode is not present, install it or use [--android]."; exit 1; } #command -v xcodebuild >/dev/null 2>&1 || { echo >&2 "XCode is not present, install it or use [--android]."; exit 1; }
# Create project dir # Create project dir
if $CLEAR if $CLEAR
@ -55,6 +82,10 @@ then
fi fi
fi fi
echo "Build directory is $BUILDDIR"
echo "Project directory is $PROJECT"
if [ ! -d $PROJECT ]; then if [ ! -d $PROJECT ]; then
cd $BUILDDIR cd $BUILDDIR
echo "${OpenColor}${Green}* Creating project... ${CloseColor}" echo "${OpenColor}${Green}* Creating project... ${CloseColor}"
@ -62,16 +93,25 @@ if [ ! -d $PROJECT ]; then
checkOK checkOK
cd $PROJECT cd $PROJECT
if [$CURRENT_OS == "ANDROID"]; then
echo "${OpenColor}${Green}* Adding Android platform... ${CloseColor}" echo "${OpenColor}${Green}* Adding Android platform... ${CloseColor}"
cordova platforms add android cordova platforms add android
checkOK checkOK
fi
if [[ !$SKIPIOS ]]; then if [$CURRENT_OS == "IPHONE" ]; then
echo "${OpenColor}${Green}* Adding IOS platform... ${CloseColor}" echo "${OpenColor}${Green}* Adding IOS platform... ${CloseColor}"
cordova platforms add ios cordova platforms add ios
checkOK checkOK
fi fi
if [$CURRENT_OS == "WP8"]; then
echo "${OpenColor}${Green}* Adding WP8 platform... ${CloseColor}"
cordova platforms add wp8
checkOK
fi
echo "${OpenColor}${Green}* Installing plugins... ${CloseColor}" echo "${OpenColor}${Green}* Installing plugins... ${CloseColor}"
cordova plugin add https://github.com/Initsogar/cordova-webintent.git cordova plugin add https://github.com/Initsogar/cordova-webintent.git
@ -116,22 +156,29 @@ sed "s/<\!-- PLACEHOLDER: CORDOVA SRIPT -->/<script type='text\/javascript' char
checkOK checkOK
cd $BUILDDIR cd $BUILDDIR
cp config.xml $PROJECT/config.xml
checkOK
mkdir -p $PROJECT/platforms/android/res/xml/ if [ $CURRENT_OS == "ANDROID" ]; then
checkOK echo "Android project!!!"
cp android/AndroidManifest.xml $PROJECT/platforms/android/AndroidManifest.xml cp config.xml $PROJECT/config.xml
checkOK checkOK
cp android/project.properties $PROJECT/platforms/android/project.properties mkdir -p $PROJECT/platforms/android/res/xml/
checkOK checkOK
cp -R android/res/* $PROJECT/platforms/android/res cp android/AndroidManifest.xml $PROJECT/platforms/android/AndroidManifest.xml
checkOK checkOK
if [[ !$SKIPIOS ]]; then cp android/project.properties $PROJECT/platforms/android/project.properties
checkOK
cp -R android/res/* $PROJECT/platforms/android/res
checkOK
fi
if [ $CURRENT_OS == "IPHONE" ]; then
echo "Iphone project!!!"
cp ios/Copay-Info.plist $PROJECT/platforms/ios/Copay-Info.plist cp ios/Copay-Info.plist $PROJECT/platforms/ios/Copay-Info.plist
checkOK checkOK
@ -148,3 +195,11 @@ if [[ !$SKIPIOS ]]; then
checkOK checkOK
fi fi
if [ $CURRENT_OS == "WP8" ]; then
echo "Windows project!!!"
echo "from " $PROJECT/www
echo "to " $PROJECT/platforms/wp8/www
cp -R $PROJECT/www $PROJECT/platforms/wp8/www
checkOK
fi

View file

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en" ng-csp> <html lang="en" ng-app="copayApp" ng-csp>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

View file

@ -66,7 +66,7 @@
"grunt-markdown": "^0.5.0", "grunt-markdown": "^0.5.0",
"grunt-mocha-test": "^0.8.2", "grunt-mocha-test": "^0.8.2",
"grunt-release": "^0.7.0", "grunt-release": "^0.7.0",
"grunt-shell": "^0.6.4", "grunt-exec": "*",
"istanbul": "^0.2.10", "istanbul": "^0.2.10",
"karma": "^0.12.9", "karma": "^0.12.9",
"karma-chai": "^0.1.0", "karma-chai": "^0.1.0",