You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2013/07/11 22:29:08 UTC
[01/22] git commit: Support for adding UI elements to windows phone
plugins
Updated Branches:
refs/heads/plugman-registry bf9751330 -> c9a42d689
Support for adding UI elements to windows phone plugins
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/e3043a68
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/e3043a68
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/e3043a68
Branch: refs/heads/plugman-registry
Commit: e3043a68506ea1ac66b87ace7561f449aff330a5
Parents: f99d0f4
Author: Benn Mapes <be...@gmail.com>
Authored: Mon Jun 10 17:06:35 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Mon Jun 10 17:06:35 2013 -0700
----------------------------------------------------------------------
src/util/csproj.js | 55 +++++++++++++++++++++++++++++++++++++++----------
1 file changed, 44 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e3043a68/src/util/csproj.js
----------------------------------------------------------------------
diff --git a/src/util/csproj.js b/src/util/csproj.js
index 12ed5db..34be9a5 100644
--- a/src/util/csproj.js
+++ b/src/util/csproj.js
@@ -14,22 +14,55 @@ csproj.prototype = {
},
addSourceFile:function(relative_path) {
relative_path = relative_path.split('/').join('\\');
+ // make ItemGroup to hold file.
var item = new et.Element('ItemGroup');
- var compile = new et.Element('Compile');
- compile.attrib.Include = relative_path;
- item.append(compile);
+ // check if it's a .xaml page
+ if(relative_path.indexOf('.xaml', relative_path.length - 5) > -1) {
+ var page = new et.Element('Page');
+ page.attrib.Include = relative_path;
+ var gen = new et.Element('Generator');
+ gen.text = "MSBuild:Compile";
+ page.append(gen);
+ var sub_type = new et.Element('SubType');
+ sub_type.text = "Designer";
+ page.append(sub_type);
+ item.append(page);
+ }
+ // check if it's a .xaml.cs page that would depend on a .xaml of the same name
+ else if (relative_path.indexOf('.xaml.cs', relative_path.length - 8) > -1) {
+ var compile = new et.Element('Compile');
+ compile.attrib.Include = relative_path;
+ var dep = new et.Element('DependentUpon');
+ var parts = relative_path.split('\\');
+ var xaml_file = parts[parts.length - 1].substr(0, parts[parts.length - 1].length - 3);
+ dep.text = xaml_file;
+ compile.append(dep);
+ item.append(compile);
+ }
+ // otherwise add it normally
+ else {
+ var compile = new et.Element('Compile');
+ compile.attrib.Include = relative_path;
+ item.append(compile);
+ }
this.xml.getroot().append(item);
},
removeSourceFile:function(relative_path) {
relative_path = relative_path.split('/').join('\\');
- var groups = this.xml.findall('ItemGroup');
- for (var i = 0, l = groups.length; i < l; i++) {
- var group = groups[i];
- var compiles = group.findall('Compile');
- for (var j = 0, k = compiles.length; j < k; j++) {
- var compile = compiles[j];
- if (compile.attrib.Include == relative_path) {
- group.remove(0, compile);
+ var item_groups = this.xml.findall('ItemGroup');
+ for (var i = 0, l = item_groups.length; i < l; i++) {
+ var group = item_groups[i];
+ var files = group.findall('Compile').concat(group.findall('Page'));
+ for (var j = 0, k = files.length; j < k; j++) {
+ var file = files[j];
+ if (file.attrib.Include == relative_path) {
+ // remove file reference
+ group.remove(0, file);
+ // remove ItemGroup if empty
+ var new_group = group.findall('Compile').concat(group.findall('Page'));
+ if(new_group.length < 1) {
+ this.xml.getroot().remove(0, group);
+ }
return true;
}
}
[11/22] git commit: adding actions
Posted by an...@apache.org.
adding actions
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/272c7c52
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/272c7c52
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/272c7c52
Branch: refs/heads/plugman-registry
Commit: 272c7c52c5cbc12b60fd508299d64ff034f743e8
Parents: 59c684a
Author: Anis Kadri <an...@gmail.com>
Authored: Tue Jun 11 18:07:56 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:08:48 2013 -0700
----------------------------------------------------------------------
main.js | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/272c7c52/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 28a3358..3af9d98 100755
--- a/main.js
+++ b/main.js
@@ -24,6 +24,7 @@ var path = require('path')
, package = require(path.join(__dirname, 'package'))
, nopt = require('nopt')
, plugins = require('./src/util/plugins')
+ , registry = require('plugman-registry')
, plugman = require('./plugman');
var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8' ]
@@ -31,6 +32,10 @@ var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8'
, 'plugin' : [String, path, url]
, 'install' : Boolean
, 'uninstall' : Boolean
+ , 'adduser' : Boolean
+ , 'publish' : path
+ , 'unpublish' : path
+ , 'search' : String
, 'v' : Boolean
, 'debug' : Boolean
, 'plugins': path
@@ -69,6 +74,18 @@ else if (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin) {
else if (cli_opts.uninstall) {
plugman.uninstall(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, { www_dir: cli_opts.www });
}
+else if (cli_opts.adduser) {
+ // TODO adduser
+}
+else if (cli_opts.publish) {
+ // TODO publish
+}
+else if (cli_opts.unpublish) {
+ // TODO unpublish
+}
+else if (cli_opts.search) {
+ // TODO search
+}
else {
var cli_variables = {}
if (cli_opts.variable) {
[14/22] git commit: adding fetch and fixing cli interface
Posted by an...@apache.org.
adding fetch and fixing cli interface
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/587808c2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/587808c2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/587808c2
Branch: refs/heads/plugman-registry
Commit: 587808c24830b297216f4e093d0bfa8bc3a70ef2
Parents: 9beb41b
Author: Anis Kadri <an...@apache.org>
Authored: Mon Jun 17 15:30:31 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:12:38 2013 -0700
----------------------------------------------------------------------
main.js | 11 ++++++-----
package.json | 2 +-
src/fetch.js | 52 ++++++++++++++++++++++++++++++++++------------------
3 files changed, 41 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/587808c2/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 4602711..a4bac95 100755
--- a/main.js
+++ b/main.js
@@ -25,6 +25,7 @@ var path = require('path')
, nopt = require('nopt')
, plugins = require('./src/util/plugins')
, registry = require('plugman-registry')
+ , config = require('./config')
, plugman = require('./plugman');
var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8' ]
@@ -68,14 +69,14 @@ process.on('uncaughtException', function(error){
if (cli_opts.v) {
console.log(package.name + ' version ' + package.version);
}
-else if ((cli_opts.install || cli_opts.uninstall) && (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin)) {
+else if ((cli_opts.install || cli_opts.uninstall || cli_opts.argv.original.length == 0) && (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin)) {
plugman.help();
}
else if (cli_opts.uninstall) {
plugman.uninstall(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, { www_dir: cli_opts.www });
}
else if (cli_opts.adduser) {
- registry.use(null, function(err) {
+ registry.use(config.registry, function(err) {
registry.adduser(null, function(err) {
if(err) return console.log(err);
console.log('user added');
@@ -83,7 +84,7 @@ else if (cli_opts.adduser) {
});
}
else if (cli_opts.publish) {
- registry.use(null, function(err) {
+ registry.use(config.registry, function(err) {
registry.publish([cli_opts.plugin], function(err, d) {
if(err) return console.log('Error publishing plugin');
console.log('plugin published');
@@ -91,7 +92,7 @@ else if (cli_opts.publish) {
});
}
else if (cli_opts.unpublish) {
- registry.use(null, function(err) {
+ registry.use(config.registry, function(err) {
registry.unpublish([cli_opts.plugin, '--force'], function(err, d) {
if(err) return console.log('Error unpublishing plugin');
console.log('plugin unpublished');
@@ -99,7 +100,7 @@ else if (cli_opts.unpublish) {
});
}
else if (cli_opts.search) {
- registry.use(null, function(err) {
+ registry.use(config.registry, function(err) {
registry.search(cli_opts.search.split(','), function(err, d) {
if(err) return console.log(err);
});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/587808c2/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index f78d2ee..9e8cac7 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
"underscore":"1.4.4",
"dep-graph":"1.1.0",
"semver": "1.x.x",
- "plugman-registry": "0.0.1"
+ "plugman-registry": "0.0.2"
},
"devDependencies": {
"jasmine-node": "1.7.0"
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/587808c2/src/fetch.js
----------------------------------------------------------------------
diff --git a/src/fetch.js b/src/fetch.js
index 476d138..0589fb5 100644
--- a/src/fetch.js
+++ b/src/fetch.js
@@ -3,7 +3,8 @@ var shell = require('shelljs'),
plugins = require('./util/plugins'),
xml_helpers = require('./util/xml-helpers'),
metadata = require('./util/metadata'),
- path = require('path');
+ path = require('path'),
+ registry = require('plugman-registry');
// possible options: link, subdir, git_ref
module.exports = function fetchPlugin(plugin_dir, plugins_dir, options, callback) {
@@ -44,27 +45,42 @@ module.exports = function fetchPlugin(plugin_dir, plugins_dir, options, callback
// Copy from the local filesystem.
// First, read the plugin.xml and grab the ID.
plugin_dir = path.join(plugin_dir, options.subdir);
- var xml = xml_helpers.parseElementtreeSync(path.join(plugin_dir, 'plugin.xml'));
- var plugin_id = xml.getroot().attrib.id;
- var dest = path.join(plugins_dir, plugin_id);
+ var movePlugin = function(plugin_dir, linkable) {
+ var xml = xml_helpers.parseElementtreeSync(path.join(plugin_dir, 'plugin.xml'));
+ var plugin_id = xml.getroot().attrib.id;
- shell.rm('-rf', dest);
- if (options.link) {
- fs.symlinkSync(plugin_dir, dest, 'dir');
- } else {
- shell.mkdir('-p', dest);
- shell.cp('-R', path.join(plugin_dir, '*') , dest);
- }
+ var dest = path.join(plugins_dir, plugin_id);
+
+ shell.rm('-rf', dest);
+ if (options.link && linkable) {
+ fs.symlinkSync(plugin_dir, dest, 'dir');
+ } else {
+ shell.mkdir('-p', 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);
- var data = {
- source: {
- type: 'local',
- path: plugin_dir
- }
};
- metadata.save_fetch_metadata(dest, data);
- if (callback) callback(null, dest);
+
+ if(!fs.existsSync(plugin_dir)) {
+ registry.use(null, function() {
+ registry.fetch(plugin_dir, function(err, plugin_dir) {
+ movePlugin(plugin_dir, false);
+ });
+ })
+ } else {
+ movePlugin(plugin_dir, true);
+ }
}
};
[18/22] git commit: minor refactor, added specs
Posted by an...@apache.org.
minor refactor, added specs
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/8da6b449
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/8da6b449
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/8da6b449
Branch: refs/heads/plugman-registry
Commit: 8da6b449d33a26c60b1a56efa641d18a478b0b0e
Parents: dc27fcd
Author: Anis Kadri <an...@apache.org>
Authored: Thu Jul 11 13:08:23 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:13:29 2013 -0700
----------------------------------------------------------------------
config.js | 2 +-
main.js | 32 ++++----------------------------
plugman.js | 4 ++++
spec/adduser.spec.js | 13 +++++++++++++
spec/publish.spec.js | 13 +++++++++++++
spec/search.spec.js | 13 +++++++++++++
spec/unpublish.spec.js | 13 +++++++++++++
src/adduser.js | 11 +++++++++++
src/publish.js | 11 +++++++++++
src/search.js | 13 +++++++++++++
src/unpublish.js | 11 +++++++++++
11 files changed, 107 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/config.js
----------------------------------------------------------------------
diff --git a/config.js b/config.js
index 7056d93..244bf55 100644
--- a/config.js
+++ b/config.js
@@ -1,3 +1,3 @@
module.exports = {
- registry: "http://localhost:5984/registry/_design/scratch/_rewrite"
+ registry: "http://plugins.cordova.io"
}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 99f53f8..573765f 100755
--- a/main.js
+++ b/main.js
@@ -24,8 +24,6 @@ var path = require('path')
, package = require(path.join(__dirname, 'package'))
, nopt = require('nopt')
, plugins = require('./src/util/plugins')
- , registry = require('plugman-registry')
- , config = require('./config')
, plugman = require('./plugman');
var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8' ]
@@ -83,38 +81,16 @@ else if (cli_opts.uninstall) {
plugman.uninstall(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, { www_dir: cli_opts.www });
}
else if (cli_opts.adduser) {
- registry.use(config.registry, function(err) {
- registry.adduser(null, function(err) {
- if(err) return console.log(err);
- console.log('user added');
- });
- });
+ plugman.adduser();
}
else if (cli_opts.publish && cli_opts.plugin) {
- registry.use(config.registry, function(err) {
- registry.publish([cli_opts.plugin], function(err, d) {
- if(err) return console.log('Error publishing plugin', err);
- console.log('plugin published');
- });
- });
+ plugman.publish(new Array(cli_opts.plugin));
}
else if (cli_opts.unpublish && cli_opts.plugin) {
- registry.use(config.registry, function(err) {
- registry.unpublish([cli_opts.plugin], function(err, d) {
- if(err) return console.log('Error unpublishing plugin');
- console.log('plugin unpublished');
- });
- });
+ plugman.unpublish(new Array(cli_opts.plugin));
}
else if (cli_opts.search) {
- registry.use(config.registry, function(err) {
- registry.search(cli_opts.search.split(','), function(err, plugins) {
- if(err) return console.log(err);
- for(var plugin in plugins) {
- console.log(plugins[plugin].name, '-', plugins[plugin].description || 'no description provided');
- }
- });
- });
+ plugman.search(cli_opts.search.split(',');
}
else if(cli_opts.install) {
var cli_variables = {}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/plugman.js
----------------------------------------------------------------------
diff --git a/plugman.js b/plugman.js
index 23128ed..ecc5990 100755
--- a/plugman.js
+++ b/plugman.js
@@ -24,5 +24,9 @@ module.exports = {
uninstall:require('./src/uninstall'),
fetch: require('./src/fetch'),
prepare: require('./src/prepare'),
+ adduser: require('./src/adduser'),
+ publish: require('./src/publish'),
+ unpublish:require('./src/unpublish'),
+ search: require('./src/search'),
config_changes:require('./src/util/config-changes')
};
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/spec/adduser.spec.js
----------------------------------------------------------------------
diff --git a/spec/adduser.spec.js b/spec/adduser.spec.js
new file mode 100644
index 0000000..563592d
--- /dev/null
+++ b/spec/adduser.spec.js
@@ -0,0 +1,13 @@
+var adduser = require('../src/adduser'),
+ config = require('../config'),
+ registry = require('plugman-registry');
+
+describe('adduser', function() {
+ it('should add a user', function() {
+ var sUse = spyOn(registry, 'use').andCallThrough();
+ var sAddUser = spyOn(registry, 'adduser');
+ adduser();
+ expect(sUse).toHaveBeenCalledWith(config.registry, jasmine.any(Function));
+ expect(sAddUser).toHaveBeenCalled();
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/spec/publish.spec.js
----------------------------------------------------------------------
diff --git a/spec/publish.spec.js b/spec/publish.spec.js
new file mode 100644
index 0000000..3a253e7
--- /dev/null
+++ b/spec/publish.spec.js
@@ -0,0 +1,13 @@
+var publish = require('../src/publish'),
+ config = require('../config'),
+ registry = require('plugman-registry');
+
+describe('publish', function() {
+ it('should publish a plugin', function() {
+ var sUse = spyOn(registry, 'use').andCallThrough();
+ var sPublish = spyOn(registry, 'publish');
+ publish(new Array('/path/to/myplugin'));
+ expect(sUse).toHaveBeenCalledWith(config.registry, jasmine.any(Function));
+ expect(sPublish).toHaveBeenCalledWith(['/path/to/myplugin'], jasmine.any(Function));
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/spec/search.spec.js
----------------------------------------------------------------------
diff --git a/spec/search.spec.js b/spec/search.spec.js
new file mode 100644
index 0000000..f708854
--- /dev/null
+++ b/spec/search.spec.js
@@ -0,0 +1,13 @@
+var search = require('../src/search'),
+ config = require('../config'),
+ registry = require('plugman-registry');
+
+describe('search', function() {
+ it('should search a plugin', function() {
+ var sUse = spyOn(registry, 'use').andCallThrough();
+ var sSearch = spyOn(registry, 'search');
+ search(new Array('myplugin', 'keyword'));
+ expect(sUse).toHaveBeenCalledWith(config.registry, jasmine.any(Function));
+ expect(sSearch).toHaveBeenCalledWith(['myplugin', 'keyword'], jasmine.any(Function));
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/spec/unpublish.spec.js
----------------------------------------------------------------------
diff --git a/spec/unpublish.spec.js b/spec/unpublish.spec.js
new file mode 100644
index 0000000..207804d
--- /dev/null
+++ b/spec/unpublish.spec.js
@@ -0,0 +1,13 @@
+var unpublish = require('../src/unpublish'),
+ config = require('../config'),
+ registry = require('plugman-registry');
+
+describe('unpublish', function() {
+ it('should unpublish a plugin', function() {
+ var sUse = spyOn(registry, 'use').andCallThrough();
+ var sUnpublish = spyOn(registry, 'unpublish');
+ unpublish(new Array('myplugin@0.0.1'));
+ expect(sUse).toHaveBeenCalledWith(config.registry, jasmine.any(Function));
+ expect(sUnpublish).toHaveBeenCalledWith(['myplugin@0.0.1'], jasmine.any(Function));
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/src/adduser.js
----------------------------------------------------------------------
diff --git a/src/adduser.js b/src/adduser.js
new file mode 100644
index 0000000..da7cf4e
--- /dev/null
+++ b/src/adduser.js
@@ -0,0 +1,11 @@
+var registry = require('plugman-registry')
+ , config = require('../config');
+
+module.exports = function() {
+ registry.use(config.registry, function(err) {
+ registry.adduser(null, function(err) {
+ if(err) return console.log(err);
+ console.log('user added');
+ });
+ });
+}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/src/publish.js
----------------------------------------------------------------------
diff --git a/src/publish.js b/src/publish.js
new file mode 100644
index 0000000..234de15
--- /dev/null
+++ b/src/publish.js
@@ -0,0 +1,11 @@
+var registry = require('plugman-registry')
+ , config = require('../config');
+
+module.exports = function(plugin) {
+ registry.use(config.registry, function(err) {
+ registry.publish(plugin, function(err, d) {
+ if(err) return console.log('Error publishing plugin', err);
+ console.log('plugin published');
+ });
+ });
+}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/src/search.js
----------------------------------------------------------------------
diff --git a/src/search.js b/src/search.js
new file mode 100644
index 0000000..2b244b3
--- /dev/null
+++ b/src/search.js
@@ -0,0 +1,13 @@
+var registry = require('plugman-registry')
+ , config = require('../config');
+
+module.exports = function(search_opts) {
+ registry.use(config.registry, function(err) {
+ registry.search(search_opts, function(err, plugins) {
+ if(err) return console.log(err);
+ for(var plugin in plugins) {
+ console.log(plugins[plugin].name, '-', plugins[plugin].description || 'no description provided');
+ }
+ });
+ });
+}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/8da6b449/src/unpublish.js
----------------------------------------------------------------------
diff --git a/src/unpublish.js b/src/unpublish.js
new file mode 100644
index 0000000..072d740
--- /dev/null
+++ b/src/unpublish.js
@@ -0,0 +1,11 @@
+var registry = require('plugman-registry')
+ , config = require('../config');
+
+module.exports = function(plugin) {
+ registry.use(config.registry, function(err) {
+ registry.unpublish(plugin, function(err, d) {
+ if(err) return console.log('Error unpublishing plugin');
+ console.log('plugin unpublished');
+ });
+ });
+}
[19/22] git commit: adding argument check
Posted by an...@apache.org.
adding argument check
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/dc27fcdd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/dc27fcdd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/dc27fcdd
Branch: refs/heads/plugman-registry
Commit: dc27fcdd0ec4fa83a56c04a1e5022e3c8412fd44
Parents: dc8caca
Author: Anis Kadri <an...@apache.org>
Authored: Fri Jun 21 14:17:43 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:13:29 2013 -0700
----------------------------------------------------------------------
main.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/dc27fcdd/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index b695953..99f53f8 100755
--- a/main.js
+++ b/main.js
@@ -90,7 +90,7 @@ else if (cli_opts.adduser) {
});
});
}
-else if (cli_opts.publish) {
+else if (cli_opts.publish && cli_opts.plugin) {
registry.use(config.registry, function(err) {
registry.publish([cli_opts.plugin], function(err, d) {
if(err) return console.log('Error publishing plugin', err);
@@ -98,9 +98,9 @@ else if (cli_opts.publish) {
});
});
}
-else if (cli_opts.unpublish) {
+else if (cli_opts.unpublish && cli_opts.plugin) {
registry.use(config.registry, function(err) {
- registry.unpublish([cli_opts.plugin, '--force'], function(err, d) {
+ registry.unpublish([cli_opts.plugin], function(err, d) {
if(err) return console.log('Error unpublishing plugin');
console.log('plugin unpublished');
});
[07/22] git commit: 0.7.13. 0.7.12 already existed on npm but the
version in the repo was never incremented...
Posted by an...@apache.org.
0.7.13. 0.7.12 already existed on npm but the version in the repo was never incremented...
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/962317b2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/962317b2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/962317b2
Branch: refs/heads/plugman-registry
Commit: 962317b224e1e3a3ad3ac332bfce9c0025795778
Parents: 70c9b5c
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Jun 19 13:28:09 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Jun 19 13:28:09 2013 -0700
----------------------------------------------------------------------
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/962317b2/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index cdafc2c..7b4dafa 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"author": "Andrew Lunny <al...@gmail.com>",
"name": "plugman",
"description": "install/uninstall Cordova plugins",
- "version": "0.7.12",
+ "version": "0.7.13",
"repository": {
"type": "git",
"url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"
[22/22] git commit: added help
Posted by an...@apache.org.
added help
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/c9a42d68
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/c9a42d68
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/c9a42d68
Branch: refs/heads/plugman-registry
Commit: c9a42d689e2394c344a3348db7777f0f916e5b54
Parents: 37cb50c bf97513
Author: Anis Kadri <an...@apache.org>
Authored: Thu Jul 11 13:28:50 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:28:50 2013 -0700
----------------------------------------------------------------------
main.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/c9a42d68/main.js
----------------------------------------------------------------------
diff --cc main.js
index 153bea8,a0cd602..702fde6
--- a/main.js
+++ b/main.js
@@@ -108,5 -104,18 +108,5 @@@ else if(cli_opts.install)
};
plugman.install(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, opts);
} else {
-- printUsage();
-}
-
-function printUsage() {
- platforms = known_opts.platform.join('|');
- console.log('Usage\n-----');
- console.log('Install a plugin (will fetch if cannot be found):\n\t' + package.name + ' --install --platform <'+ platforms +'> --project <directory> --plugin <name|path|url> [--www <directory>] [--plugins_dir <directory>] [--variable <name>=<value>]\n');
- console.log('Uninstall a plugin:\n\t' + package.name + ' --uninstall --platform <'+ platforms +'> --project <directory> --plugin <id> [--www <directory>] [--plugins_dir <directory>]\n');
- console.log('\t--plugins_dir defaults to <project>/cordova/plugins, but can be any directory containing a subdirectory for each plugin');
- console.log('\n\t--www defaults to the project\'s www folder, but can be any directory where web assets should be installed into\n');
- console.log('Add a user account to the registry:\n\t' + package.name + ' --adduser\n');
- console.log('Publish a plugin:\n\t' + package.name + ' --publish --plugin plugin_directory\n');
- console.log('Unpublish a plugin:\n\t' + package.name + ' --unpublish --plugin plugin_name@version\n');
- console.log('Search for plugins:\n\t' + package.name + ' --search keyword1,keyword2,...\n');
++ plugman.help();
}
[04/22] git commit: testing out plugin loader approach by jesse
Posted by an...@apache.org.
testing out plugin loader approach by jesse
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/ee5cc777
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/ee5cc777
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/ee5cc777
Branch: refs/heads/plugman-registry
Commit: ee5cc7777ea99c2e28b4d7a10fbd7bb1263f9705
Parents: a9af62b
Author: Fil Maj <ma...@gmail.com>
Authored: Fri May 17 17:35:04 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Jun 19 13:16:47 2013 -0700
----------------------------------------------------------------------
src/prepare.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ee5cc777/src/prepare.js
----------------------------------------------------------------------
diff --git a/src/prepare.js b/src/prepare.js
index 7f3df91..800c8e1 100644
--- a/src/prepare.js
+++ b/src/prepare.js
@@ -120,6 +120,9 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir) {
});
// Write out moduleObjects as JSON to cordova_plugins.json
- fs.writeFileSync(path.join(wwwDir, 'cordova_plugins.json'), JSON.stringify(moduleObjects), 'utf-8');
+ var final_contents = "cordova.define('cordova/plugin_list', function(require, exports, module) {\n";
+ final_contents += 'module.exports = ' + JSON.stringify(moduleObjects) + '\n';
+ final_contents += '});';
+ fs.writeFileSync(path.join(wwwDir, 'cordova_plugins.js'), final_contents, 'utf-8');
};
[09/22] git commit: 0.7.15. Made help output more.. helpful. Factored
out into own module.
Posted by an...@apache.org.
0.7.15. Made help output more.. helpful. Factored out into own module.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/e911da27
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/e911da27
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/e911da27
Branch: refs/heads/plugman-registry
Commit: e911da27d14b16af1094069caf206bc008f0b3e7
Parents: 79d1cf6
Author: Fil Maj <ma...@gmail.com>
Authored: Thu Jun 20 13:43:00 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu Jun 20 13:43:00 2013 -0700
----------------------------------------------------------------------
doc/help.txt | 30 ++++++++++++++++++++++++++++++
main.js | 17 ++++++-----------
package.json | 2 +-
plugman.js | 1 +
src/help.js | 7 +++++++
5 files changed, 45 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e911da27/doc/help.txt
----------------------------------------------------------------------
diff --git a/doc/help.txt b/doc/help.txt
new file mode 100644
index 0000000..3a45a73
--- /dev/null
+++ b/doc/help.txt
@@ -0,0 +1,30 @@
+plugman installs and uninstalls plugin.xml-compatible cordova plugins into cordova-generated projects.
+
+Usage
+=====
+
+Install a plugin
+----------------
+
+ $ plugman --platform <platform> --project <directory> --plugin <plugin> [--variable NAME=VALUE]
+
+Parameters:
+
+ - <platform>: One of android, ios, blackberry10, wp7 or wp8
+ - project <directory>: Path reference to a cordova-generated project of the platform you specify
+ - plugin <plugin>: One of a path reference to a local copy of a plugin, or a remote https: or git: URL pointing to a cordova plugin
+ - variable NAME=VALUE: Some plugins require install-time variables to be defined. These could be things like API keys/tokens or other app-specific variables.
+
+Uninstall a plugin
+------------------
+
+ $ plugman --uninstall --platform <platform> --project <directory> --plugin <plugin-id>
+
+Parameters:
+ - plugin <plugin-id>: The plugin to remove, identified by its id (see the plugin.xml's <plugin id> attribute)
+
+Optional parameters
+-------------------
+
+ - www <directory>: www assets for the plugin will be installed into this directory. Default is to install into the standard www directory for the platform specified
+ - plugins_dir <directory>: a copy of the plugin will be stored in this directory. Default is to install into the <project directory>/plugins folder
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e911da27/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 3589496..28a3358 100755
--- a/main.js
+++ b/main.js
@@ -52,7 +52,11 @@ if (cli_opts.plugins_dir || cli_opts.project) {
}
process.on('uncaughtException', function(error){
- console.error(error.stack);
+ if (cli_opts.debug) {
+ console.error(error.stack);
+ } else {
+ console.error(error.message);
+ }
process.exit(1);
});
@@ -60,7 +64,7 @@ if (cli_opts.v) {
console.log(package.name + ' version ' + package.version);
}
else if (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin) {
- printUsage();
+ plugman.help();
}
else if (cli_opts.uninstall) {
plugman.uninstall(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, { www_dir: cli_opts.www });
@@ -81,12 +85,3 @@ else {
};
plugman.install(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, opts);
}
-
-function printUsage() {
- platforms = known_opts.platform.join('|');
- console.log('Usage\n---------');
- console.log('Install a plugin (will fetch if cannot be found):\n\t' + package.name + ' --platform <'+ platforms +'> --project <directory> --plugin <name|path|url> [--www <directory>] [--plugins_dir <directory>] [--variable <name>=<value>]\n');
- console.log('Uninstall a plugin:\n\t' + package.name + ' --uninstall --platform <'+ platforms +'> --project <directory> --plugin <id> [--www <directory>] [--plugins_dir <directory>]\n');
- console.log('\n\t--plugins_dir defaults to <project>/cordova/plugins, but can be any directory containing a subdirectory for each plugin');
- console.log('\n\t--www defaults to the project\'s www folder, but can be any directory where web assets should be installed into');
-}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e911da27/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index fe62338..937da53 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"author": "Andrew Lunny <al...@gmail.com>",
"name": "plugman",
"description": "install/uninstall Cordova plugins",
- "version": "0.7.14",
+ "version": "0.7.15",
"repository": {
"type": "git",
"url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e911da27/plugman.js
----------------------------------------------------------------------
diff --git a/plugman.js b/plugman.js
index 755204f..23128ed 100755
--- a/plugman.js
+++ b/plugman.js
@@ -19,6 +19,7 @@
// copyright (c) 2013 Andrew Lunny, Adobe Systems
module.exports = {
+ help: require('./src/help'),
install: require('./src/install'),
uninstall:require('./src/uninstall'),
fetch: require('./src/fetch'),
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e911da27/src/help.js
----------------------------------------------------------------------
diff --git a/src/help.js b/src/help.js
new file mode 100644
index 0000000..210cc48
--- /dev/null
+++ b/src/help.js
@@ -0,0 +1,7 @@
+var fs = require('fs'),
+ path = require('path');
+var doc_txt = path.join(__dirname, '..', 'doc', 'help.txt');
+
+module.exports = function help() {
+ console.log(fs.readFileSync(doc_txt, 'utf-8'));
+};
[06/22] git commit: 0.7.12
Posted by an...@apache.org.
0.7.12
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/70c9b5c3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/70c9b5c3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/70c9b5c3
Branch: refs/heads/plugman-registry
Commit: 70c9b5c389f68f5f3612d4faa0fbc9987f36c86e
Parents: e411b46
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Jun 19 13:20:35 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Jun 19 13:20:35 2013 -0700
----------------------------------------------------------------------
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/70c9b5c3/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 25de20f..cdafc2c 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"author": "Andrew Lunny <al...@gmail.com>",
"name": "plugman",
"description": "install/uninstall Cordova plugins",
- "version": "0.7.11",
+ "version": "0.7.12",
"repository": {
"type": "git",
"url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"
[10/22] git commit: added ability to load .dll from a windows phone
plugin
Posted by an...@apache.org.
added ability to load .dll from a windows phone plugin
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/59c684af
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/59c684af
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/59c684af
Branch: refs/heads/plugman-registry
Commit: 59c684af119847add009a4078c7143a0ab5b55f9
Parents: e911da2
Author: Benn Mapes <be...@gmail.com>
Authored: Fri Jun 21 15:01:41 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Fri Jun 21 15:01:41 2013 -0700
----------------------------------------------------------------------
src/util/csproj.js | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/59c684af/src/util/csproj.js
----------------------------------------------------------------------
diff --git a/src/util/csproj.js b/src/util/csproj.js
index 34be9a5..572bbbc 100644
--- a/src/util/csproj.js
+++ b/src/util/csproj.js
@@ -39,6 +39,19 @@ csproj.prototype = {
compile.append(dep);
item.append(compile);
}
+ // check if it's a .dll that we should add as a reference.
+ else if (relative_path.indexOf('.dll', relative_path.length - 4) > -1) {
+ var compile = new et.Element('Reference');
+ // add dll name
+ var parts = relative_path.split('\\');
+ var dll_name = parts[parts.length - 1].substr(0, parts[parts.length - 1].length - 4);
+ compile.attrib.Include = dll_name;
+ // add hint path with full path
+ var hint_path = new et.Element('HintPath');
+ hint_path.text = relative_path;
+ compile.append(hint_path);
+ item.append(compile);
+ }
// otherwise add it normally
else {
var compile = new et.Element('Compile');
@@ -66,6 +79,23 @@ csproj.prototype = {
return true;
}
}
+ // for removing .dll reference
+ var references = group.findall('Reference');
+ for (var j = 0, k = references.length; j < k; j++) {
+ var reference = references[j];
+ var parts = relative_path.split('\\');
+ var dll_name = parts[parts.length - 1].substr(0, parts[parts.length - 1].length - 4);
+ if(reference.attrib.Include == dll_name) {
+ // remove file reference
+ group.remove(0, reference);
+ // remove ItemGroup if empty
+ var new_group = group.findall('Compile').concat(group.findall('Page'));
+ if(new_group.length < 1) {
+ this.xml.getroot().remove(0, group);
+ }
+ return true;
+ }
+ }
}
return false;
}
[13/22] git commit: adding config
Posted by an...@apache.org.
adding config
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/671283ec
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/671283ec
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/671283ec
Branch: refs/heads/plugman-registry
Commit: 671283ec0754e309316352d7885b6cfddc9527b8
Parents: b0fe1f4
Author: Anis Kadri <an...@apache.org>
Authored: Mon Jun 17 16:08:45 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:12:38 2013 -0700
----------------------------------------------------------------------
config.js | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/671283ec/config.js
----------------------------------------------------------------------
diff --git a/config.js b/config.js
new file mode 100644
index 0000000..7056d93
--- /dev/null
+++ b/config.js
@@ -0,0 +1,3 @@
+module.exports = {
+ registry: "http://localhost:5984/registry/_design/scratch/_rewrite"
+}
[12/22] git commit: adding registry dependency and wiring up commands
Posted by an...@apache.org.
adding registry dependency and wiring up commands
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/9beb41be
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/9beb41be
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/9beb41be
Branch: refs/heads/plugman-registry
Commit: 9beb41be4171ab45839abff89bad914cfdbae2f8
Parents: 272c7c5
Author: Anis Kadri <an...@gmail.com>
Authored: Thu Jun 13 18:21:27 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:11:21 2013 -0700
----------------------------------------------------------------------
main.js | 33 ++++++++++++++++++++++++++-------
package.json | 3 ++-
2 files changed, 28 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9beb41be/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 3af9d98..4602711 100755
--- a/main.js
+++ b/main.js
@@ -33,8 +33,8 @@ var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8'
, 'install' : Boolean
, 'uninstall' : Boolean
, 'adduser' : Boolean
- , 'publish' : path
- , 'unpublish' : path
+ , 'publish' : Boolean
+ , 'unpublish' : Boolean
, 'search' : String
, 'v' : Boolean
, 'debug' : Boolean
@@ -68,23 +68,42 @@ process.on('uncaughtException', function(error){
if (cli_opts.v) {
console.log(package.name + ' version ' + package.version);
}
-else if (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin) {
+else if ((cli_opts.install || cli_opts.uninstall) && (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin)) {
plugman.help();
}
else if (cli_opts.uninstall) {
plugman.uninstall(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, { www_dir: cli_opts.www });
}
else if (cli_opts.adduser) {
- // TODO adduser
+ registry.use(null, function(err) {
+ registry.adduser(null, function(err) {
+ if(err) return console.log(err);
+ console.log('user added');
+ });
+ });
}
else if (cli_opts.publish) {
- // TODO publish
+ registry.use(null, function(err) {
+ registry.publish([cli_opts.plugin], function(err, d) {
+ if(err) return console.log('Error publishing plugin');
+ console.log('plugin published');
+ });
+ });
}
else if (cli_opts.unpublish) {
- // TODO unpublish
+ registry.use(null, function(err) {
+ registry.unpublish([cli_opts.plugin, '--force'], function(err, d) {
+ if(err) return console.log('Error unpublishing plugin');
+ console.log('plugin unpublished');
+ });
+ });
}
else if (cli_opts.search) {
- // TODO search
+ registry.use(null, function(err) {
+ registry.search(cli_opts.search.split(','), function(err, d) {
+ if(err) return console.log(err);
+ });
+ });
}
else {
var cli_variables = {}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9beb41be/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 937da53..f78d2ee 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,8 @@
"ncallbacks":"1.1.0",
"underscore":"1.4.4",
"dep-graph":"1.1.0",
- "semver": "1.x.x"
+ "semver": "1.x.x",
+ "plugman-registry": "0.0.1"
},
"devDependencies": {
"jasmine-node": "1.7.0"
[21/22] git commit: typo
Posted by an...@apache.org.
typo
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/37cb50cc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/37cb50cc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/37cb50cc
Branch: refs/heads/plugman-registry
Commit: 37cb50cc2683ef73dfd920edd004de9c3343ae63
Parents: 8da6b44
Author: Anis Kadri <an...@apache.org>
Authored: Thu Jul 11 13:27:10 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:27:10 2013 -0700
----------------------------------------------------------------------
doc/help.txt | 24 ++++++++++++++++++++++++
main.js | 2 +-
2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/37cb50cc/doc/help.txt
----------------------------------------------------------------------
diff --git a/doc/help.txt b/doc/help.txt
index 3a45a73..a4f31cb 100644
--- a/doc/help.txt
+++ b/doc/help.txt
@@ -28,3 +28,27 @@ Optional parameters
- www <directory>: www assets for the plugin will be installed into this directory. Default is to install into the standard www directory for the platform specified
- plugins_dir <directory>: a copy of the plugin will be stored in this directory. Default is to install into the <project directory>/plugins folder
+
+Interacting with the registry
+=============================
+
+Add a user account
+------------------
+
+ $ plugman --adduser
+
+Publish a plugin
+----------------
+
+ $ plugman --publish --plugin <directory>
+
+Unpublish a plugin
+------------------
+
+ $ plugman --unpublish <name>@<version>
+
+Search for a plugin
+-------------------
+
+ $ plugman --search plugin,keywords
+
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/37cb50cc/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 573765f..153bea8 100755
--- a/main.js
+++ b/main.js
@@ -90,7 +90,7 @@ else if (cli_opts.unpublish && cli_opts.plugin) {
plugman.unpublish(new Array(cli_opts.plugin));
}
else if (cli_opts.search) {
- plugman.search(cli_opts.search.split(',');
+ plugman.search(cli_opts.search.split(','));
}
else if(cli_opts.install) {
var cli_variables = {}
[05/22] git commit: Make sure to write out both cordova_plugins.json
and cordova_plugins.js
Posted by an...@apache.org.
Make sure to write out both cordova_plugins.json and cordova_plugins.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/e411b46d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/e411b46d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/e411b46d
Branch: refs/heads/plugman-registry
Commit: e411b46dad371fb2ac72f55b74ce6b019253176b
Parents: ee5cc77
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Jun 19 13:20:11 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Jun 19 13:20:11 2013 -0700
----------------------------------------------------------------------
src/prepare.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e411b46d/src/prepare.js
----------------------------------------------------------------------
diff --git a/src/prepare.js b/src/prepare.js
index 800c8e1..e4ad090 100644
--- a/src/prepare.js
+++ b/src/prepare.js
@@ -120,9 +120,11 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir) {
});
// Write out moduleObjects as JSON to cordova_plugins.json
+ fs.writeFileSync(path.join(wwwDir, 'cordova_plugins.json'), JSON.stringify(moduleObjects), 'utf-8');
+ // Write out moduleObjects as JSON wrapped in a cordova module to cordova_plugins.js
+ // This is to support Windows Phone platforms that have trouble with XHR during load
var final_contents = "cordova.define('cordova/plugin_list', function(require, exports, module) {\n";
final_contents += 'module.exports = ' + JSON.stringify(moduleObjects) + '\n';
final_contents += '});';
fs.writeFileSync(path.join(wwwDir, 'cordova_plugins.js'), final_contents, 'utf-8');
-
};
[15/22] git commit: updating plugin spec
Posted by an...@apache.org.
updating plugin spec
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/b0fe1f4b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/b0fe1f4b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/b0fe1f4b
Branch: refs/heads/plugman-registry
Commit: b0fe1f4b01826fb0e8df2975caa3c040ed1b3269
Parents: c7a0ff9
Author: Anis Kadri <an...@apache.org>
Authored: Mon Jun 17 16:08:32 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:12:38 2013 -0700
----------------------------------------------------------------------
plugin_spec.md | 38 ++++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/b0fe1f4b/plugin_spec.md
----------------------------------------------------------------------
diff --git a/plugin_spec.md b/plugin_spec.md
index 2fbabbf..efe1de4 100644
--- a/plugin_spec.md
+++ b/plugin_spec.md
@@ -72,12 +72,46 @@ If no `<engine>` tags are specified, plugman will attempt to install into the sp
## <name> element
A human-readable name for the plugin. The text content of the element contains
-the name of the plugin. An example:
+the name of the plugin. Has to be lower case and cannot contain spaces or special characters. An example:
- <name>Foo</name>
+ <name>foo</name>
This element does not (yet) handle localization.
+## <description> element
+
+A human-readable description for the plugin. The text content of the element contains
+the description of the plugin. An example:
+
+ <description>foo plugin description</description>
+
+This element does not (yet) handle localization.
+
+## <author> element
+
+Plugin author name. The text content of the element contains
+the name of the plugin author. An example:
+
+ <author>foo plugin description</author>
+
+## <keywords> element
+
+Plugin keywords. The text content of the element contains comma separated keywords to describe the plugin. An example:
+
+ <keywords>foo,bar</keywords>
+
+## <license> element
+
+Plugin license. The text content of the element contains the plugin license. An example:
+
+ <keywords>foo,bar</keywords>
+
+## <license> element
+
+Plugin license. The text content of the element contains the plugin license. An example:
+
+ <license>Apache</license>
+
## <asset> element
One or more elements listing the files or directories to be copied into a
[20/22] git commit: adding search results
Posted by an...@apache.org.
adding search results
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/dc8caca0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/dc8caca0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/dc8caca0
Branch: refs/heads/plugman-registry
Commit: dc8caca0af617b4f4d720eb8439d82b01326e89e
Parents: 5ec2924
Author: Anis Kadri <an...@apache.org>
Authored: Wed Jun 19 14:50:33 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:13:29 2013 -0700
----------------------------------------------------------------------
main.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/dc8caca0/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 7baebe6..b695953 100755
--- a/main.js
+++ b/main.js
@@ -93,7 +93,7 @@ else if (cli_opts.adduser) {
else if (cli_opts.publish) {
registry.use(config.registry, function(err) {
registry.publish([cli_opts.plugin], function(err, d) {
- if(err) return console.log('Error publishing plugin');
+ if(err) return console.log('Error publishing plugin', err);
console.log('plugin published');
});
});
@@ -108,12 +108,15 @@ else if (cli_opts.unpublish) {
}
else if (cli_opts.search) {
registry.use(config.registry, function(err) {
- registry.search(cli_opts.search.split(','), function(err, d) {
+ registry.search(cli_opts.search.split(','), function(err, plugins) {
if(err) return console.log(err);
+ for(var plugin in plugins) {
+ console.log(plugins[plugin].name, '-', plugins[plugin].description || 'no description provided');
+ }
});
});
}
-else {
+else if(cli_opts.install) {
var cli_variables = {}
if (cli_opts.variable) {
cli_opts.variable.forEach(function (variable) {
@@ -128,4 +131,6 @@ else {
www_dir: cli_opts.www
};
plugman.install(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, opts);
+} else {
+ printUsage();
}
[17/22] git commit: updating cli options and adding short hands
Posted by an...@apache.org.
updating cli options and adding short hands
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/c7a0ff9a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/c7a0ff9a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/c7a0ff9a
Branch: refs/heads/plugman-registry
Commit: c7a0ff9a88c50156be95d330e90f4e3922beb35d
Parents: 587808c
Author: Anis Kadri <an...@apache.org>
Authored: Mon Jun 17 15:57:52 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:12:38 2013 -0700
----------------------------------------------------------------------
main.js | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/c7a0ff9a/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index a4bac95..7baebe6 100755
--- a/main.js
+++ b/main.js
@@ -37,15 +37,19 @@ var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8'
, 'publish' : Boolean
, 'unpublish' : Boolean
, 'search' : String
- , 'v' : Boolean
+ , 'version' : Boolean
+ , 'help' : Boolean
, 'debug' : Boolean
, 'plugins': path
, 'link': Boolean
, 'variable' : Array
, 'www': path
}, shortHands = { 'var' : 'variable' };
-
-var cli_opts = nopt(known_opts);
+var short_hands = {
+ "v": ["--version"]
+ , "h": ["--help"]
+}
+var cli_opts = nopt(known_opts, short_hands);
// Default the plugins_dir to './cordova/plugins'.
var plugins_dir;
@@ -66,8 +70,11 @@ process.on('uncaughtException', function(error){
process.exit(1);
});
-if (cli_opts.v) {
+if (cli_opts.version) {
console.log(package.name + ' version ' + package.version);
+}
+else if (cli_opts.help) {
+ printUsage();
}
else if ((cli_opts.install || cli_opts.uninstall || cli_opts.argv.original.length == 0) && (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin)) {
plugman.help();
[03/22] git commit: Should install plugin after fetching from url
Posted by an...@apache.org.
Should install plugin after fetching from url
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/a9af62bd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/a9af62bd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/a9af62bd
Branch: refs/heads/plugman-registry
Commit: a9af62bd23707795ba7d5d0f1be4515526e11c0e
Parents: 83cfd5c
Author: Tim Kim <ti...@adobe.com>
Authored: Tue Jun 11 12:33:58 2013 -0700
Committer: Tim Kim <ti...@adobe.com>
Committed: Tue Jun 11 12:33:58 2013 -0700
----------------------------------------------------------------------
src/fetch.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/a9af62bd/src/fetch.js
----------------------------------------------------------------------
diff --git a/src/fetch.js b/src/fetch.js
index 68f5113..476d138 100644
--- a/src/fetch.js
+++ b/src/fetch.js
@@ -32,6 +32,7 @@ module.exports = function fetchPlugin(plugin_dir, plugins_dir, options, callback
plugins.clonePluginGitRepo(plugin_dir, plugins_dir, options.subdir, options.git_ref, function(err, dir) {
if (!err) {
metadata.save_fetch_metadata(dir, data);
+ if (callback) callback(null, dir);
}
});
}
[16/22] git commit: fixing issue with fetch
Posted by an...@apache.org.
fixing issue with fetch
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/5ec29247
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/5ec29247
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/5ec29247
Branch: refs/heads/plugman-registry
Commit: 5ec29247881cbaecc3ab787dc61260b1ead3d43a
Parents: 671283e
Author: Anis Kadri <an...@apache.org>
Authored: Mon Jun 17 16:15:43 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 13:12:38 2013 -0700
----------------------------------------------------------------------
src/fetch.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/5ec29247/src/fetch.js
----------------------------------------------------------------------
diff --git a/src/fetch.js b/src/fetch.js
index 0589fb5..c8cd653 100644
--- a/src/fetch.js
+++ b/src/fetch.js
@@ -75,7 +75,7 @@ module.exports = function fetchPlugin(plugin_dir, plugins_dir, options, callback
if(!fs.existsSync(plugin_dir)) {
registry.use(null, function() {
- registry.fetch(plugin_dir, function(err, plugin_dir) {
+ registry.fetch([plugin_dir], function(err, plugin_dir) {
movePlugin(plugin_dir, false);
});
})
[02/22] git commit: 0.7.11
Posted by an...@apache.org.
0.7.11
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/83cfd5cc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/83cfd5cc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/83cfd5cc
Branch: refs/heads/plugman-registry
Commit: 83cfd5cce53b53d3a811ce91bbc9ba4848d5dbbe
Parents: e3043a6
Author: Benn Mapes <be...@gmail.com>
Authored: Mon Jun 10 17:06:55 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Mon Jun 10 17:06:55 2013 -0700
----------------------------------------------------------------------
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/83cfd5cc/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 85c83c7..25de20f 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"author": "Andrew Lunny <al...@gmail.com>",
"name": "plugman",
"description": "install/uninstall Cordova plugins",
- "version": "0.7.10",
+ "version": "0.7.11",
"repository": {
"type": "git",
"url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"
[08/22] git commit: 0.7.14. Fixed [CB-3943]: dont error out
element checking if version script fails.
Posted by an...@apache.org.
0.7.14. Fixed [CB-3943]: dont error out <engine> element checking if version script fails.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/79d1cf65
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/79d1cf65
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/79d1cf65
Branch: refs/heads/plugman-registry
Commit: 79d1cf652b66b3fd0c543fbab1b331ccbe7557a9
Parents: 962317b
Author: Fil Maj <ma...@gmail.com>
Authored: Thu Jun 20 09:26:00 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu Jun 20 09:26:00 2013 -0700
----------------------------------------------------------------------
package.json | 2 +-
src/install.js | 40 ++++++++++++++++------------------------
2 files changed, 17 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/79d1cf65/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 7b4dafa..fe62338 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"author": "Andrew Lunny <al...@gmail.com>",
"name": "plugman",
"description": "install/uninstall Cordova plugins",
- "version": "0.7.13",
+ "version": "0.7.14",
"repository": {
"type": "git",
"url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/79d1cf65/src/install.js
----------------------------------------------------------------------
diff --git a/src/install.js b/src/install.js
index 461549c..37f09c8 100644
--- a/src/install.js
+++ b/src/install.js
@@ -75,41 +75,33 @@ function runInstall(actions, platform, project_dir, plugin_dir, plugins_dir, opt
// checking engine
// will there be a case for multiple engine support?
-
var versionPath = path.join(project_dir, 'cordova', 'version');
if (fs.existsSync(versionPath)) {
-
// need to rethink this so I don't have to chmod anything
fs.chmodSync(versionPath, '755');
var versionScript = shell.exec(versionPath, {silent: true});
-
- var engines = plugin_et.findall('engines/engine');
- engines.forEach(function(engine){
- if(engine.attrib["name"].toLowerCase() === "cordova"){
- var engineVersion = engine.attrib["version"];
- if(versionScript.code>0){
- var err = new Error('Failed to identify Cordova version: ' + versionPath + '\n' + versionScript.output);
- if (callback) callback(err);
- else throw err;
- }else{
+ // Only check cordova version if the version script was successful.
+ if (versionScript.code === 0) {
+ var engines = plugin_et.findall('engines/engine');
+ engines.forEach(function(engine){
+ if(engine.attrib["name"].toLowerCase() === "cordova"){
+ var engineVersion = engine.attrib["version"];
// clean only versionScript.output since semver.clean strips out
// the gt and lt operators
- if(versionScript.output.trim() === 'dev' || semver.satisfies(semver.clean(versionScript.output), engineVersion)){
+ var current_version = versionScript.output.trim();
+ if(current_version === 'dev' || semver.satisfies(semver.clean(current_version), engineVersion)){
// engine ok!
-
- }else{
- var err = new Error('Plugin doesn\'t support Cordova version. Check plugin.xml');
- if (callback) callback(err);
+ } else {
+ var err = new Error('Plugin doesn\'t support this project\'s Cordova version. Project version: ' + current_version + ', failed version requirement: ' + engineVersion);
+ if (callback) return callback(err);
else throw err;
}
+ } else {
+ // check for other engines? worklight phonegap etc
}
- } else {
- // check for other engines?
- }
- });
- }
- else
- {
+ });
+ }
+ } else {
console.log('Warning: cordova version not detected. installing anyway.');
}