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/09/10 00:52:57 UTC

git commit: CB-4770 dependent plugins can be fetched from registry

Updated Branches:
  refs/heads/master b05729ae4 -> 6486e7fda


CB-4770 dependent plugins can be fetched from registry


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/6486e7fd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/6486e7fd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/6486e7fd

Branch: refs/heads/master
Commit: 6486e7fda601b8ba427f0f16df59c3193f90389b
Parents: b05729a
Author: Anis Kadri <an...@apache.org>
Authored: Mon Sep 9 15:53:00 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Mon Sep 9 15:53:00 2013 -0700

----------------------------------------------------------------------
 spec/install.spec.js | 11 +++++++++++
 src/install.js       |  5 +++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/6486e7fd/spec/install.spec.js
----------------------------------------------------------------------
diff --git a/spec/install.spec.js b/spec/install.spec.js
index 1639fce..c1cbdf9 100644
--- a/spec/install.spec.js
+++ b/spec/install.spec.js
@@ -146,6 +146,17 @@ describe('install', function() {
                 expect(s).toHaveBeenCalledWith('C', deps_dir, { link: false, subdir: undefined, git_ref: undefined}, jasmine.any(Function));
                 expect(s.calls.length).toEqual(3);
             });
+            it('should try to fetch any dependent plugins from registry when url is not defined', function() {
+                var deps_dir = path.join(plugins_dir, 'dependencies'),
+                    s = spyOn(plugman, 'fetch').andCallFake(function(id, dir, opts, cb) {
+                    cb(false, path.join(dir, id));
+                });
+                exists.andReturn(false);
+                // Plugin A depends on C & D
+                install('android', temp, 'E', deps_dir, {});
+                expect(s).toHaveBeenCalledWith('D', deps_dir, { link: false, subdir: undefined, git_ref: undefined}, jasmine.any(Function));
+                expect(s.calls.length).toEqual(2);
+            });
         });
     });
 

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/6486e7fd/src/install.js
----------------------------------------------------------------------
diff --git a/src/install.js b/src/install.js
index 1959f07..d94f367 100644
--- a/src/install.js
+++ b/src/install.js
@@ -295,6 +295,11 @@ function runInstall(actions, platform, project_dir, plugin_dir, plugins_dir, opt
                     git_ref: dep_git_ref
                 };
 
+                // CB-4770: registry fetching
+                if(dep_url === undefined) {
+                    dep_url = dep_plugin_id;
+                }
+
                 possiblyFetch(actions, platform, project_dir, dep_url, plugins_dir, opts, function(err) {
                     if (err) {
                         if (callback) callback(err);