You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2014/05/02 20:30:21 UTC
[46/70] git commit: Split out cordova-lib: move cordova-plugman files
Split out cordova-lib: move cordova-plugman files
HISTORY:
git log <file> will show no history from before this commit for files that
moved. To see full history use either
git log --follow <file>
or
git log plugman_pre_lib <old file name>
'plugman_pre_lib' is a tag for the last commit made in cordova-plugman repo before
cordova-lib was split out.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/0318d8cd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/0318d8cd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/0318d8cd
Branch: refs/heads/cordova-lib
Commit: 0318d8cddf7c3ac627dd24afa7fefd5845dc85da
Parents: ff2a9f0
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Wed Apr 30 18:11:57 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Wed Apr 30 18:11:57 2014 -0400
----------------------------------------------------------------------
cordova-lib/spec-plugman/add_platform.spec.js | 64 +
cordova-lib/spec-plugman/adduser.spec.js | 11 +
cordova-lib/spec-plugman/common.js | 62 +
cordova-lib/spec-plugman/config.spec.js | 12 +
cordova-lib/spec-plugman/create.spec.js | 62 +
cordova-lib/spec-plugman/fetch.spec.js | 211 +
cordova-lib/spec-plugman/info.spec.js | 15 +
cordova-lib/spec-plugman/install.spec.js | 472 +
cordova-lib/spec-plugman/owner.spec.js | 12 +
cordova-lib/spec-plugman/platform.spec.js | 26 +
.../platforms/amazon-fireos.spec.js | 139 +
.../spec-plugman/platforms/android.spec.js | 156 +
.../spec-plugman/platforms/blackberry10.spec.js | 148 +
.../spec-plugman/platforms/common.spec.js | 130 +
cordova-lib/spec-plugman/platforms/ios.spec.js | 390 +
.../spec-plugman/platforms/tizen.spec.js | 54 +
.../spec-plugman/platforms/windows8.spec.js | 135 +
cordova-lib/spec-plugman/platforms/wp7.spec.js | 129 +
cordova-lib/spec-plugman/platforms/wp8.spec.js | 150 +
cordova-lib/spec-plugman/plugins/.gitkeep | 0
.../spec-plugman/plugins/AndroidJS/plugin.xml | 34 +
.../plugins/AndroidJS/www/android.js | 1 +
.../plugins/ChildBrowser/plugin.xml | 143 +
.../ChildBrowser/src/android/ChildBrowser.java | 19 +
.../src/ios/ChildBrowser.bundle/arrow_left.png | Bin 0 -> 2946 bytes
.../ios/ChildBrowser.bundle/arrow_left@2x.png | Bin 0 -> 2946 bytes
.../src/ios/ChildBrowser.bundle/arrow_right.png | Bin 0 -> 2946 bytes
.../ios/ChildBrowser.bundle/arrow_right@2x.png | Bin 0 -> 2946 bytes
.../src/ios/ChildBrowser.bundle/but_refresh.png | Bin 0 -> 3369 bytes
.../ios/ChildBrowser.bundle/but_refresh@2x.png | Bin 0 -> 3369 bytes
.../src/ios/ChildBrowser.bundle/compass.png | Bin 0 -> 3035 bytes
.../src/ios/ChildBrowser.bundle/compass@2x.png | Bin 0 -> 3035 bytes
.../ChildBrowser/src/ios/ChildBrowserCommand.h | 49 +
.../ChildBrowser/src/ios/ChildBrowserCommand.m | 86 +
.../src/ios/ChildBrowserViewController.h | 73 +
.../src/ios/ChildBrowserViewController.m | 239 +
.../src/ios/ChildBrowserViewController.xib | 875 ++
.../ChildBrowser/src/ios/TargetDirTest.h | 20 +
.../ChildBrowser/src/ios/TargetDirTest.m | 1 +
.../src/ios/preserveDirs/PreserveDirsTest.h | 20 +
.../src/ios/preserveDirs/PreserveDirsTest.m | 1 +
.../plugins/ChildBrowser/www/childbrowser.js | 19 +
.../ChildBrowser/www/childbrowser/image.jpg | 1 +
.../ChildBrowser/www/childbrowser_file.html | 1 +
.../plugins/ConfigTestPlugin/plugin.xml | 37 +
.../spec-plugman/plugins/Contacts/plugin.xml | 143 +
.../Contacts/src/android/ContactAccessor.java | 198 +
.../src/android/ContactAccessorSdk5.java | 2183 +++++
.../Contacts/src/android/ContactManager.java | 122 +
.../src/blackberry10/ContactActivity.js | 26 +
.../Contacts/src/blackberry10/ContactAddress.js | 30 +
.../Contacts/src/blackberry10/ContactError.js | 30 +
.../Contacts/src/blackberry10/ContactField.js | 27 +
.../src/blackberry10/ContactFindOptions.js | 50 +
.../Contacts/src/blackberry10/ContactName.js | 39 +
.../Contacts/src/blackberry10/ContactNews.js | 26 +
.../src/blackberry10/ContactOrganization.js | 22 +
.../Contacts/src/blackberry10/ContactPhoto.js | 23 +
.../Contacts/src/blackberry10/contactConsts.js | 225 +
.../Contacts/src/blackberry10/contactUtils.js | 223 +
.../plugins/Contacts/src/blackberry10/index.js | 374 +
.../Contacts/src/blackberry10/plugin.xml | 41 +
.../plugins/Contacts/src/ios/CDVContact.h | 136 +
.../plugins/Contacts/src/ios/CDVContact.m | 1752 ++++
.../plugins/Contacts/src/ios/CDVContacts.h | 151 +
.../plugins/Contacts/src/ios/CDVContacts.m | 593 ++
.../plugins/Contacts/src/wp/Contacts.cs | 664 ++
.../plugins/Contacts/www/Contact.js | 177 +
.../plugins/Contacts/www/ContactAddress.js | 46 +
.../plugins/Contacts/www/ContactError.js | 42 +
.../plugins/Contacts/www/ContactField.js | 37 +
.../plugins/Contacts/www/ContactFindOptions.js | 34 +
.../plugins/Contacts/www/ContactName.js | 41 +
.../plugins/Contacts/www/ContactOrganization.js | 44 +
.../plugins/Contacts/www/contacts.js | 76 +
.../plugins/Contacts/www/ios/Contact.js | 51 +
.../plugins/Contacts/www/ios/contacts.js | 62 +
.../plugins/DummyPlugin/android-resource.xml | 1 +
.../spec-plugman/plugins/DummyPlugin/plugin.xml | 203 +
.../DummyPlugin/src/android/DummyPlugin.java | 19 +
.../plugins/DummyPlugin/src/android/TestLib.jar | 0
.../DummyPlugin/src/blackberry10/index.js | 19 +
.../src/ios/Custom.framework/someFheader.h | 0
.../src/ios/Custom.framework/somebinlib | 0
.../DummyPlugin/src/ios/DummyPlugin.bundle | 0
.../DummyPlugin/src/ios/DummyPluginCommand.h | 0
.../DummyPlugin/src/ios/DummyPluginCommand.m | 0
.../DummyPlugin/src/ios/SourceWithFramework.m | 0
.../plugins/DummyPlugin/src/ios/TargetDirTest.h | 0
.../plugins/DummyPlugin/src/ios/TargetDirTest.m | 0
.../DummyPlugin/src/ios/libsqlite3.dylib | 0
.../plugins/DummyPlugin/src/tizen/dummer.js | 0
.../plugins/DummyPlugin/src/windows8/dummer.js | 0
.../plugins/DummyPlugin/src/wp7/DummyPlugin.cs | 19 +
.../plugins/DummyPlugin/src/wp8/DummyPlugin.cs | 19 +
.../plugins/DummyPlugin/www/dummyplugin.js | 19 +
.../DummyPlugin/www/dummyplugin/image.jpg | 1 +
.../plugins/EnginePlugin/megaBoringVersion | 23 +
.../plugins/EnginePlugin/megaFunVersion | 23 +
.../plugins/EnginePlugin/plugin.xml | 33 +
.../plugins/EnginePluginAndroid/plugin.xml | 32 +
.../plugins/EnginePluginiOS/plugin.xml | 34 +
.../plugins/FaultyPlugin/plugin.xml | 161 +
.../FaultyPlugin/src/android/FaultyPlugin.java | 19 +
.../FaultyPlugin/src/blackberry10/client.js | 0
.../plugins/FaultyPlugin/src/ios/FaultyPlugin.h | 49 +
.../plugins/FaultyPlugin/src/ios/FaultyPlugin.m | 86 +
.../FaultyPlugin/src/windows8/faultyPlugin.js | 0
.../FaultyPlugin/src/wp7/FaultyPlugin.cs | 19 +
.../FaultyPlugin/src/wp8/FaultyPlugin.cs | 19 +
.../plugins/PluginsPlistOnly/plugin.xml | 31 +
.../plugins/VariablePlugin/plugin.xml | 59 +
.../plugins/WebNotifications/plugin.xml | 47 +
.../WebNotifications/src/ios/AppDelegate.m.diff | 18 +
.../WebNotifications/src/ios/WebNotifications.h | 35 +
.../WebNotifications/src/ios/WebNotifications.m | 124 +
.../WebNotifications/www/webnotifications.js | 123 +
.../plugins/WeblessPlugin/plugin.xml | 83 +
.../src/android/WeblessPlugin.java | 19 +
.../src/ios/WeblessPlugin.bundle/arrow_left.png | Bin 0 -> 2946 bytes
.../ios/WeblessPlugin.bundle/arrow_left@2x.png | Bin 0 -> 2946 bytes
.../ios/WeblessPlugin.bundle/arrow_right.png | Bin 0 -> 2946 bytes
.../ios/WeblessPlugin.bundle/arrow_right@2x.png | Bin 0 -> 2946 bytes
.../ios/WeblessPlugin.bundle/but_refresh.png | Bin 0 -> 3369 bytes
.../ios/WeblessPlugin.bundle/but_refresh@2x.png | Bin 0 -> 3369 bytes
.../src/ios/WeblessPlugin.bundle/compass.png | Bin 0 -> 3035 bytes
.../src/ios/WeblessPlugin.bundle/compass@2x.png | Bin 0 -> 3035 bytes
.../src/ios/WeblessPluginCommand.h | 49 +
.../src/ios/WeblessPluginCommand.m | 86 +
.../src/ios/WeblessPluginViewController.h | 73 +
.../src/ios/WeblessPluginViewController.m | 239 +
.../src/ios/WeblessPluginViewController.xib | 875 ++
.../plugins/cordova.echo/.gitignore | 1 +
.../plugins/cordova.echo/plugin.xml | 24 +
.../cordova.echo/src/blackberry10/index.js | 85 +
.../src/blackberry10/native/device/echoJnext.so | Bin 0 -> 1291818 bytes
.../blackberry10/native/public/json/autolink.h | 19 +
.../blackberry10/native/public/json/config.h | 43 +
.../blackberry10/native/public/json/features.h | 42 +
.../blackberry10/native/public/json/forwards.h | 39 +
.../src/blackberry10/native/public/json/json.h | 10 +
.../blackberry10/native/public/json/reader.h | 196 +
.../src/blackberry10/native/public/json/value.h | 1069 +++
.../blackberry10/native/public/json/writer.h | 174 +
.../native/public/json_batchallocator.h | 125 +
.../native/public/json_internalarray.inl | 448 +
.../native/public/json_internalmap.inl | 607 ++
.../blackberry10/native/public/json_reader.cpp | 894 ++
.../blackberry10/native/public/json_value.cpp | 1726 ++++
.../native/public/json_valueiterator.inl | 292 +
.../blackberry10/native/public/json_writer.cpp | 829 ++
.../src/blackberry10/native/public/plugin.cpp | 320 +
.../src/blackberry10/native/public/plugin.h | 70 +
.../blackberry10/native/public/tokenizer.cpp | 222 +
.../src/blackberry10/native/public/tokenizer.h | 55 +
.../blackberry10/native/simulator/echoJnext.so | Bin 0 -> 231778 bytes
.../src/blackberry10/native/src/echo.cpp | 121 +
.../src/blackberry10/native/src/echo.hpp | 45 +
.../plugins/cordova.echo/www/client.js | 53 +
.../plugins/dependencies/A/plugin.xml | 60 +
.../plugins/dependencies/A/src/android/A.java | 0
.../dependencies/A/src/ios/APluginCommand.h | 0
.../dependencies/A/src/ios/APluginCommand.m | 0
.../plugins/dependencies/A/www/plugin-a.js | 0
.../plugins/dependencies/B/plugin.xml | 60 +
.../plugins/dependencies/B/src/android/B.java | 0
.../dependencies/B/src/ios/BPluginCommand.h | 0
.../dependencies/B/src/ios/BPluginCommand.m | 0
.../plugins/dependencies/B/www/plugin-b.js | 0
.../plugins/dependencies/C/plugin.xml | 57 +
.../plugins/dependencies/C/src/android/C.java | 0
.../dependencies/C/src/ios/CPluginCommand.h | 0
.../dependencies/C/src/ios/CPluginCommand.m | 0
.../plugins/dependencies/C/www/plugin-c.js | 0
.../plugins/dependencies/D/plugin.xml | 57 +
.../plugins/dependencies/D/src/android/D.java | 0
.../dependencies/D/src/ios/DPluginCommand.h | 0
.../dependencies/D/src/ios/DPluginCommand.m | 0
.../plugins/dependencies/D/www/plugin-d.js | 0
.../plugins/dependencies/E/plugin.xml | 59 +
.../plugins/dependencies/E/src/android/E.java | 0
.../dependencies/E/src/ios/EPluginCommand.h | 0
.../dependencies/E/src/ios/EPluginCommand.m | 0
.../plugins/dependencies/E/www/plugin-d.js | 0
.../plugins/dependencies/F/plugin.xml | 60 +
.../plugins/dependencies/F/src/android/F.java | 0
.../dependencies/F/src/ios/FPluginCommand.h | 0
.../dependencies/F/src/ios/FPluginCommand.m | 0
.../plugins/dependencies/F/www/plugin-f.js | 0
.../plugins/dependencies/G/plugin.xml | 59 +
.../plugins/dependencies/G/src/android/G.java | 0
.../dependencies/G/src/ios/EPluginCommand.m | 0
.../dependencies/G/src/ios/GPluginCommand.h | 0
.../plugins/dependencies/G/www/plugin-g.js | 0
.../plugins/dependencies/H/plugin.xml | 59 +
.../plugins/dependencies/H/src/android/H.java | 0
.../dependencies/H/src/ios/HPluginCommand.h | 0
.../dependencies/H/src/ios/HPluginCommand.m | 0
.../plugins/dependencies/H/www/plugin-h.js | 0
.../spec-plugman/plugins/dependencies/README.md | 10 +
.../plugins/dependencies/meta/D/plugin.xml | 61 +
.../dependencies/meta/D/src/android/D.java | 0
.../meta/D/src/ios/DPluginCommand.h | 0
.../meta/D/src/ios/DPluginCommand.m | 0
.../plugins/dependencies/meta/D/www/plugin-d.js | 0
.../dependencies/meta/subdir/E/plugin.xml | 57 +
.../meta/subdir/E/src/android/E.java | 0
.../meta/subdir/E/src/ios/EPluginCommand.h | 0
.../meta/subdir/E/src/ios/EPluginCommand.m | 0
.../dependencies/meta/subdir/E/www/plugin-e.js | 0
.../plugins/dependencies/subdir/E/plugin.xml | 57 +
.../dependencies/subdir/E/src/android/E.java | 0
.../subdir/E/src/ios/EPluginCommand.h | 0
.../subdir/E/src/ios/EPluginCommand.m | 0
.../dependencies/subdir/E/www/plugin-e.js | 0
.../plugins/multiple-children/plugin.xml | 108 +
.../plugins/shared-deps-multi-child/plugin.xml | 34 +
cordova-lib/spec-plugman/prepare.spec.js | 59 +
cordova-lib/spec-plugman/projects/.gitkeep | 0
.../android_install/AndroidManifest.xml | 20 +
.../android_install/cordova/android_sdk_version | 1 +
.../projects/android_install/cordova/version | 1 +
.../android_install/cordova/version.bat | 2 +
.../projects/android_one/AndroidManifest.xml | 71 +
.../projects/android_one/assets/www/.gitkeep | 0
.../projects/android_one/assets/www/cordova.js | 6848 +++++++++++++++
.../projects/android_one/cordova/appinfo.jar | Bin 0 -> 1574 bytes
.../projects/android_one/cordova/build | 23 +
.../projects/android_one/cordova/clean | 23 +
.../projects/android_one/cordova/lib/cordova | 386 +
.../android_one/cordova/lib/install-device | 23 +
.../android_one/cordova/lib/install-emulator | 23 +
.../android_one/cordova/lib/list-devices | 23 +
.../cordova/lib/list-emulator-images | 23 +
.../cordova/lib/list-started-emulators | 23 +
.../android_one/cordova/lib/start-emulator | 23 +
.../projects/android_one/cordova/log | 23 +
.../projects/android_one/cordova/run | 23 +
.../projects/android_one/cordova/version | 32 +
.../projects/android_one/res/xml/plugins.xml | 38 +
.../projects/android_one/src/.gitkeep | 0
.../projects/android_two/AndroidManifest.xml | 69 +
.../projects/android_two/assets/www/.gitkeep | 0
.../projects/android_two/res/xml/config.xml | 54 +
.../projects/android_two/src/.gitkeep | 0
.../android_two_no_perms/AndroidManifest.xml | 49 +
.../android_two_no_perms/assets/www/.gitkeep | 0
.../android_two_no_perms/res/xml/config.xml | 54 +
.../projects/android_two_no_perms/src/.gitkeep | 0
.../android_uninstall/AndroidManifest.xml | 20 +
.../projects/android_uninstall/cordova/version | 1 +
.../android_uninstall/cordova/version.bat | 2 +
.../blackberry10/native/device/chrome/.gitkeep | 0
.../native/device/plugins/jnext/auth.txt | 3 +
.../native/simulator/chrome/.gitkeep | 0
.../native/simulator/plugins/jnext/auth.txt | 3 +
.../projects/blackberry10/www/config.xml | 97 +
.../CordovaLib.xcodeproj/project.pbxproj | 636 ++
.../SampleApp.xcodeproj/project.orig.pbxproj | 498 ++
.../SampleApp.xcodeproj/project.pbxproj | 496 ++
.../SampleApp/SampleApp-Info.plist | 78 +
.../ios-config-xml/SampleApp/config.xml | 59 +
.../projects/ios-config-xml/www/.gitkeep | 0
.../CordovaLib.xcodeproj/project.pbxproj | 636 ++
.../SampleApp.xcodeproj/project.orig.pbxproj | 498 ++
.../SampleApp.xcodeproj/project.pbxproj | 498 ++
.../projects/ios-plist/SampleApp/PhoneGap.plist | 53 +
.../ios-plist/SampleApp/SampleApp-Info.plist | 80 +
.../projects/ios-plist/www/.gitkeep | 0
.../multiple-children/AndroidManifest.xml | 69 +
.../multiple-children/res/xml/plugins.xml | 38 +
.../spec-plugman/projects/tizen/www/config.xml | 2 +
.../windows8/CordovaApp_TemporaryKey.pfx | Bin 0 -> 2504 bytes
.../projects/windows8/TestApp.jsproj | 81 +
.../spec-plugman/projects/windows8/TestApp.sln | 46 +
.../projects/windows8/package.appxmanifest | 27 +
.../projects/windows8/www/cordova-2.6.0.js | 8075 ++++++++++++++++++
.../projects/windows8/www/css/index.css | 115 +
.../projects/windows8/www/img/logo.png | Bin 0 -> 11600 bytes
.../projects/windows8/www/img/smalllogo.png | Bin 0 -> 2831 bytes
.../projects/windows8/www/img/splashscreen.png | Bin 0 -> 24855 bytes
.../projects/windows8/www/img/storelogo.png | Bin 0 -> 4052 bytes
.../projects/windows8/www/index.html | 42 +
.../projects/windows8/www/js/index.js | 49 +
.../projects/wp7/CordovaAppProj.csproj | 76 +
.../projects/wp7/Properties/WMAppManifest.xml | 28 +
.../projects/wp8/CordovaAppProj.csproj | 136 +
.../projects/wp8/Properties/WMAppManifest.xml | 39 +
.../spec-plugman/projects/www-only/.gitkeep | 0
cordova-lib/spec-plugman/publish.spec.js | 11 +
.../spec-plugman/registry/registry.spec.js | 134 +
cordova-lib/spec-plugman/search.spec.js | 11 +
cordova-lib/spec-plugman/uninstall.spec.js | 289 +
cordova-lib/spec-plugman/unpublish.spec.js | 11 +
.../spec-plugman/util/action-stack.spec.js | 58 +
.../spec-plugman/util/config-changes.spec.js | 449 +
cordova-lib/spec-plugman/util/csproj.spec.js | 97 +
.../spec-plugman/util/dependencies.spec.js | 41 +
cordova-lib/spec-plugman/util/plugins.spec.js | 82 +
.../spec-plugman/util/xml-helpers.spec.js | 170 +
cordova-lib/spec-plugman/wrappers.spec.js | 40 +
cordova-lib/src/plugman/adduser.js | 5 +
cordova-lib/src/plugman/config.js | 5 +
cordova-lib/src/plugman/create.js | 81 +
cordova-lib/src/plugman/events.js | 2 +
cordova-lib/src/plugman/fetch.js | 175 +
cordova-lib/src/plugman/info.js | 6 +
cordova-lib/src/plugman/install.js | 629 ++
cordova-lib/src/plugman/owner.js | 6 +
cordova-lib/src/plugman/platform.js | 119 +
cordova-lib/src/plugman/platform_operation.js | 5 +
cordova-lib/src/plugman/platforms.js | 12 +
.../src/plugman/platforms/amazon-fireos.js | 88 +
cordova-lib/src/plugman/platforms/android.js | 89 +
.../src/plugman/platforms/blackberry10.js | 94 +
cordova-lib/src/plugman/platforms/common.js | 94 +
cordova-lib/src/plugman/platforms/firefoxos.js | 72 +
cordova-lib/src/plugman/platforms/ios.js | 216 +
cordova-lib/src/plugman/platforms/tizen.js | 72 +
cordova-lib/src/plugman/platforms/ubuntu.js | 124 +
cordova-lib/src/plugman/platforms/windows8.js | 134 +
cordova-lib/src/plugman/platforms/wp7.js | 91 +
cordova-lib/src/plugman/platforms/wp8.js | 113 +
cordova-lib/src/plugman/plugman.js | 207 +
cordova-lib/src/plugman/prepare.js | 232 +
cordova-lib/src/plugman/publish.js | 6 +
cordova-lib/src/plugman/registry/manifest.js | 95 +
cordova-lib/src/plugman/registry/registry.js | 290 +
cordova-lib/src/plugman/registry/whitelist.js | 21 +
cordova-lib/src/plugman/search.js | 5 +
cordova-lib/src/plugman/uninstall.js | 288 +
cordova-lib/src/plugman/unpublish.js | 5 +
cordova-lib/src/plugman/util/action-stack.js | 85 +
cordova-lib/src/plugman/util/config-changes.js | 812 ++
cordova-lib/src/plugman/util/csproj.js | 124 +
cordova-lib/src/plugman/util/default-engines.js | 36 +
cordova-lib/src/plugman/util/dependencies.js | 96 +
cordova-lib/src/plugman/util/metadata.js | 19 +
cordova-lib/src/plugman/util/plist-helpers.js | 88 +
cordova-lib/src/plugman/util/plugins.js | 100 +
.../src/plugman/util/search-and-replace.js | 37 +
cordova-lib/src/plugman/util/w8jsproj.js | 239 +
cordova-lib/src/plugman/util/xml-helpers.js | 196 +
cordova-lib/templates/base.js | 5 +
.../templates/platforms/android/android.xml | 12 +
.../templates/platforms/android/base.java | 32 +
cordova-lib/templates/platforms/ios/base.m | 28 +
cordova-lib/templates/platforms/ios/ios.xml | 9 +
doc/base.js | 5 -
doc/platforms/android/android.xml | 12 -
doc/platforms/android/base.java | 32 -
doc/platforms/ios/base.m | 28 -
doc/platforms/ios/ios.xml | 9 -
plugman.js | 207 -
spec/add_platform.spec.js | 64 -
spec/adduser.spec.js | 11 -
spec/common.js | 62 -
spec/config.spec.js | 12 -
spec/create.spec.js | 62 -
spec/fetch.spec.js | 211 -
spec/info.spec.js | 15 -
spec/install.spec.js | 472 -
spec/owner.spec.js | 12 -
spec/platform.spec.js | 26 -
spec/platforms/amazon-fireos.spec.js | 139 -
spec/platforms/android.spec.js | 156 -
spec/platforms/blackberry10.spec.js | 148 -
spec/platforms/common.spec.js | 130 -
spec/platforms/ios.spec.js | 390 -
spec/platforms/tizen.spec.js | 54 -
spec/platforms/windows8.spec.js | 135 -
spec/platforms/wp7.spec.js | 129 -
spec/platforms/wp8.spec.js | 150 -
spec/plugins/.gitkeep | 0
spec/plugins/AndroidJS/plugin.xml | 34 -
spec/plugins/AndroidJS/www/android.js | 1 -
spec/plugins/ChildBrowser/plugin.xml | 143 -
.../ChildBrowser/src/android/ChildBrowser.java | 19 -
.../src/ios/ChildBrowser.bundle/arrow_left.png | Bin 2946 -> 0 bytes
.../ios/ChildBrowser.bundle/arrow_left@2x.png | Bin 2946 -> 0 bytes
.../src/ios/ChildBrowser.bundle/arrow_right.png | Bin 2946 -> 0 bytes
.../ios/ChildBrowser.bundle/arrow_right@2x.png | Bin 2946 -> 0 bytes
.../src/ios/ChildBrowser.bundle/but_refresh.png | Bin 3369 -> 0 bytes
.../ios/ChildBrowser.bundle/but_refresh@2x.png | Bin 3369 -> 0 bytes
.../src/ios/ChildBrowser.bundle/compass.png | Bin 3035 -> 0 bytes
.../src/ios/ChildBrowser.bundle/compass@2x.png | Bin 3035 -> 0 bytes
.../ChildBrowser/src/ios/ChildBrowserCommand.h | 49 -
.../ChildBrowser/src/ios/ChildBrowserCommand.m | 86 -
.../src/ios/ChildBrowserViewController.h | 73 -
.../src/ios/ChildBrowserViewController.m | 239 -
.../src/ios/ChildBrowserViewController.xib | 875 --
.../ChildBrowser/src/ios/TargetDirTest.h | 20 -
.../ChildBrowser/src/ios/TargetDirTest.m | 1 -
.../src/ios/preserveDirs/PreserveDirsTest.h | 20 -
.../src/ios/preserveDirs/PreserveDirsTest.m | 1 -
spec/plugins/ChildBrowser/www/childbrowser.js | 19 -
.../ChildBrowser/www/childbrowser/image.jpg | 1 -
.../ChildBrowser/www/childbrowser_file.html | 1 -
spec/plugins/ConfigTestPlugin/plugin.xml | 37 -
spec/plugins/Contacts/plugin.xml | 143 -
.../Contacts/src/android/ContactAccessor.java | 198 -
.../src/android/ContactAccessorSdk5.java | 2183 -----
.../Contacts/src/android/ContactManager.java | 122 -
.../src/blackberry10/ContactActivity.js | 26 -
.../Contacts/src/blackberry10/ContactAddress.js | 30 -
.../Contacts/src/blackberry10/ContactError.js | 30 -
.../Contacts/src/blackberry10/ContactField.js | 27 -
.../src/blackberry10/ContactFindOptions.js | 50 -
.../Contacts/src/blackberry10/ContactName.js | 39 -
.../Contacts/src/blackberry10/ContactNews.js | 26 -
.../src/blackberry10/ContactOrganization.js | 22 -
.../Contacts/src/blackberry10/ContactPhoto.js | 23 -
.../Contacts/src/blackberry10/contactConsts.js | 225 -
.../Contacts/src/blackberry10/contactUtils.js | 223 -
spec/plugins/Contacts/src/blackberry10/index.js | 374 -
.../Contacts/src/blackberry10/plugin.xml | 41 -
spec/plugins/Contacts/src/ios/CDVContact.h | 136 -
spec/plugins/Contacts/src/ios/CDVContact.m | 1752 ----
spec/plugins/Contacts/src/ios/CDVContacts.h | 151 -
spec/plugins/Contacts/src/ios/CDVContacts.m | 593 --
spec/plugins/Contacts/src/wp/Contacts.cs | 664 --
spec/plugins/Contacts/www/Contact.js | 177 -
spec/plugins/Contacts/www/ContactAddress.js | 46 -
spec/plugins/Contacts/www/ContactError.js | 42 -
spec/plugins/Contacts/www/ContactField.js | 37 -
spec/plugins/Contacts/www/ContactFindOptions.js | 34 -
spec/plugins/Contacts/www/ContactName.js | 41 -
.../plugins/Contacts/www/ContactOrganization.js | 44 -
spec/plugins/Contacts/www/contacts.js | 76 -
spec/plugins/Contacts/www/ios/Contact.js | 51 -
spec/plugins/Contacts/www/ios/contacts.js | 62 -
spec/plugins/DummyPlugin/android-resource.xml | 1 -
spec/plugins/DummyPlugin/plugin.xml | 203 -
.../DummyPlugin/src/android/DummyPlugin.java | 19 -
.../plugins/DummyPlugin/src/android/TestLib.jar | 0
.../DummyPlugin/src/blackberry10/index.js | 19 -
.../src/ios/Custom.framework/someFheader.h | 0
.../src/ios/Custom.framework/somebinlib | 0
.../DummyPlugin/src/ios/DummyPlugin.bundle | 0
.../DummyPlugin/src/ios/DummyPluginCommand.h | 0
.../DummyPlugin/src/ios/DummyPluginCommand.m | 0
.../DummyPlugin/src/ios/SourceWithFramework.m | 0
.../plugins/DummyPlugin/src/ios/TargetDirTest.h | 0
.../plugins/DummyPlugin/src/ios/TargetDirTest.m | 0
.../DummyPlugin/src/ios/libsqlite3.dylib | 0
spec/plugins/DummyPlugin/src/tizen/dummer.js | 0
spec/plugins/DummyPlugin/src/windows8/dummer.js | 0
spec/plugins/DummyPlugin/src/wp7/DummyPlugin.cs | 19 -
spec/plugins/DummyPlugin/src/wp8/DummyPlugin.cs | 19 -
spec/plugins/DummyPlugin/www/dummyplugin.js | 19 -
.../DummyPlugin/www/dummyplugin/image.jpg | 1 -
spec/plugins/EnginePlugin/megaBoringVersion | 23 -
spec/plugins/EnginePlugin/megaFunVersion | 23 -
spec/plugins/EnginePlugin/plugin.xml | 33 -
spec/plugins/EnginePluginAndroid/plugin.xml | 32 -
spec/plugins/EnginePluginiOS/plugin.xml | 34 -
spec/plugins/FaultyPlugin/plugin.xml | 161 -
.../FaultyPlugin/src/android/FaultyPlugin.java | 19 -
.../FaultyPlugin/src/blackberry10/client.js | 0
.../plugins/FaultyPlugin/src/ios/FaultyPlugin.h | 49 -
.../plugins/FaultyPlugin/src/ios/FaultyPlugin.m | 86 -
.../FaultyPlugin/src/windows8/faultyPlugin.js | 0
.../FaultyPlugin/src/wp7/FaultyPlugin.cs | 19 -
.../FaultyPlugin/src/wp8/FaultyPlugin.cs | 19 -
spec/plugins/PluginsPlistOnly/plugin.xml | 31 -
spec/plugins/VariablePlugin/plugin.xml | 59 -
spec/plugins/WebNotifications/plugin.xml | 47 -
.../WebNotifications/src/ios/AppDelegate.m.diff | 18 -
.../WebNotifications/src/ios/WebNotifications.h | 35 -
.../WebNotifications/src/ios/WebNotifications.m | 124 -
.../WebNotifications/www/webnotifications.js | 123 -
spec/plugins/WeblessPlugin/plugin.xml | 83 -
.../src/android/WeblessPlugin.java | 19 -
.../src/ios/WeblessPlugin.bundle/arrow_left.png | Bin 2946 -> 0 bytes
.../ios/WeblessPlugin.bundle/arrow_left@2x.png | Bin 2946 -> 0 bytes
.../ios/WeblessPlugin.bundle/arrow_right.png | Bin 2946 -> 0 bytes
.../ios/WeblessPlugin.bundle/arrow_right@2x.png | Bin 2946 -> 0 bytes
.../ios/WeblessPlugin.bundle/but_refresh.png | Bin 3369 -> 0 bytes
.../ios/WeblessPlugin.bundle/but_refresh@2x.png | Bin 3369 -> 0 bytes
.../src/ios/WeblessPlugin.bundle/compass.png | Bin 3035 -> 0 bytes
.../src/ios/WeblessPlugin.bundle/compass@2x.png | Bin 3035 -> 0 bytes
.../src/ios/WeblessPluginCommand.h | 49 -
.../src/ios/WeblessPluginCommand.m | 86 -
.../src/ios/WeblessPluginViewController.h | 73 -
.../src/ios/WeblessPluginViewController.m | 239 -
.../src/ios/WeblessPluginViewController.xib | 875 --
spec/plugins/cordova.echo/.gitignore | 1 -
spec/plugins/cordova.echo/plugin.xml | 24 -
.../cordova.echo/src/blackberry10/index.js | 85 -
.../src/blackberry10/native/device/echoJnext.so | Bin 1291818 -> 0 bytes
.../blackberry10/native/public/json/autolink.h | 19 -
.../blackberry10/native/public/json/config.h | 43 -
.../blackberry10/native/public/json/features.h | 42 -
.../blackberry10/native/public/json/forwards.h | 39 -
.../src/blackberry10/native/public/json/json.h | 10 -
.../blackberry10/native/public/json/reader.h | 196 -
.../src/blackberry10/native/public/json/value.h | 1069 ---
.../blackberry10/native/public/json/writer.h | 174 -
.../native/public/json_batchallocator.h | 125 -
.../native/public/json_internalarray.inl | 448 -
.../native/public/json_internalmap.inl | 607 --
.../blackberry10/native/public/json_reader.cpp | 894 --
.../blackberry10/native/public/json_value.cpp | 1726 ----
.../native/public/json_valueiterator.inl | 292 -
.../blackberry10/native/public/json_writer.cpp | 829 --
.../src/blackberry10/native/public/plugin.cpp | 320 -
.../src/blackberry10/native/public/plugin.h | 70 -
.../blackberry10/native/public/tokenizer.cpp | 222 -
.../src/blackberry10/native/public/tokenizer.h | 55 -
.../blackberry10/native/simulator/echoJnext.so | Bin 231778 -> 0 bytes
.../src/blackberry10/native/src/echo.cpp | 121 -
.../src/blackberry10/native/src/echo.hpp | 45 -
spec/plugins/cordova.echo/www/client.js | 53 -
spec/plugins/dependencies/A/plugin.xml | 60 -
spec/plugins/dependencies/A/src/android/A.java | 0
.../dependencies/A/src/ios/APluginCommand.h | 0
.../dependencies/A/src/ios/APluginCommand.m | 0
spec/plugins/dependencies/A/www/plugin-a.js | 0
spec/plugins/dependencies/B/plugin.xml | 60 -
spec/plugins/dependencies/B/src/android/B.java | 0
.../dependencies/B/src/ios/BPluginCommand.h | 0
.../dependencies/B/src/ios/BPluginCommand.m | 0
spec/plugins/dependencies/B/www/plugin-b.js | 0
spec/plugins/dependencies/C/plugin.xml | 57 -
spec/plugins/dependencies/C/src/android/C.java | 0
.../dependencies/C/src/ios/CPluginCommand.h | 0
.../dependencies/C/src/ios/CPluginCommand.m | 0
spec/plugins/dependencies/C/www/plugin-c.js | 0
spec/plugins/dependencies/D/plugin.xml | 57 -
spec/plugins/dependencies/D/src/android/D.java | 0
.../dependencies/D/src/ios/DPluginCommand.h | 0
.../dependencies/D/src/ios/DPluginCommand.m | 0
spec/plugins/dependencies/D/www/plugin-d.js | 0
spec/plugins/dependencies/E/plugin.xml | 59 -
spec/plugins/dependencies/E/src/android/E.java | 0
.../dependencies/E/src/ios/EPluginCommand.h | 0
.../dependencies/E/src/ios/EPluginCommand.m | 0
spec/plugins/dependencies/E/www/plugin-d.js | 0
spec/plugins/dependencies/F/plugin.xml | 60 -
spec/plugins/dependencies/F/src/android/F.java | 0
.../dependencies/F/src/ios/FPluginCommand.h | 0
.../dependencies/F/src/ios/FPluginCommand.m | 0
spec/plugins/dependencies/F/www/plugin-f.js | 0
spec/plugins/dependencies/G/plugin.xml | 59 -
spec/plugins/dependencies/G/src/android/G.java | 0
.../dependencies/G/src/ios/EPluginCommand.m | 0
.../dependencies/G/src/ios/GPluginCommand.h | 0
spec/plugins/dependencies/G/www/plugin-g.js | 0
spec/plugins/dependencies/H/plugin.xml | 59 -
spec/plugins/dependencies/H/src/android/H.java | 0
.../dependencies/H/src/ios/HPluginCommand.h | 0
.../dependencies/H/src/ios/HPluginCommand.m | 0
spec/plugins/dependencies/H/www/plugin-h.js | 0
spec/plugins/dependencies/README.md | 10 -
spec/plugins/dependencies/meta/D/plugin.xml | 61 -
.../dependencies/meta/D/src/android/D.java | 0
.../meta/D/src/ios/DPluginCommand.h | 0
.../meta/D/src/ios/DPluginCommand.m | 0
.../plugins/dependencies/meta/D/www/plugin-d.js | 0
.../dependencies/meta/subdir/E/plugin.xml | 57 -
.../meta/subdir/E/src/android/E.java | 0
.../meta/subdir/E/src/ios/EPluginCommand.h | 0
.../meta/subdir/E/src/ios/EPluginCommand.m | 0
.../dependencies/meta/subdir/E/www/plugin-e.js | 0
spec/plugins/dependencies/subdir/E/plugin.xml | 57 -
.../dependencies/subdir/E/src/android/E.java | 0
.../subdir/E/src/ios/EPluginCommand.h | 0
.../subdir/E/src/ios/EPluginCommand.m | 0
.../dependencies/subdir/E/www/plugin-e.js | 0
spec/plugins/multiple-children/plugin.xml | 108 -
spec/plugins/shared-deps-multi-child/plugin.xml | 34 -
spec/prepare.spec.js | 59 -
spec/projects/.gitkeep | 0
.../android_install/AndroidManifest.xml | 20 -
.../android_install/cordova/android_sdk_version | 1 -
spec/projects/android_install/cordova/version | 1 -
.../android_install/cordova/version.bat | 2 -
spec/projects/android_one/AndroidManifest.xml | 71 -
spec/projects/android_one/assets/www/.gitkeep | 0
spec/projects/android_one/assets/www/cordova.js | 6848 ---------------
spec/projects/android_one/cordova/appinfo.jar | Bin 1574 -> 0 bytes
spec/projects/android_one/cordova/build | 23 -
spec/projects/android_one/cordova/clean | 23 -
spec/projects/android_one/cordova/lib/cordova | 386 -
.../android_one/cordova/lib/install-device | 23 -
.../android_one/cordova/lib/install-emulator | 23 -
.../android_one/cordova/lib/list-devices | 23 -
.../cordova/lib/list-emulator-images | 23 -
.../cordova/lib/list-started-emulators | 23 -
.../android_one/cordova/lib/start-emulator | 23 -
spec/projects/android_one/cordova/log | 23 -
spec/projects/android_one/cordova/run | 23 -
spec/projects/android_one/cordova/version | 32 -
spec/projects/android_one/res/xml/plugins.xml | 38 -
spec/projects/android_one/src/.gitkeep | 0
spec/projects/android_two/AndroidManifest.xml | 69 -
spec/projects/android_two/assets/www/.gitkeep | 0
spec/projects/android_two/res/xml/config.xml | 54 -
spec/projects/android_two/src/.gitkeep | 0
.../android_two_no_perms/AndroidManifest.xml | 49 -
.../android_two_no_perms/assets/www/.gitkeep | 0
.../android_two_no_perms/res/xml/config.xml | 54 -
spec/projects/android_two_no_perms/src/.gitkeep | 0
.../android_uninstall/AndroidManifest.xml | 20 -
spec/projects/android_uninstall/cordova/version | 1 -
.../android_uninstall/cordova/version.bat | 2 -
.../blackberry10/native/device/chrome/.gitkeep | 0
.../native/device/plugins/jnext/auth.txt | 3 -
.../native/simulator/chrome/.gitkeep | 0
.../native/simulator/plugins/jnext/auth.txt | 3 -
spec/projects/blackberry10/www/config.xml | 97 -
.../CordovaLib.xcodeproj/project.pbxproj | 636 --
.../SampleApp.xcodeproj/project.orig.pbxproj | 498 --
.../SampleApp.xcodeproj/project.pbxproj | 496 --
.../SampleApp/SampleApp-Info.plist | 78 -
.../ios-config-xml/SampleApp/config.xml | 59 -
spec/projects/ios-config-xml/www/.gitkeep | 0
.../CordovaLib.xcodeproj/project.pbxproj | 636 --
.../SampleApp.xcodeproj/project.orig.pbxproj | 498 --
.../SampleApp.xcodeproj/project.pbxproj | 498 --
.../projects/ios-plist/SampleApp/PhoneGap.plist | 53 -
.../ios-plist/SampleApp/SampleApp-Info.plist | 80 -
spec/projects/ios-plist/www/.gitkeep | 0
.../multiple-children/AndroidManifest.xml | 69 -
.../multiple-children/res/xml/plugins.xml | 38 -
spec/projects/tizen/www/config.xml | 2 -
.../windows8/CordovaApp_TemporaryKey.pfx | Bin 2504 -> 0 bytes
spec/projects/windows8/TestApp.jsproj | 81 -
spec/projects/windows8/TestApp.sln | 46 -
spec/projects/windows8/package.appxmanifest | 27 -
spec/projects/windows8/www/cordova-2.6.0.js | 8075 ------------------
spec/projects/windows8/www/css/index.css | 115 -
spec/projects/windows8/www/img/logo.png | Bin 11600 -> 0 bytes
spec/projects/windows8/www/img/smalllogo.png | Bin 2831 -> 0 bytes
spec/projects/windows8/www/img/splashscreen.png | Bin 24855 -> 0 bytes
spec/projects/windows8/www/img/storelogo.png | Bin 4052 -> 0 bytes
spec/projects/windows8/www/index.html | 42 -
spec/projects/windows8/www/js/index.js | 49 -
spec/projects/wp7/CordovaAppProj.csproj | 76 -
spec/projects/wp7/Properties/WMAppManifest.xml | 28 -
spec/projects/wp8/CordovaAppProj.csproj | 136 -
spec/projects/wp8/Properties/WMAppManifest.xml | 39 -
spec/projects/www-only/.gitkeep | 0
spec/publish.spec.js | 11 -
spec/registry/registry.spec.js | 134 -
spec/search.spec.js | 11 -
spec/uninstall.spec.js | 289 -
spec/unpublish.spec.js | 11 -
spec/util/action-stack.spec.js | 58 -
spec/util/config-changes.spec.js | 449 -
spec/util/csproj.spec.js | 97 -
spec/util/dependencies.spec.js | 41 -
spec/util/plugins.spec.js | 82 -
spec/util/xml-helpers.spec.js | 170 -
spec/wrappers.spec.js | 40 -
src/adduser.js | 5 -
src/config.js | 5 -
src/create.js | 81 -
src/events.js | 2 -
src/fetch.js | 175 -
src/info.js | 6 -
src/install.js | 629 --
src/owner.js | 6 -
src/platform.js | 119 -
src/platform_operation.js | 5 -
src/platforms.js | 12 -
src/platforms/amazon-fireos.js | 88 -
src/platforms/android.js | 89 -
src/platforms/blackberry10.js | 94 -
src/platforms/common.js | 94 -
src/platforms/firefoxos.js | 72 -
src/platforms/ios.js | 216 -
src/platforms/tizen.js | 72 -
src/platforms/ubuntu.js | 124 -
src/platforms/windows8.js | 134 -
src/platforms/wp7.js | 91 -
src/platforms/wp8.js | 113 -
src/prepare.js | 232 -
src/publish.js | 6 -
src/registry/manifest.js | 95 -
src/registry/registry.js | 290 -
src/registry/whitelist.js | 21 -
src/search.js | 5 -
src/uninstall.js | 288 -
src/unpublish.js | 5 -
src/util/action-stack.js | 85 -
src/util/config-changes.js | 812 --
src/util/csproj.js | 124 -
src/util/default-engines.js | 36 -
src/util/dependencies.js | 96 -
src/util/metadata.js | 19 -
src/util/plist-helpers.js | 88 -
src/util/plugins.js | 100 -
src/util/search-and-replace.js | 37 -
src/util/w8jsproj.js | 239 -
src/util/xml-helpers.js | 196 -
696 files changed, 49738 insertions(+), 49738 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/add_platform.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/add_platform.spec.js b/cordova-lib/spec-plugman/add_platform.spec.js
new file mode 100644
index 0000000..18bad02
--- /dev/null
+++ b/cordova-lib/spec-plugman/add_platform.spec.js
@@ -0,0 +1,64 @@
+var platform = require('../src/platform'),
+ Q = require('q'),
+ fs = require('fs'),
+ shell = require('shelljs'),
+ plugman = require('../plugman');
+
+describe( 'platform add/remove', function() {
+ it( 'should call platform add', function() {
+ var sPlatformA = spyOn( platform, 'add' ).andReturn(Q()),
+ sPlatformR = spyOn( platform, 'remove' ).andReturn(Q());
+ platform.add();
+ expect(sPlatformA).toHaveBeenCalled();
+ platform.remove();
+ expect(sPlatformR).toHaveBeenCalled();
+ });
+});
+
+
+describe( 'platform add', function() {
+ var done = false,
+ existsSync,
+ mkdir,
+ writeFileSync;
+ function platformPromise( f ) {
+ f.then( function() { done = true; }, function(err) { done = err; } );
+ }
+ beforeEach( function() {
+ existsSync = spyOn( fs, 'existsSync' ).andReturn( false );
+ done = false;
+ });
+ it( 'should error on non existing plugin.xml', function() {
+ runs(function() {
+ platformPromise( platform.add() );
+ });
+ waitsFor(function() { return done; }, 'platform promise never resolved', 500);
+ runs(function() {
+ expect(''+ done ).toContain( "can't find a plugin.xml. Are you in the plugin?" );
+ });
+ });
+});
+
+
+describe( 'platform remove', function() {
+ var done = false,
+ existsSync,
+ mkdir,
+ writeFileSync;
+ function platformPromise( f ) {
+ f.then( function() { done = true; }, function(err) { done = err; } );
+ }
+ beforeEach( function() {
+ existsSync = spyOn( fs, 'existsSync' ).andReturn( false );
+ done = false;
+ });
+ it( 'should error on non existing plugin.xml', function() {
+ runs(function() {
+ platformPromise( platform.remove() );
+ });
+ waitsFor(function() { return done; }, 'platform promise never resolved', 500);
+ runs(function() {
+ expect(''+ done ).toContain( "can't find a plugin.xml. Are you in the plugin?" );
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/adduser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/adduser.spec.js b/cordova-lib/spec-plugman/adduser.spec.js
new file mode 100644
index 0000000..48b1281
--- /dev/null
+++ b/cordova-lib/spec-plugman/adduser.spec.js
@@ -0,0 +1,11 @@
+var adduser = require('../src/adduser'),
+ Q = require('q'),
+ registry = require('../src/registry/registry');
+
+describe('adduser', function() {
+ it('should add a user', function() {
+ var sAddUser = spyOn(registry, 'adduser').andReturn(Q());
+ adduser();
+ expect(sAddUser).toHaveBeenCalled();
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/common.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/common.js b/cordova-lib/spec-plugman/common.js
new file mode 100644
index 0000000..b71efbf
--- /dev/null
+++ b/cordova-lib/spec-plugman/common.js
@@ -0,0 +1,62 @@
+
+var plugman = require('../plugman'),
+ nopt = require('nopt');
+
+var known_opts = {
+ 'verbose' : Boolean,
+ 'debug' : Number
+}, shortHands = { 'd' : ['--debug'] };
+
+var opt = nopt(known_opts, shortHands);
+var mapNames = {
+ 'verbose' : 7,
+ 'info' : 6,
+ 'notice' : 5,
+ 'warn' : 4,
+ 'error' : 3
+}
+
+if(opt.verbose)
+ opt.debug = 7;
+
+if(opt.debug) {
+ for(var i in mapNames) {
+ if(mapNames[i] <= opt.debug)
+ plugman.on(i, console.log);
+ }
+
+ if(opt.debug >= 6)
+ plugman.on('log', console.log);
+}
+
+module.exports = common = {
+ spy: {
+ getInstall: function(emitSpy){
+ return common.spy.startsWith(emitSpy, 'Install start');
+ },
+
+ getDeleted: function(emitSpy){
+ return common.spy.startsWith(emitSpy, 'Deleted');
+ },
+
+ startsWith: function(emitSpy, string)
+ {
+ var match = [], i;
+ for(i in emitSpy.argsForCall) {
+ if(emitSpy.argsForCall[i][1].substr(0, string.length) === string)
+ match.push(emitSpy.argsForCall[i][1]);
+ }
+ return match;
+ },
+
+ contains: function(emitSpy, string)
+ {
+ var match = [], i;
+ for(i in emitSpy.argsForCall) {
+ if(emitSpy.argsForCall[i][1].indexOf(string) >= 0)
+ match.push(emitSpy.argsForCall[i][1]);
+ }
+ return match;
+ }
+ }
+};
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/config.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/config.spec.js b/cordova-lib/spec-plugman/config.spec.js
new file mode 100644
index 0000000..65addbf
--- /dev/null
+++ b/cordova-lib/spec-plugman/config.spec.js
@@ -0,0 +1,12 @@
+var config = require('../src/config'),
+ Q = require('q'),
+ registry = require('../src/registry/registry');
+
+describe('config', function() {
+ it('should run config', function() {
+ var sConfig = spyOn(registry, 'config').andReturn(Q());
+ var params = ['set', 'registry', 'http://registry.cordova.io'];
+ config(params);
+ expect(sConfig).toHaveBeenCalledWith(params);
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/create.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/create.spec.js b/cordova-lib/spec-plugman/create.spec.js
new file mode 100644
index 0000000..afc034a
--- /dev/null
+++ b/cordova-lib/spec-plugman/create.spec.js
@@ -0,0 +1,62 @@
+var create = require('../src/create'),
+ Q = require('q'),
+ fs = require('fs'),
+ shell = require('shelljs'),
+ plugman = require('../plugman');
+
+describe( 'create', function() {
+ it( 'should call create', function() {
+ var sCreate = spyOn( plugman, 'create' ).andReturn(Q());
+ plugman.create();
+ expect(sCreate).toHaveBeenCalled();
+ });
+});
+
+describe( 'create plugin', function() {
+ var done = false,
+ existsSync,
+ mkdir,
+ writeFileSync;
+ function createPromise( f ) {
+ f.then( function() { done = true; }, function(err) { done = err; } );
+ }
+ beforeEach( function() {
+ existsSync = spyOn( fs, 'existsSync' ).andReturn( false );
+ mkdir = spyOn( shell, 'mkdir' ).andReturn( true );
+ writeFileSync = spyOn( fs, 'writeFileSync' );
+ done = false;
+ });
+
+ it( 'should be successful', function() {
+ runs(function() {
+ createPromise( create( 'name', 'org.plugin.id', '0.0.0', '.', [] ) );
+ });
+ waitsFor(function() { return done; }, 'create promise never resolved', 500);
+ runs(function() {
+ expect( done ).toBe( true );
+ expect( writeFileSync.calls.length ).toEqual( 2 );
+ });
+ });
+});
+
+describe( 'create plugin in existing plugin', function() {
+ var done = false,
+ existsSync;
+ function createPromise( f ) {
+ f.then( function() { done = true; }, function(err) { done = err; } );
+ }
+ beforeEach( function() {
+ existsSync = spyOn( fs, 'existsSync' ).andReturn( true );
+ done = false;
+ });
+
+ it( 'should fail due to an existing plugin.xml', function() {
+ runs(function() {
+ createPromise( create() );
+ });
+ waitsFor(function() { return done; }, 'create promise never resolved', 500);
+ runs(function() {
+ expect(''+ done ).toContain( 'Error: plugin.xml already exists. Are you already in a plugin?' );
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/fetch.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/fetch.spec.js b/cordova-lib/spec-plugman/fetch.spec.js
new file mode 100644
index 0000000..2a0b660
--- /dev/null
+++ b/cordova-lib/spec-plugman/fetch.spec.js
@@ -0,0 +1,211 @@
+var fetch = require('../src/fetch'),
+ fs = require('fs'),
+ os = require('osenv'),
+ path = require('path'),
+ shell = require('shelljs'),
+ xml_helpers = require('../src/util/xml-helpers'),
+ metadata = require('../src/util/metadata'),
+ temp = path.join(os.tmpdir(), 'plugman'),
+ test_plugin = path.join(__dirname, 'plugins', 'ChildBrowser'),
+ test_plugin_with_space = path.join(__dirname, 'folder with space', 'plugins', 'ChildBrowser'),
+ plugins = require('../src/util/plugins'),
+ Q = require('q'),
+ registry = require('../src/registry/registry');
+
+describe('fetch', function() {
+ function wrapper(p, done, post) {
+ p.then(post, function(err) {
+ expect(err).toBeUndefined();
+ }).fin(done);
+ }
+
+ describe('local plugins', function() {
+ var xml, rm, sym, mkdir, cp, save_metadata;
+ beforeEach(function() {
+ xml = spyOn(xml_helpers, 'parseElementtreeSync').andReturn({
+ getroot:function() { return {attrib:{id:'id'}};}
+ });
+ rm = spyOn(shell, 'rm');
+ sym = spyOn(fs, 'symlinkSync');
+ mkdir = spyOn(shell, 'mkdir');
+ cp = spyOn(shell, 'cp');
+ save_metadata = spyOn(metadata, 'save_fetch_metadata');
+ });
+
+ it('should copy locally-available plugin to plugins directory', function(done) {
+ wrapper(fetch(test_plugin, temp), done, function() {
+ expect(cp).toHaveBeenCalledWith('-R', path.join(test_plugin, '*'), path.join(temp, 'id'));
+ });
+ });
+ it('should copy locally-available plugin to plugins directory when spaces in path', function(done) {
+ //XXX: added this because plugman tries to fetch from registry when plugin folder does not exist
+ spyOn(fs,'existsSync').andReturn(true);
+ wrapper(fetch(test_plugin_with_space, temp), done, function() {
+ expect(cp).toHaveBeenCalledWith('-R', path.join(test_plugin_with_space, '*'), path.join(temp, 'id'));
+ });
+ });
+ it('should create a symlink if used with `link` param', function(done) {
+ wrapper(fetch(test_plugin, temp, { link: true }), done, function() {
+ expect(sym).toHaveBeenCalledWith(test_plugin, path.join(temp, 'id'), 'dir');
+ });
+ });
+ it('should fail when the expected ID doesn\'t match', function(done) {
+ fetch(test_plugin, temp, { expected_id: 'wrongID' })
+ .then(function() {
+ expect('this call').toBe('fail');
+ }, function(err) {
+ expect(''+err).toContain('Expected fetched plugin to have ID "wrongID" but got "id".');
+ }).fin(done);
+ });
+ it('should succeed when the expected ID is correct', function(done) {
+ wrapper(fetch(test_plugin, temp, { expected_id: 'id' }), done, function() {
+ expect(1).toBe(1);
+ });
+ });
+ });
+ describe('git plugins', function() {
+ var clone, save_metadata, done, xml;
+
+ function fetchPromise(f) {
+ f.then(function() { done = true; }, function(err) { done = err; });
+ }
+
+ beforeEach(function() {
+ clone = spyOn(plugins, 'clonePluginGitRepo').andReturn(Q('somedir'));
+ save_metadata = spyOn(metadata, 'save_fetch_metadata');
+ done = false;
+ xml = spyOn(xml_helpers, 'parseElementtreeSync').andReturn({
+ getroot:function() { return {attrib:{id:'id'}};}
+ });
+ });
+ it('should call clonePluginGitRepo for https:// and git:// based urls', function() {
+ var url = "https://github.com/bobeast/GAPlugin.git";
+ runs(function() {
+ fetchPromise(fetch(url, temp));
+ });
+ waitsFor(function() { return done; }, 'fetch promise never resolved', 250);
+ runs(function() {
+ expect(done).toBe(true);
+ expect(clone).toHaveBeenCalledWith(url, temp, '.', undefined);
+ expect(save_metadata).toHaveBeenCalledWith('somedir', jasmine.any(Object));
+ });
+ });
+ it('should call clonePluginGitRepo with subdir if applicable', function() {
+ var url = "https://github.com/bobeast/GAPlugin.git";
+ var dir = 'fakeSubDir';
+ runs(function() {
+ fetchPromise(fetch(url, temp, { subdir: dir }));
+ });
+ waitsFor(function() { return done; }, 'fetch promise never resolved', 250);
+ runs(function() {
+ expect(clone).toHaveBeenCalledWith(url, temp, dir, undefined);
+ expect(save_metadata).toHaveBeenCalledWith('somedir', jasmine.any(Object));
+ });
+ });
+ it('should call clonePluginGitRepo with subdir and git ref if applicable', function() {
+ var url = "https://github.com/bobeast/GAPlugin.git";
+ var dir = 'fakeSubDir';
+ var ref = 'fakeGitRef';
+ runs(function() {
+ fetchPromise(fetch(url, temp, { subdir: dir, git_ref: ref }));
+ });
+ waitsFor(function() { return done; }, 'fetch promise never resolved', 250);
+ runs(function() {
+ expect(clone).toHaveBeenCalledWith(url, temp, dir, ref);
+ expect(save_metadata).toHaveBeenCalledWith('somedir', jasmine.any(Object));
+ });
+ });
+ it('should extract the git ref from the URL hash, if provided', function() {
+ var url = "https://github.com/bobeast/GAPlugin.git#fakeGitRef";
+ var baseURL = "https://github.com/bobeast/GAPlugin.git";
+ runs(function() {
+ fetchPromise(fetch(url, temp, {}));
+ });
+ waitsFor(function() { return done; }, 'fetch promise never resolved', 250);
+ runs(function() {
+ expect(clone).toHaveBeenCalledWith(baseURL, temp, '.', 'fakeGitRef');
+ expect(save_metadata).toHaveBeenCalledWith('somedir', jasmine.any(Object));
+ });
+ });
+ it('should extract the subdir from the URL hash, if provided', function() {
+ var url = "https://github.com/bobeast/GAPlugin.git#:fakeSubDir";
+ var baseURL = "https://github.com/bobeast/GAPlugin.git";
+ runs(function() {
+ fetchPromise(fetch(url, temp, {}));
+ });
+ waitsFor(function() { return done; }, 'fetch promise never resolved', 250);
+ runs(function() {
+ expect(clone).toHaveBeenCalledWith(baseURL, temp, 'fakeSubDir', undefined);
+ expect(save_metadata).toHaveBeenCalledWith('somedir', jasmine.any(Object));
+ });
+ });
+ it('should extract the git ref and subdir from the URL hash, if provided', function() {
+ var url = "https://github.com/bobeast/GAPlugin.git#fakeGitRef:/fake/Sub/Dir/";
+ var baseURL = "https://github.com/bobeast/GAPlugin.git";
+ runs(function() {
+ fetchPromise(fetch(url, temp, {}));
+ });
+ waitsFor(function() { return done; }, 'fetch promise never resolved', 250);
+ runs(function() {
+ expect(clone).toHaveBeenCalledWith(baseURL, temp, 'fake/Sub/Dir', 'fakeGitRef');
+ expect(save_metadata).toHaveBeenCalledWith('somedir', jasmine.any(Object));
+ });
+ });
+ it('should throw if used with url and `link` param', function() {
+ runs(function() {
+ fetch("https://github.com/bobeast/GAPlugin.git", temp, {link:true}).then(null, function(err) { done = err; });
+ });
+ waitsFor(function() { return done; }, 'fetch promise never resolved', 250);
+ runs(function() {
+ expect(''+done).toContain('--link is not supported for git URLs');
+ });
+ });
+ it('should fail when the expected ID doesn\'t match', function(done) {
+ fetch('https://github.com/bobeast/GAPlugin.git', temp, { expected_id: 'wrongID' })
+ .then(function() {
+ expect('this call').toBe('fail');
+ }, function(err) {
+ expect(''+err).toContain('Expected fetched plugin to have ID "wrongID" but got "id".');
+ }).fin(done);
+ });
+ it('should succeed when the expected ID is correct', function(done) {
+ wrapper(fetch('https://github.com/bobeast/GAPlugin.git', temp, { expected_id: 'id' }), done, function() {
+ expect(1).toBe(1);
+ });
+ });
+ });
+ describe('registry plugins', function() {
+ var pluginId = 'dummyplugin', sFetch;
+ var xml, rm, sym, mkdir, cp, save_metadata;
+ beforeEach(function() {
+ xml = spyOn(xml_helpers, 'parseElementtreeSync').andReturn({
+ getroot:function() { return {attrib:{id:'id'}};}
+ });
+ rm = spyOn(shell, 'rm');
+ sym = spyOn(fs, 'symlinkSync');
+ mkdir = spyOn(shell, 'mkdir');
+ cp = spyOn(shell, 'cp');
+ save_metadata = spyOn(metadata, 'save_fetch_metadata');
+ sFetch = spyOn(registry, 'fetch').andReturn(Q('somedir'));
+ });
+
+ it('should get a plugin from registry and set the right client when argument is not a folder nor URL', function(done) {
+ wrapper(fetch(pluginId, temp, {client: 'plugman'}), done, function() {
+ expect(sFetch).toHaveBeenCalledWith([pluginId], 'plugman');
+ });
+ });
+ it('should fail when the expected ID doesn\'t match', function(done) {
+ fetch(pluginId, temp, { expected_id: 'wrongID' })
+ .then(function() {
+ expect('this call').toBe('fail');
+ }, function(err) {
+ expect(''+err).toContain('Expected fetched plugin to have ID "wrongID" but got "id".');
+ }).fin(done);
+ });
+ it('should succeed when the expected ID is correct', function(done) {
+ wrapper(fetch(pluginId, temp, { expected_id: 'id' }), done, function() {
+ expect(1).toBe(1);
+ });
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/info.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/info.spec.js b/cordova-lib/spec-plugman/info.spec.js
new file mode 100644
index 0000000..96256c7
--- /dev/null
+++ b/cordova-lib/spec-plugman/info.spec.js
@@ -0,0 +1,15 @@
+var search = require('../src/info'),
+ Q = require('q'),
+ registry = require('../src/registry/registry');
+
+describe('info', function() {
+ it('should show plugin info', function() {
+ var sSearch = spyOn(registry, 'info').andReturn(Q({
+ name: 'fakePlugin',
+ version: '1.0.0',
+ engines: [{ name: 'plugman', version: '>=0.11' }]
+ }));
+ search(new Array('myplugin'));
+ expect(sSearch).toHaveBeenCalledWith(['myplugin']);
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/install.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/install.spec.js b/cordova-lib/spec-plugman/install.spec.js
new file mode 100644
index 0000000..20a3d37
--- /dev/null
+++ b/cordova-lib/spec-plugman/install.spec.js
@@ -0,0 +1,472 @@
+var install = require('../src/install'),
+ actions = require('../src/util/action-stack'),
+ config_changes = require('../src/util/config-changes'),
+ xml_helpers = require('../src/util/xml-helpers'),
+ events = require('../src/events'),
+ plugman = require('../plugman'),
+ platforms = require('../src/platforms/common'),
+ common = require('./common'),
+ fs = require('fs'),
+ os = require('os'),
+ path = require('path'),
+ shell = require('shelljs'),
+ child_process = require('child_process'),
+ semver = require('semver'),
+ Q = require('q'),
+ spec = __dirname,
+ done = false,
+ srcProject = path.join(spec, 'projects', 'android_install'),
+ project = path.join(os.tmpdir(), 'plugman-test', 'android_install'),
+
+ plugins_dir = path.join(spec, 'plugins'),
+ plugins_install_dir = path.join(project, 'cordova', 'plugins'),
+ plugins = {
+ 'DummyPlugin' : path.join(plugins_dir, 'DummyPlugin'),
+ 'EnginePlugin' : path.join(plugins_dir, 'EnginePlugin'),
+ 'EnginePluginAndroid' : path.join(plugins_dir, 'EnginePluginAndroid'),
+ 'ChildBrowser' : path.join(plugins_dir, 'ChildBrowser'),
+ 'VariablePlugin' : path.join(plugins_dir, 'VariablePlugin'),
+ 'A' : path.join(plugins_dir, 'dependencies', 'A'),
+ 'B' : path.join(plugins_dir, 'dependencies', 'B'),
+ 'C' : path.join(plugins_dir, 'dependencies', 'C'),
+ 'F' : path.join(plugins_dir, 'dependencies', 'F'),
+ 'G' : path.join(plugins_dir, 'dependencies', 'G')
+ },
+ promise,
+ results = {},
+ dummy_id = 'com.phonegap.plugins.dummyplugin';
+
+function installPromise(f) {
+ f.then(function(res) { done = true; }, function(err) { done = err; });
+}
+
+var existsSync = fs.existsSync;
+
+// Mocked functions for tests
+var fake = {
+ 'existsSync' : {
+ 'noPlugins' : function(path){
+ // fake installed plugin directories as 'not found'
+ if( path.slice(-5) !== '.json' && path.indexOf(plugins_install_dir) >= 0) {
+ return false;
+ }
+
+ return existsSync(path);
+ }
+ },
+ 'fetch' : {
+ 'dependencies' : function(id, dir) {
+ if(id == plugins['A'])
+ return Q(id); // full path to plugin
+
+ return Q( path.join(plugins_dir, 'dependencies', id) );
+ }
+ }
+}
+
+describe('start', function() {
+ var prepare, config_queue_add, proc, actions_push, ca, emit;
+
+ beforeEach(function() {
+ prepare = spyOn(plugman, 'prepare');
+ config_queue_add = spyOn(config_changes, 'add_installed_plugin_to_prepare_queue');
+ proc = spyOn(actions.prototype, 'process').andReturn( Q(true) );
+ actions_push = spyOn(actions.prototype, 'push');
+ ca = spyOn(actions.prototype, 'createAction');
+ });
+ it('start', function() {
+ shell.rm('-rf', project);
+ shell.cp('-R', path.join(srcProject, '*'), project);
+
+ done = false;
+ promise = Q()
+ .then(
+ function(){ return install('android', project, plugins['DummyPlugin']) }
+ ).then(
+ function(){
+ results['actions_callCount'] = actions_push.callCount;
+ results['actions_create'] = ca.argsForCall[0];
+ results['config_add'] = config_queue_add.argsForCall[0];
+
+ return Q();
+ }
+ ).then(
+ function(){ return install('android', project, plugins['EnginePlugin']) }
+ ).then(
+ function(){
+ emit = spyOn(events, 'emit');
+ return install('android', project, plugins['ChildBrowser'])
+ }
+ ).then(
+ function(){
+ return install('android', project, plugins['VariablePlugin'], plugins_install_dir, { cli_variables:{API_KEY:'batman'} })
+ }
+ ).then(
+ function(){
+ done = true;
+ results['prepareCount'] = prepare.callCount;
+ results['emit_results'] = [];
+
+ for(var i in emit.calls) {
+ if(emit.calls[i].args[0] === 'results')
+ results['emit_results'].push(emit.calls[i].args[1]);
+ }
+
+ events.emit("verbose", "***** DONE START *****");
+ }
+ );
+ waitsFor(function() { return done; }, 'promise never resolved', 500);
+ });
+});
+
+describe('install', function() {
+ var chmod, exec, proc, add_to_queue, prepare, actions_push, c_a, mkdir, cp, rm, fetchSpy, emit;
+
+ beforeEach(function() {
+ prepare = spyOn(plugman, 'prepare').andReturn( Q(true) );
+
+ exec = spyOn(child_process, 'exec').andCallFake(function(cmd, cb) {
+ cb(false, '', '');
+ });
+ spyOn(fs, 'mkdirSync').andReturn(true);
+ spyOn(shell, 'mkdir').andReturn(true);
+ spyOn(platforms, 'copyFile').andReturn(true);
+
+ fetchSpy = spyOn(plugman.raw, 'fetch').andReturn( Q( plugins['EnginePlugin'] ) );
+ chmod = spyOn(fs, 'chmodSync').andReturn(true);
+ fsWrite = spyOn(fs, 'writeFileSync').andReturn(true);
+ cp = spyOn(shell, 'cp').andReturn(true);
+ rm = spyOn(shell, 'rm').andReturn(true);
+ add_to_queue = spyOn(config_changes, 'add_installed_plugin_to_prepare_queue');
+ done = false;
+ });
+
+ describe('success', function() {
+ it('should call prepare after a successful install', function() {
+ expect(results['prepareCount']).toBe(4);
+ });
+
+ it('should emit a results event with platform-agnostic <info>', function() {
+ // ChildBrowser
+ expect(results['emit_results'][0]).toBe('No matter what platform you are installing to, this notice is very important.');
+ });
+ it('should emit a results event with platform-specific <info>', function() {
+ // ChildBrowser
+ expect(results['emit_results'][1]).toBe('Please make sure you read this because it is very important to complete the installation of your plugin.');
+ });
+ it('should interpolate variables into <info> tags', function() {
+ // VariableBrowser
+ expect(results['emit_results'][2]).toBe('Remember that your api key is batman!');
+ });
+
+ it('should call fetch if provided plugin cannot be resolved locally', function() {
+ fetchSpy.andReturn( Q( plugins['DummyPlugin'] ) );
+ spyOn(fs, 'existsSync').andCallFake( fake['existsSync']['noPlugins'] );
+
+ runs(function() {
+ installPromise(install('android', project, 'CLEANYOURSHORTS' ));
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(done).toBe(true);
+ expect(fetchSpy).toHaveBeenCalled();
+ });
+ });
+
+ it('should call the config-changes module\'s add_installed_plugin_to_prepare_queue method after processing an install', function() {
+ expect(results['config_add']).toEqual([plugins_install_dir, dummy_id, 'android', {}, true]);
+ });
+ it('should queue up actions as appropriate for that plugin and call process on the action stack',
+ function() {
+ expect(results['actions_callCount']).toEqual(3);
+ expect(results['actions_create']).toEqual([jasmine.any(Function), [jasmine.any(Object), path.join(plugins_install_dir, dummy_id), project, dummy_id], jasmine.any(Function), [jasmine.any(Object), project, dummy_id]]);
+ });
+
+ it('should check version if plugin has engine tag', function(){
+ var satisfies = spyOn(semver, 'satisfies').andReturn(true);
+ exec.andCallFake(function(cmd, cb) {
+ cb(null, '2.5.0\n');
+ });
+
+ runs(function() {
+ installPromise( install('android', project, plugins['EnginePlugin']) );
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(satisfies).toHaveBeenCalledWith('2.5.0','>=2.3.0');
+ });
+ });
+ it('should check version and munge it a little if it has "rc" in it so it plays nice with semver (introduce a dash in it)', function() {
+ var satisfies = spyOn(semver, 'satisfies').andReturn(true);
+ exec.andCallFake(function(cmd, cb) {
+ cb(null, '3.0.0rc1\n');
+ });
+
+ runs(function() {
+ installPromise( install('android', project, plugins['EnginePlugin']) );
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(satisfies).toHaveBeenCalledWith('3.0.0-rc1','>=2.3.0');
+ });
+ });
+ it('should check specific platform version over cordova version if specified', function() {
+ var spy = spyOn(semver, 'satisfies').andReturn(true);
+ exec.andCallFake(function(cmd, cb) {
+ cb(null, '3.1.0\n');
+ });
+ fetchSpy.andReturn( Q( plugins['EnginePluginAndroid'] ) );
+
+ runs(function() {
+ installPromise( install('android', project, plugins['EnginePluginAndroid']) );
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(spy).toHaveBeenCalledWith('3.1.0','>=3.1.0');
+ });
+ });
+ it('should check platform sdk version if specified', function() {
+ var spy = spyOn(semver, 'satisfies').andReturn(true);
+ fetchSpy.andReturn( Q( plugins['EnginePluginAndroid'] ) );
+ exec.andCallFake(function(cmd, cb) {
+ cb(null, '18\n');
+ });
+
+ runs(function() {
+ installPromise( install('android', project, 'EnginePluginAndroid') );
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ // <engine name="cordova" VERSION=">=3.0.0"/>
+ // <engine name="cordova-android" VERSION=">=3.1.0"/>
+ // <engine name="android-sdk" VERSION=">=18"/>
+
+ expect(spy.calls.length).toBe(3);
+ expect(spy.calls[0].args).toEqual([ '18.0.0', '>=3.0.0' ]);
+ expect(spy.calls[1].args).toEqual([ '18.0.0', '>=3.1.0' ]);
+ expect(spy.calls[2].args).toEqual([ '18.0.0','>=18' ]);
+ });
+ });
+ it('should check engine versions', function() {
+ var spy = spyOn(semver, 'satisfies').andReturn(true);
+ fetchSpy.andReturn( Q( plugins['EnginePlugin'] ) );
+
+ runs(function() {
+ installPromise( install('android', project, plugins['EnginePlugin']) );
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ // <engine name="cordova" version=">=2.3.0"/>
+ // <engine name="cordova-plugman" version=">=0.10.0" />
+ // <engine name="mega-fun-plugin" version=">=1.0.0" scriptSrc="megaFunVersion" platform="*" />
+ // <engine name="mega-boring-plugin" version=">=3.0.0" scriptSrc="megaBoringVersion" platform="ios|android" />
+
+ var plugmanVersion = require('../package.json').version;
+
+ expect(spy.calls.length).toBe(4);
+ expect(spy.calls[0].args).toEqual([ '', '>=2.3.0' ]);
+ expect(spy.calls[1].args).toEqual([ plugmanVersion, '>=0.10.0' ]);
+ expect(spy.calls[2].args).toEqual([ '', '>=1.0.0' ]);
+ expect(spy.calls[3].args).toEqual([ '', '>=3.0.0' ]);
+ });
+ });
+ it('should not check custom engine version that is not supported for platform', function() {
+ var spy = spyOn(semver, 'satisfies').andReturn(true);
+ runs(function() {
+ installPromise( install('blackberry10', project, plugins['EnginePlugin']) );
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(spy).not.toHaveBeenCalledWith('','>=3.0.0');
+ });
+ });
+
+ describe('with dependencies', function() {
+ var emit;
+ beforeEach(function() {
+ spyOn(fs, 'existsSync').andCallFake( fake['existsSync']['noPlugins'] );
+ fetchSpy.andCallFake( fake['fetch']['dependencies'] );
+ emit = spyOn(events, 'emit');
+ exec.andCallFake(function(cmd, cb) {
+ cb(null, '9.0.0\n');
+ });
+ });
+
+ it('should install any dependent plugins if missing', function() {
+ runs(function() {
+ installPromise( install('android', project, plugins['A']) );
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ // Look for 'Installing plugin ...' in events
+ var install = common.spy.getInstall(emit);
+
+ expect(install).toEqual([
+ 'Install start for "C" on android.',
+ 'Install start for "D" on android.',
+ 'Install start for "A" on android.'
+ ]);
+ });
+ });
+
+ it('should install any dependent plugins from registry when url is not defined', function() {
+ // Plugin A depends on C & D
+ runs(function() {
+ installPromise( install('android', project, plugins['A']) );
+ });
+ waitsFor(function() { return done; }, 'promise never resolved', 200);
+ runs(function() {
+ // TODO: this is same test as above? Need test other dependency with url=?
+ var install = common.spy.getInstall(emit);
+
+ expect(install).toEqual([
+ 'Install start for "C" on android.',
+ 'Install start for "D" on android.',
+ 'Install start for "A" on android.'
+ ]);;
+ });
+ });
+
+ it('should process all dependent plugins with alternate routes to the same plugin', function() {
+ // Plugin F depends on A, C, D and E
+ runs(function () {
+ installPromise(install('android', project, plugins['F']));
+ });
+ waitsFor(function () { return done; }, 'install promise never resolved', 200);
+ runs(function () {
+ var install = common.spy.getInstall(emit);
+
+ expect(install).toEqual([
+ 'Install start for "C" on android.',
+ 'Install start for "D" on android.',
+ 'Install start for "A" on android.',
+ 'Install start for "D" on android.',
+ 'Install start for "F" on android.'
+ ]);
+ });
+ });
+
+ it('should throw if there is a cyclic dependency', function() {
+ runs(function () {
+ installPromise( install('android', project, plugins['G']) );
+ });
+ waitsFor(function () { return done; }, 'install promise never resolved', 200);
+ runs(function () {
+ var install = common.spy.getInstall(emit);
+
+ expect(done.message).toEqual('Cyclic dependency from G to H');
+ });
+ });
+
+ it('install subdir relative to top level plugin if no fetch meta', function() {
+ runs(function () {
+ installPromise(install('android', project, plugins['B']));
+ });
+ waitsFor(function () { return done; }, 'install promise never resolved', 200);
+ runs(function () {
+ var install = common.spy.getInstall(emit);
+
+ expect(install).toEqual([
+ 'Install start for "D" on android.',
+ 'Install start for "E" on android.',
+ 'Install start for "B" on android.'
+ ]);
+ });
+ });
+
+ it('install uses meta data (if available) of top level plugin source', function() {
+ // Fake metadata so plugin 'B' appears from 'meta/B'
+ var meta = require('../src/util/metadata');
+ spyOn(meta, 'get_fetch_metadata').andCallFake(function(){
+ return {
+ source: {type: 'dir', url: path.join(plugins['B'], '..', 'meta')}
+ };
+ });
+
+ runs(function () {
+ installPromise(install('android', project, plugins['B']));
+ });
+ waitsFor(function () { return done; }, 'install promise never resolved', 200);
+ runs(function () {
+ var install = common.spy.getInstall(emit);
+
+ expect(install).toEqual([
+ 'Install start for "D" on android.',
+ 'Install start for "E" on android.',
+ 'Install start for "B" on android.'
+ ]);
+
+ var copy = common.spy.startsWith(emit, "Copying from");
+ expect(copy.length).toBe(3);
+ expect(copy[0].indexOf(path.normalize('meta/D')) > 0).toBe(true);
+ expect(copy[1].indexOf(path.normalize('meta/subdir/E')) > 0).toBe(true);
+ });
+ });
+ });
+
+ });
+
+ xdescribe('failure', function() {
+ it('should throw if platform is unrecognized', function() {
+ runs(function() {
+ installPromise( install('atari', project, 'SomePlugin') );
+ });
+ waitsFor(function() { return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(''+done).toContain('atari not supported.');
+ });
+ });
+ it('should throw if variables are missing', function() {
+ runs(function() {
+ installPromise( install('android', project, plugins['VariablePlugin']) );
+ });
+ waitsFor(function(){ return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(''+done).toContain('Variable(s) missing: API_KEY');
+ });
+ });
+ it('should throw if git is not found on the path and a remote url is requested', function() {
+ spyOn(fs, 'existsSync').andCallFake( fake['existsSync']['noPlugins'] );
+ var which_spy = spyOn(shell, 'which').andReturn(null);
+ runs(function() {
+ installPromise( install('android', project, 'https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git') );
+ });
+ waitsFor(function(){ return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(''+done).toContain('"git" command line tool is not installed: make sure it is accessible on your PATH.');
+ });
+ });
+ it('should throw if plugin version is less than the minimum requirement', function(){
+ var spy = spyOn(semver, 'satisfies').andReturn(false);
+ exec.andCallFake(function(cmd, cb) {
+ cb(null, '0.0.1\n');
+ });
+ runs(function() {
+ installPromise( install('android', project, plugins['EnginePlugin']) );
+ });
+ waitsFor(function(){ return done; }, 'install promise never resolved', 200);
+ runs(function() {
+ expect(''+done).toContain('Plugin doesn\'t support this project\'s cordova version. cordova: 0.0.1, failed version requirement: >=2.3.0');
+ });
+ });
+ });
+
+});
+
+
+describe('end', function() {
+
+ it('end', function() {
+ done = false;
+
+ promise.fin(function(err){
+ if(err)
+ events.emit('error', err);
+
+ shell.rm('-rf', project);
+ done = true;
+ });
+
+ waitsFor(function() { return done; }, 'promise never resolved', 500);
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/owner.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/owner.spec.js b/cordova-lib/spec-plugman/owner.spec.js
new file mode 100644
index 0000000..1c6bd2c
--- /dev/null
+++ b/cordova-lib/spec-plugman/owner.spec.js
@@ -0,0 +1,12 @@
+var owner = require('../src/owner'),
+ Q = require('q'),
+ registry = require('../src/registry/registry');
+
+describe('owner', function() {
+ it('should run owner', function() {
+ var sOwner = spyOn(registry, 'owner').andReturn(Q());
+ var params = ['add', 'anis', 'com.phonegap.plugins.dummyplugin'];
+ owner(params);
+ expect(sOwner).toHaveBeenCalledWith(params);
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0318d8cd/cordova-lib/spec-plugman/platform.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platform.spec.js b/cordova-lib/spec-plugman/platform.spec.js
new file mode 100644
index 0000000..4f8099c
--- /dev/null
+++ b/cordova-lib/spec-plugman/platform.spec.js
@@ -0,0 +1,26 @@
+var platforms = require('../src/platforms')
+var pluginTags = ["source-file", "header-file", "lib-file", "resource-file", "framework"];
+
+function getTest(platformId, pluginTag) {
+ return function() {
+ it('should exist', function() {
+ expect(platforms[platformId][pluginTag] ).toBeDefined();
+ });
+ it('with an install method', function() {
+ expect(platforms[platformId][pluginTag].install ).toBeDefined();
+ });
+ it('with an uninstall method', function() {
+ expect(platforms[platformId][pluginTag].uninstall ).toBeDefined();
+ });
+ }
+}
+
+for(var platformId in platforms) {
+ for(var index = 0, len = pluginTags.length; index < len; index++) {
+ var funk = getTest(platformId,pluginTags[index]);
+ describe(platformId + " should have a " + pluginTags[index] + " object", funk);
+ }
+
+}
+
+