mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2024-10-06 17:22:12 +08:00
47 lines
910 B
Bash
Executable File
47 lines
910 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ..; pwd )"
|
|
WORKINGCOPY=$ROOT/temp/workingcopy
|
|
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
|
|
|
|
rm -rf $ROOT/temp
|
|
mkdir $ROOT/temp
|
|
cp -r $ROOT/test/app-template/. $ROOT/temp/
|
|
cp $ROOT/test/app-test-definitions.js $ROOT/temp/www/
|
|
rsync -ax --exclude node_modules --exclude scripts --exclude temp --exclude test $ROOT/. $WORKINGCOPY
|
|
cd $ROOT/temp
|
|
$CDV prepare
|
|
$CDV plugins add $WORKINGCOPY
|
|
$CDV build $PLATFORM --$TARGET --buildConfig build.json
|