You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/05/17 04:25:42 UTC

[10/10] git commit: 0.7.1. fixed an issue with ios source-file installs.

0.7.1. fixed an issue with ios source-file installs.


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

Branch: refs/heads/master
Commit: 09e844ec245314de2ca4c539b6a4b85602203f96
Parents: 5984294
Author: Fil Maj <ma...@gmail.com>
Authored: Thu May 16 15:58:36 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu May 16 15:58:36 2013 -0700

----------------------------------------------------------------------
 package.json               |    2 +-
 spec/platforms/ios.spec.js |   20 ++++++++++----------
 src/platforms/ios.js       |    4 ++--
 src/prepare.js             |    2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/09e844ec/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index a68d17d..3e3b6f6 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.0",
+  "version": "0.7.1",
   "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/09e844ec/spec/platforms/ios.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/ios.spec.js b/spec/platforms/ios.spec.js
index cd22cf0..9b11654 100644
--- a/spec/platforms/ios.spec.js
+++ b/spec/platforms/ios.spec.js
@@ -117,7 +117,7 @@ describe('ios project handler', function() {
             it('should throw if source-file src cannot be found', function() {
                 var source = copyArray(invalid_source);
                 expect(function() {
-                    ios['source-file'].install(source[1], faultyplugin, temp, proj_files);
+                    ios['source-file'].install(source[1], faultyplugin, temp, faulty_id, proj_files);
                 }).toThrow('cannot find "' + path.resolve(faultyplugin, 'src/ios/FaultyPluginCommand.m') + '" ios <source-file>');
             });
             it('should throw if source-file target already exists', function() {
@@ -126,31 +126,31 @@ describe('ios project handler', function() {
                 shell.mkdir('-p', path.dirname(target));
                 fs.writeFileSync(target, 'some bs', 'utf-8');
                 expect(function() {
-                    ios['source-file'].install(source[0], dummyplugin, temp, proj_files);
+                    ios['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
                 }).toThrow('target destination "' + target + '" already exists');
             });
             it('should call into xcodeproj\'s addSourceFile appropriately when element has no target-dir', function() {
                 var source = copyArray(valid_source).filter(function(s) { return s.attrib['target-dir'] == undefined});
                 var spy = spyOn(proj_files.xcode, 'addSourceFile');
-                ios['source-file'].install(source[0], dummyplugin, temp, proj_files);
+                ios['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
                 expect(spy).toHaveBeenCalledWith(path.join('Plugins', 'DummyPluginCommand.m'));
             });
             it('should call into xcodeproj\'s addSourceFile appropriately when element has a target-dir', function() {
                 var source = copyArray(valid_source).filter(function(s) { return s.attrib['target-dir'] != undefined});
                 var spy = spyOn(proj_files.xcode, 'addSourceFile');
-                ios['source-file'].install(source[0], dummyplugin, temp, proj_files);
+                ios['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
                 expect(spy).toHaveBeenCalledWith(path.join('Plugins', 'targetDir', 'TargetDirTest.m'));
             });
             it('should cp the file to the right target location when element has no target-dir', function() {
                 var source = copyArray(valid_source).filter(function(s) { return s.attrib['target-dir'] == undefined});
                 var spy = spyOn(shell, 'cp');
-                ios['source-file'].install(source[0], dummyplugin, temp, proj_files);
+                ios['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
                 expect(spy).toHaveBeenCalledWith(path.join(dummyplugin, 'src', 'ios', 'DummyPluginCommand.m'), path.join(temp, 'SampleApp', 'Plugins', 'DummyPluginCommand.m'));
             });
             it('should cp the file to the right target location when element has a target-dir', function() {
                 var source = copyArray(valid_source).filter(function(s) { return s.attrib['target-dir'] != undefined});
                 var spy = spyOn(shell, 'cp');
-                ios['source-file'].install(source[0], dummyplugin, temp, proj_files);
+                ios['source-file'].install(source[0], dummyplugin, temp, dummy_id, proj_files);
                 expect(spy).toHaveBeenCalledWith(path.join(dummyplugin, 'src', 'ios', 'TargetDirTest.m'), path.join(temp, 'SampleApp', 'Plugins', 'targetDir', 'TargetDirTest.m'));
             });
         });
@@ -259,7 +259,7 @@ describe('ios project handler', function() {
                 var source = copyArray(valid_source).filter(function(s) { return s.attrib['target-dir'] == undefined});
                 shell.cp('-rf', ios_config_xml_project, temp);
                 var spy = spyOn(proj_files.xcode, 'removeSourceFile');
-                ios['source-file'].uninstall(source[0], temp, proj_files);
+                ios['source-file'].uninstall(source[0], temp, dummy_id, proj_files);
                 expect(spy).toHaveBeenCalledWith(path.join('Plugins', 'DummyPluginCommand.m'));
             });
             it('should call into xcodeproj\'s removeSourceFile appropriately when element a target-dir', function(){
@@ -267,7 +267,7 @@ describe('ios project handler', function() {
                 shell.cp('-rf', ios_config_xml_project, temp);
                 
                 var spy = spyOn(shell, 'rm');
-                ios['source-file'].uninstall(source[0], temp, proj_files);
+                ios['source-file'].uninstall(source[0], temp, dummy_id, proj_files);
                 expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', 'targetDir', 'TargetDirTest.m'));
             });
             it('should rm the file from the right target location when element has no target-dir', function(){
@@ -275,7 +275,7 @@ describe('ios project handler', function() {
                 shell.cp('-rf', ios_config_xml_project, temp);
             
                 var spy = spyOn(shell, 'rm');
-                ios['source-file'].uninstall(source[0], temp, proj_files);
+                ios['source-file'].uninstall(source[0], temp, dummy_id, proj_files);
                 expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', 'DummyPluginCommand.m'));
             });
             it('should rm the file from the right target location when element has a target-dir', function(){
@@ -283,7 +283,7 @@ describe('ios project handler', function() {
                 shell.cp('-rf', ios_config_xml_project, temp);                
                 var spy = spyOn(shell, 'rm');
                 
-                ios['source-file'].uninstall(source[0], temp, proj_files);
+                ios['source-file'].uninstall(source[0], temp, dummy_id, proj_files);
                 expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', 'targetDir', 'TargetDirTest.m'));
             });
         });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/09e844ec/src/platforms/ios.js
----------------------------------------------------------------------
diff --git a/src/platforms/ios.js b/src/platforms/ios.js
index adc0325..c33cbf8 100644
--- a/src/platforms/ios.js
+++ b/src/platforms/ios.js
@@ -33,7 +33,7 @@ module.exports = {
         return plist.parseFileSync(plist_file).CFBundleIdentifier;
     },
     "source-file":{
-        install:function(source_el, plugin_dir, project_dir, project) {
+        install:function(source_el, plugin_dir, project_dir, plugin_id, project) {
             var src = source_el.attrib['src'];
             var srcFile = path.resolve(plugin_dir, src);
             var targetDir = path.resolve(project.plugins_dir, getRelativeDir(source_el));
@@ -45,7 +45,7 @@ module.exports = {
             shell.mkdir('-p', targetDir);
             shell.cp(srcFile, destFile);
         },
-        uninstall:function(source_el, project_dir, project) {
+        uninstall:function(source_el, project_dir, plugin_id, project) {
             var src = source_el.attrib['src'];
             var targetDir = path.resolve(project.plugins_dir, getRelativeDir(source_el));
             var destFile = path.resolve(targetDir, path.basename(src));

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/09e844ec/src/prepare.js
----------------------------------------------------------------------
diff --git a/src/prepare.js b/src/prepare.js
index 0a26980..7f3df91 100644
--- a/src/prepare.js
+++ b/src/prepare.js
@@ -92,7 +92,7 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir) {
     
                 // Prepare the object for cordova_plugins.json.
                 var obj = {
-                    file: path.join('/plugins', plugin_id, module.attrib.src),
+                    file: path.join('plugins', plugin_id, module.attrib.src),
                     id: moduleName
                 };