Skip to content

Instantly share code, notes, and snippets.

View Red-Folder's full-sized avatar

Mark Taylor Red-Folder

View GitHub Profile
Write-Output "Checking if the app has been started"
$resultCode = -1
& adb shell ps 2>&1 | % {if($_.contains("com.red_folder.phonegap.plugin.backgroundservice.sample")) { Write-Output "App has started"; $resultCode = 0 } }
exit $resultCode
adb shell am start -n com.red_folder.phonegap.plugin.backgroundservice.sample/com.red_folder.phonegap.plugin.backgroundservice.sample.BackgroundServicePluginSampleActivity
clean debug install
android update project -p .
del /Q "%workspace%\libs\*"
copy /b "C:\JavaWorkspace\Libraries\Cordova\cordova-%CORDOVAVERSION%.jar" "%workspace%\libs\"
copy /b "%BUILDOUTPUTPATH%\backgroundserviceplugin-%PLUGINVERSION%.jar" "%workspace%\libs\"
del /Q "%workspace%\assets\www\jasmine\src\*"
copy /b "%workspace%\assets\www\%PLUGINVERSION%\backgroundService*.js" "%workspace%\assets\www\jasmine\src\backgroundService.js"
copy /b "%workspace%\assets\www\%PLUGINVERSION%\cordova*.js" "%workspace%\assets\www\jasmine\src\cordova.js"
copy /b "%workspace%\assets\www\%PLUGINVERSION%\myService*.js" "%workspace%\assets\www\jasmine\src\myService.js"
@Red-Folder
Red-Folder / PluginSpec.js
Last active December 21, 2015 04:49
Sample Jasmine spec file that I use for testing my Cordova Background Service plugin
/*
* Create a reference myService
*/
var myService = cordova.require('cordova/plugin/myService');
/*
* Suite of tests to start the Background Service
* Jasmine "describe" section
*/
describe("When Plugin not running", function() {
copy "%WORKSPACE%\bin\classes.jar" "%BUILDOUTPUTPATH%\backgroundserviceplugin-%PLUGINVERSION%.jar"
clean debug
android update lib-project -p .
@Red-Folder
Red-Folder / gist:6205783
Created August 11, 2013 17:07
Windows Batch command to rename source files
copy "%WORKSPACE%\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundServicePlugin.v%PLUGINVERSION%.txt" "%WORKSPACE%\src\com\red_folder\phonegap\plugin\backgroundservice\BackgroundServicePlugin.java"