Merge branch 'master' into plugman-registry
Conflicts:
src/fetch.js
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/2cbb6825
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/2cbb6825
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/2cbb6825
Branch: refs/heads/master
Commit: 2cbb68250bdb8d84b7e7320614611f8e5175a417
Parents: e778e8a 4cf0243
Author: Anis Kadri <[email protected]>
Authored: Wed Jul 24 15:39:35 2013 -0700
Committer: Anis Kadri <[email protected]>
Committed: Wed Jul 24 15:39:35 2013 -0700
----------------------------------------------------------------------
.gitignore | 2 +
README.md | 4 +
package.json | 4 +-
spec/fetch.spec.js | 5 +
spec/install.spec.js | 18 +-
spec/integration.spec.js | 85 +
spec/platforms/wp7.spec.js | 6 +-
spec/platforms/wp8.spec.js | 6 +-
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/dependencies/B/plugin.xml | 8 +-
spec/plugins/dependencies/E/plugin.xml | 57 -
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-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
.../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/wp7/CordovaAppProj.csproj | 176 +-
spec/projects/wp8/An_App.csproj | 201 --
spec/projects/wp8/CordovaAppProj.csproj | 136 ++
spec/util/csproj.spec.js | 13 +-
src/fetch.js | 4 +-
src/install.js | 20 +-
src/platforms/wp7.js | 2 +-
src/platforms/wp8.js | 2 +-
src/prepare.js | 2 +-
src/util/action-stack.js | 4 +-
src/util/csproj.js | 13 +-
src/util/plugins.js | 2 +-
67 files changed, 8122 insertions(+), 399 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/2cbb6825/README.md
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/2cbb6825/package.json
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/2cbb6825/src/fetch.js
----------------------------------------------------------------------
diff --cc src/fetch.js
index d5e3e8c,e2b3d71..8f76bb5
--- a/src/fetch.js
+++ b/src/fetch.js
@@@ -47,53 -46,34 +47,55 @@@ module.exports = function fetchPlugin(p
// Copy from the local filesystem.
// First, read the plugin.xml and grab the ID.
- plugin_dir = path.join(uri.href, options.subdir);
+ // NOTE: Can't use uri.href here as it will convert spaces to %20 and
make path invalid.
+ // Use original plugin_dir value instead.
+ plugin_dir = path.join(plugin_dir, options.subdir);
- var plugin_xml_path = path.join(plugin_dir, 'plugin.xml');
- require('../plugman').emit('log', 'Fetch is reading plugin.xml from
location "' + plugin_xml_path + '"...');
- var xml = xml_helpers.parseElementtreeSync(plugin_xml_path);
- var plugin_id = xml.getroot().attrib.id;
- var dest = path.join(plugins_dir, plugin_id);
+ var movePlugin = function(plugin_dir, linkable) {
+ var plugin_xml_path = path.join(plugin_dir, 'plugin.xml');
+ require('../plugman').emit('log', 'Fetch is reading plugin.xml
from location "' + plugin_xml_path + '"...');
+ var xml = xml_helpers.parseElementtreeSync(plugin_xml_path);
+ var plugin_id = xml.getroot().attrib.id;
- shell.rm('-rf', dest);
- if (options.link) {
- require('../plugman').emit('log', 'Symlinking from location "' +
plugin_dir + '" to location "' + dest + '"');
- fs.symlinkSync(plugin_dir, dest, 'dir');
- } else {
- shell.mkdir('-p', dest);
- require('../plugman').emit('log', 'Copying from location "' +
plugin_dir + '" to location "' + dest + '"');
- shell.cp('-R', path.join(plugin_dir, '*'), dest);
- }
+ var dest = path.join(plugins_dir, plugin_id);
- var data = {
- source: {
- type: 'local',
- path: plugin_dir
+ shell.rm('-rf', dest);
+ if (options.link && linkable) {
+ require('../plugman').emit('log', 'Symlinking from location
"' + plugin_dir + '" to location "' + dest + '"');
+ fs.symlinkSync(plugin_dir, dest, 'dir');
+ } else {
+ shell.mkdir('-p', dest);
+ require('../plugman').emit('log', 'Copying from location "' +
plugin_dir + '" to location "' + dest + '"');
+ shell.cp('-R', path.join(plugin_dir, '*') , dest);
}
+
+ var data = {
+ source: {
+ type: 'local',
+ path: plugin_dir
+ }
+ };
+ metadata.save_fetch_metadata(dest, data);
+
+ if (callback) callback(null, dest);
};
- metadata.save_fetch_metadata(dest, data);
- if (callback) callback(null, dest);
+
+ if(!fs.existsSync(plugin_dir)) {
+ registry.use(require('../plugman').config.registry, function() {
+ registry.fetch([plugin_dir], function(err, plugin_dir) {
+ if (err) {
+ if(callback) {
+ return callback(err);
+ } else {
+ throw err;
+ }
+ }
+ movePlugin(plugin_dir, false);
+ });
+ })
+ } else {
+ movePlugin(plugin_dir, true);
+ }
}
};