Initial fixes for wp8
This commit is contained in:
parent
5dffcf79c9
commit
c15f5ea9dc
4 changed files with 91 additions and 44 deletions
105
cordova/build.sh
105
cordova/build.sh
|
|
@ -1,14 +1,14 @@
|
|||
#! /bin/bash
|
||||
|
||||
#
|
||||
# Usage:
|
||||
# sh ./build.sh --android --reload
|
||||
|
||||
#
|
||||
OpenColor="\033["
|
||||
Red="1;31m"
|
||||
Yellow="1;33m"
|
||||
Green="1;32m"
|
||||
CloseColor="\033[0m"
|
||||
|
||||
#
|
||||
# Check function OK
|
||||
checkOK() {
|
||||
if [ $? != 0 ]; then
|
||||
|
|
@ -22,16 +22,43 @@ BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||
PROJECT="$BUILDDIR/project"
|
||||
VERSION=`cut -d '"' -f2 $BUILDDIR/../version.js`
|
||||
|
||||
SKIPIOS=false
|
||||
CURRENT_OS="WP8"
|
||||
#CURRENT_OS="IPHONE"
|
||||
#CURRENT_OS="ANDROID"
|
||||
CLEAR=false
|
||||
DBGJS=false
|
||||
|
||||
# Check Args
|
||||
if [[ $1 = "--android" || $2 = "--android" || $3 = "--android" ]]
|
||||
then
|
||||
SKIPIOS=true
|
||||
if [ $CURRENT_OS == "ANDROID" ]; then
|
||||
echo "ANDROID ....."
|
||||
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" ]]
|
||||
then
|
||||
CLEAR=true
|
||||
|
|
@ -45,7 +72,7 @@ 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; }
|
||||
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
|
||||
if $CLEAR
|
||||
|
|
@ -55,6 +82,10 @@ then
|
|||
fi
|
||||
fi
|
||||
|
||||
echo "Build directory is $BUILDDIR"
|
||||
echo "Project directory is $PROJECT"
|
||||
|
||||
|
||||
if [ ! -d $PROJECT ]; then
|
||||
cd $BUILDDIR
|
||||
echo "${OpenColor}${Green}* Creating project... ${CloseColor}"
|
||||
|
|
@ -62,21 +93,30 @@ if [ ! -d $PROJECT ]; then
|
|||
checkOK
|
||||
|
||||
cd $PROJECT
|
||||
echo "${OpenColor}${Green}* Adding Android platform... ${CloseColor}"
|
||||
cordova platforms add android
|
||||
checkOK
|
||||
|
||||
if [[ !$SKIPIOS ]]; then
|
||||
if [$CURRENT_OS == "ANDROID"]; then
|
||||
echo "${OpenColor}${Green}* Adding Android platform... ${CloseColor}"
|
||||
cordova platforms add android
|
||||
checkOK
|
||||
fi
|
||||
|
||||
if [$CURRENT_OS == "IPHONE" ]; then
|
||||
echo "${OpenColor}${Green}* Adding IOS platform... ${CloseColor}"
|
||||
cordova platforms add ios
|
||||
checkOK
|
||||
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}"
|
||||
|
||||
cordova plugin add https://github.com/Initsogar/cordova-webintent.git
|
||||
checkOK
|
||||
|
||||
|
||||
cordova plugin add https://github.com/wildabeast/BarcodeScanner.git
|
||||
checkOK
|
||||
|
||||
|
|
@ -116,22 +156,29 @@ sed "s/<\!-- PLACEHOLDER: CORDOVA SRIPT -->/<script type='text\/javascript' char
|
|||
checkOK
|
||||
|
||||
cd $BUILDDIR
|
||||
cp config.xml $PROJECT/config.xml
|
||||
checkOK
|
||||
|
||||
mkdir -p $PROJECT/platforms/android/res/xml/
|
||||
checkOK
|
||||
if [ $CURRENT_OS == "ANDROID" ]; then
|
||||
echo "Android project!!!"
|
||||
|
||||
cp android/AndroidManifest.xml $PROJECT/platforms/android/AndroidManifest.xml
|
||||
checkOK
|
||||
cp config.xml $PROJECT/config.xml
|
||||
checkOK
|
||||
|
||||
cp android/project.properties $PROJECT/platforms/android/project.properties
|
||||
checkOK
|
||||
mkdir -p $PROJECT/platforms/android/res/xml/
|
||||
checkOK
|
||||
|
||||
cp -R android/res/* $PROJECT/platforms/android/res
|
||||
checkOK
|
||||
cp android/AndroidManifest.xml $PROJECT/platforms/android/AndroidManifest.xml
|
||||
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
|
||||
checkOK
|
||||
|
||||
|
|
@ -148,3 +195,11 @@ if [[ !$SKIPIOS ]]; then
|
|||
checkOK
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue