cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/4] git commit: removing <asset/> from android, ios and blackberry. Updating specs
Date Tue, 07 May 2013 01:20:33 GMT
removing <asset/> from android, ios and blackberry. Updating 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/4be5ea01
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/4be5ea01
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/4be5ea01

Branch: refs/heads/master
Commit: 4be5ea01770c31529ff1607d98872d9de7adc9b8
Parents: 61fe661
Author: Anis Kadri <anis@apache.org>
Authored: Mon May 6 18:19:25 2013 -0700
Committer: Anis Kadri <anis@apache.org>
Committed: Mon May 6 18:19:25 2013 -0700

----------------------------------------------------------------------
 spec/platforms/android.spec.js    |   21 -----------
 spec/platforms/blackberry.spec.js |   21 -----------
 spec/platforms/ios.spec.js        |   60 --------------------------------
 src/platforms/android.js          |   10 -----
 src/platforms/blackberry.js       |   10 -----
 src/platforms/ios.js              |   10 -----
 6 files changed, 0 insertions(+), 132 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4be5ea01/spec/platforms/android.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/android.spec.js b/spec/platforms/android.spec.js
index beb7c30..f20e68a 100644
--- a/spec/platforms/android.spec.js
+++ b/spec/platforms/android.spec.js
@@ -117,26 +117,5 @@ describe('android project handler', function() {
                 });
             });
         });
-        describe('of <asset> elements', function() {
-            it('should remove www\'s plugins/<plugin-id> directory', function(done)
{
-                var as = copyArray(assets);
-                install('android', temp, 'DummyPlugin', plugins_dir, {}, function() {
-                    var s = spyOn(shell, 'rm');
-                    android.uninstall(as, dummy_id, temp, path.join(plugins_dir, 'DummyPlugin'));
-                    expect(s).toHaveBeenCalledWith('-Rf', path.join(temp, 'assets', 'www',
'plugins', dummy_id));
-                    done();
-                });
-            });
-            it('should remove stuff specified by the element', function(done) {
-                var as = copyArray(assets);
-                install('android', temp, 'DummyPlugin', plugins_dir, {}, function() {
-                    var s = spyOn(shell, 'rm');
-                    android.uninstall(as, dummy_id, temp, path.join(plugins_dir, 'DummyPlugin'));
-                    expect(s).toHaveBeenCalledWith('-Rf', path.join(temp, 'assets', 'www',
'dummyplugin.js'));
-                    expect(s).toHaveBeenCalledWith('-Rf', path.join(temp, 'assets', 'www',
'dummyplugin'));
-                    done();
-                });
-            });
-        });
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4be5ea01/spec/platforms/blackberry.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/blackberry.spec.js b/spec/platforms/blackberry.spec.js
index 049ec95..204d5e0 100644
--- a/spec/platforms/blackberry.spec.js
+++ b/spec/platforms/blackberry.spec.js
@@ -108,26 +108,5 @@ describe('blackberry project handler', function() {
                 });
             });
         });
-        describe('of <asset> elements', function() {
-            it('should remove www\'s plugins/<plugin-id> directory', function(done)
{
-                var as = copyArray(assets);
-                install('blackberry', temp, 'DummyPlugin', plugins_dir, {}, function() {
-                    var s = spyOn(shell, 'rm');
-                    blackberry.uninstall(as, dummy_id, temp, path.join(plugins_dir, 'DummyPlugin'));
-                    expect(s).toHaveBeenCalledWith('-Rf', path.join(temp, 'www', 'plugins',
dummy_id));
-                    done();
-                });
-            });
-            it('should remove stuff specified by the element', function(done) {
-                var as = copyArray(assets);
-                install('blackberry', temp, 'DummyPlugin', plugins_dir, {}, function() {
-                    var s = spyOn(shell, 'rm');
-                    blackberry.uninstall(as, dummy_id, temp, path.join(plugins_dir, 'DummyPlugin'));
-                    expect(s).toHaveBeenCalledWith('-Rf', path.join(temp, 'www', 'dummyplugin.js'));
-                    expect(s).toHaveBeenCalledWith('-Rf', path.join(temp, 'www', 'dummyplugin'));
-                    done();
-                });
-            });
-        });
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4be5ea01/spec/platforms/ios.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/ios.spec.js b/spec/platforms/ios.spec.js
index 0c58cc2..2dcee9c 100644
--- a/spec/platforms/ios.spec.js
+++ b/spec/platforms/ios.spec.js
@@ -273,45 +273,6 @@ describe('ios project handler', function() {
                 expect(spy).toHaveBeenCalledWith('-R', path.join(dummyplugin, 'src', 'ios',
'DummyPlugin.bundle'), path.join(temp, 'SampleApp', 'Resources'));
             });
         });
-       // TODO move this shit to install/uninstall 
-       // describe('of <asset> elements', function() {
-       //     beforeEach(function() {
-       //         shell.cp('-rf', ios_config_xml_project, temp);
-       //     });
-       //     it('should throw if asset src cannot be found', function() {
-       //         var assets = copyArray(invalid_assets);
-       //         expect(function() {
-       //             ios.install(assets, faulty_id, temp, faultyplugin, {});
-       //         }).toThrow('"' + path.resolve(faultyplugin, 'www/main.js') + '" not found!');
-       //     });
-       //     it('should throw if asset target already exists', function() {
-       //         var assets = copyArray(valid_assets);
-       //         var target = path.join(temp, 'www', 'dummyplugin.js');
-       //         fs.writeFileSync(target, 'some bs', 'utf-8');
-       //         expect(function() {
-       //             ios.install(assets, dummy_id, temp, dummyplugin, {});
-       //         }).toThrow('"'+ target + '" already exists!');
-       //     });
-       //     it('should cp the file and directory to the right target location', function()
{
-       //         var assets = copyArray(valid_assets);
-       //         var spy_cp = spyOn(shell, 'cp').andCallThrough();
-       //         var spy_mkdir = spyOn(shell, 'mkdir').andCallThrough();
-       //         ios.install(assets, dummy_id, temp, dummyplugin, {});
-       //         expect(spy_mkdir).toHaveBeenCalledWith('-p', path.join(temp, 'www'));
-       //         expect(spy_cp).toHaveBeenCalledWith(path.join(dummyplugin, 'www', 'dummyplugin.js'),
path.join(temp, 'www', 'dummyplugin.js'));
-       //         expect(spy_cp).toHaveBeenCalledWith('-R', path.join(dummyplugin, 'www',
'dummyplugin/*'), path.join(temp, 'www', 'dummyplugin'));
-       //         
-       //         // make sure the file and directory are properly copies
-       //         expect(fs.existsSync(path.join(temp, 'www', 'dummyplugin.js'))).toBe(true);
-       //         expect(fs.statSync(path.join(temp, 'www', 'dummyplugin.js')).isFile()).toBe(true);
-       //         
-       //         expect(fs.existsSync(path.join(temp, 'www', 'dummyplugin'))).toBe(true);
-       //         expect(fs.statSync(path.join(temp, 'www', 'dummyplugin')).isDirectory()).toBe(true);
-       //         
-       //         expect(fs.existsSync(path.join(temp, 'www', 'dummyplugin', 'image.jpg'))).toBe(true);
-       //         expect(fs.statSync(path.join(temp, 'www', 'dummyplugin', 'image.jpg')).isFile()).toBe(true);
-       //     });
-       // });
 
         describe('of <framework> elements', function() {
             beforeEach(function() {
@@ -396,27 +357,6 @@ describe('ios project handler', function() {
             });
         });
 
-        describe('of <asset> elements', function() {
-            beforeEach(function() {
-                shell.cp('-rf', ios_config_xml_project, temp);
-            });
-            it('should call rm on specified asset',function(){
-                var config = copyArray(valid_assets);
-                var spy = spyOn(common, 'removeFile');
-                
-                ios.uninstall(config, dummy_id, temp, dummyplugin);
-                expect(spy).toHaveBeenCalledWith(path.join(temp, 'www'), 'dummyplugin.js');
   
-                expect(spy).toHaveBeenCalledWith(path.join(temp, 'www'), 'dummyplugin');
 
-            });
-            it('should call rm on the www/plugins/<plugin_id> folder',function(){
-                var config = copyArray(valid_assets);
-                var spy = spyOn(common, 'removeFile');
-                
-                ios.uninstall(config, dummy_id, temp, dummyplugin);
-                expect(spy).toHaveBeenCalledWith(path.join(temp, 'www', 'plugins'), dummy_id);
   
-            });
-        });
-
         describe('of <header-file> elements', function() {
             beforeEach(function() {
                 shell.cp('-rf', ios_config_xml_project, temp);

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4be5ea01/src/platforms/android.js
----------------------------------------------------------------------
diff --git a/src/platforms/android.js b/src/platforms/android.js
index bd2583a..cf62f93 100644
--- a/src/platforms/android.js
+++ b/src/platforms/android.js
@@ -71,16 +71,6 @@ function handlePlugin(action, plugin_id, txs, project_dir, plugin_dir,
variables
                         common.deleteJava(project_dir, destFile);
                     }
                     break;
-                case 'asset':
-                    var src = mod.attrib['src'];
-                    var target = mod.attrib['target'];
-                    if (action == 'install') {
-                        common.copyFile(plugin_dir, src, module.exports.www_dir(project_dir),
target);
-                    } else {
-                        common.removeFile(module.exports.www_dir(project_dir), target);
-                        common.removeFileF(path.resolve(module.exports.www_dir(project_dir),
'plugins', plugin_id));
-                    }
-                    break;
                 default:
                     throw new Error('Unrecognized plugin.xml element/action in android installer:
' + mod.tag);
                     break;

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4be5ea01/src/platforms/blackberry.js
----------------------------------------------------------------------
diff --git a/src/platforms/blackberry.js b/src/platforms/blackberry.js
index 0324c62..9643a77 100644
--- a/src/platforms/blackberry.js
+++ b/src/platforms/blackberry.js
@@ -57,16 +57,6 @@ function handlePlugin(action, plugin_id, txs, project_dir, plugin_dir,
variables
                         common.deleteJava(project_dir, destFile);
                     }
                     break;
-                case 'asset':
-                    var src = mod.attrib['src'];
-                    var target = mod.attrib['target'];
-                    if (action == 'install') {
-                        common.copyFile(plugin_dir, src, module.exports.www_dir(project_dir),
target);
-                    } else {
-                        common.removeFile(module.exports.www_dir(project_dir), target);
-                        common.removeFileF(path.resolve(module.exports.www_dir(project_dir),
'plugins', plugin_id));
-                    }
-                    break;
                 default:
                     throw new Error('Unrecognized plugin.xml element/action in blackberry
installer: ' + mod.tag);
                     break;

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4be5ea01/src/platforms/ios.js
----------------------------------------------------------------------
diff --git a/src/platforms/ios.js b/src/platforms/ios.js
index c19273c..4c012d7 100644
--- a/src/platforms/ios.js
+++ b/src/platforms/ios.js
@@ -117,16 +117,6 @@ function handlePlugin(action, plugin_id, txs, project_dir, plugin_dir,
variables
                         }
                     }
                     break;
-                case 'asset':
-                    var src = mod.attrib['src'];
-                    var target = mod.attrib['target'];
-                    if (action == 'install') {
-                        common.copyFile(plugin_dir, src, module.exports.www_dir(project_dir),
target);
-                    } else {
-                        common.removeFile(module.exports.www_dir(project_dir), target);
-                        common.removeFile(path.join(module.exports.www_dir(project_dir),
'plugins'), plugin_id);
-                    }
-                    break;
                 case 'header-file':
                     var src = mod.attrib['src'];
                     var srcFile = path.resolve(plugin_dir, src);


Mime
View raw message