Sqlite-Plugin, DB-Copy plugin added und integriert
This commit is contained in:
58
plugins/cordova-sqlite-storage/bin/test.ps1
Normal file
58
plugins/cordova-sqlite-storage/bin/test.ps1
Normal file
@@ -0,0 +1,58 @@
|
||||
# Automated cordova tests. Installs the correct cordova platform,
|
||||
# installs the plugin, installs the test app, and then runs it on
|
||||
# a device or emulator.
|
||||
#
|
||||
# usage: .\bin\test.ps1 [android|ios|windows|wp8]
|
||||
#
|
||||
# N.B. if you functionally change this script you _must_ change .\bin\test.sh too.
|
||||
#
|
||||
|
||||
param([string]$platform)
|
||||
|
||||
if (! $platform) {
|
||||
echo "usage: .\bin\test.sh [android|ios|windows|wp8]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (! (get-command coffee) ) {
|
||||
echo "you need coffeescript. please install with:"
|
||||
echo "npm install -g coffee-script"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (! (get-command cordova) ) {
|
||||
echo "you need cordova. please install with:"
|
||||
echo "npm install -g cordova"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
pushd spec
|
||||
if (!$?) { # run from the bin/ directory
|
||||
echo "re-pushing"
|
||||
pushd ../spec
|
||||
}
|
||||
try {
|
||||
# compile coffeescript
|
||||
coffee --no-header -cl -o ../www ../SQLitePlugin.coffee.md
|
||||
if (!$?) {
|
||||
echo "coffeescript compilation failed"
|
||||
exit 1
|
||||
}
|
||||
echo "compiled coffeescript to javascript"
|
||||
|
||||
# move everything to a temp folder to avoid infinite recursion errors
|
||||
if (test-path ../.plugin) {
|
||||
rm -force -recurse ../.plugin -ErrorAction ignore
|
||||
}
|
||||
mkdir -ErrorAction ignore ../.plugin | out-null
|
||||
cp -recurse ../src, ../plugin.xml, ../www ../.plugin
|
||||
|
||||
# update the plugin, run the test app
|
||||
cordova platform add $platform
|
||||
cordova plugin rm com.phonegap.plugins.sqlite
|
||||
cordova plugin add ../.plugin
|
||||
cordova run $platform
|
||||
} finally {
|
||||
popd
|
||||
}
|
||||
56
plugins/cordova-sqlite-storage/bin/test.sh
Normal file
56
plugins/cordova-sqlite-storage/bin/test.sh
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Automated cordova tests. Installs the correct cordova platform,
|
||||
# installs the plugin, installs the test app, and then runs it on
|
||||
# a device or emulator.
|
||||
#
|
||||
# usage: ./bin/test.sh [android|ios]
|
||||
#
|
||||
# N.B. if you functionally change this script you _must_ change .\bin\test.sh too.
|
||||
#
|
||||
|
||||
# N.B. if you functionally change this script you _must_ change ./bin/test.ps1 too.
|
||||
|
||||
platform=$1
|
||||
|
||||
if [[ -z $platform ]]; then
|
||||
echo "usage: ./bin/test.sh [android|ios]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -x $(which coffee) ]]; then
|
||||
echo "you need coffeescript. please install with:"
|
||||
echo "npm install -g coffee-script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -x $(which cordova) ]]; then
|
||||
echo "you need cordova. please install with:"
|
||||
echo "npm install -g cordova"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd spec
|
||||
if [[ $? != 0 ]]; then # run from the bin/ directory
|
||||
cd ../spec
|
||||
fi
|
||||
|
||||
# compile coffeescript
|
||||
coffee --no-header -cl -o ../www ../SQLitePlugin.coffee.md
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
echo "coffeescript compilation failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "compiled coffeescript to javascript"
|
||||
|
||||
# move everything to a temp folder to avoid infinite recursion errors
|
||||
rm -fr ../.plugin
|
||||
mkdir -p ../.plugin
|
||||
cp -r ../src ../plugin.xml ../www ../.plugin
|
||||
|
||||
# update the plugin, run the test app
|
||||
cordova platform add $platform
|
||||
cordova plugin rm com.brodysoft.sqlitePlugin
|
||||
cordova plugin add ../.plugin
|
||||
cordova run $platform
|
||||
Reference in New Issue
Block a user