cordova-plugin-advanced-http/scripts/build-test-app.sh

47 lines
910 B
Bash
Raw Normal View History

2017-10-11 22:33:07 +08:00
#!/usr/bin/env bash
set -e
2018-12-13 02:46:58 +08:00
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ..; pwd )"
WORKINGCOPY=$ROOT/temp/workingcopy
2017-10-11 22:33:07 +08:00
CDV=$ROOT/node_modules/.bin/cordova
PLATFORM=ios
TARGET=emulator
while :; do
case $1 in
--android)
PLATFORM=android
;;
--browser)
PLATFORM=browser
;;
--ios)
PLATFORM=ios
;;
--device)
TARGET=device
;;
--emulator)
TARGET=emulator
;;
-?*)
printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
;;
*)
break
esac
shift
done
2017-10-11 22:33:07 +08:00
rm -rf $ROOT/temp
mkdir $ROOT/temp
2018-12-13 02:46:58 +08:00
cp -r $ROOT/test/app-template/. $ROOT/temp/
cp $ROOT/test/app-test-definitions.js $ROOT/temp/www/
2018-12-13 02:46:58 +08:00
rsync -ax --exclude node_modules --exclude scripts --exclude temp --exclude test $ROOT/. $WORKINGCOPY
2017-10-11 22:33:07 +08:00
cd $ROOT/temp
$CDV prepare
$CDV plugins add $WORKINGCOPY
$CDV build $PLATFORM --$TARGET --buildConfig build.json