Updated Branches:
refs/heads/master 9f9a4700d -> 1cd301219
Fix copy of .java files being put in the wrong place.
Apparanetly sh.cp('-r') treats dst as a directory instead of having the
same behaviour as cp on the command line.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/1cd30121
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/1cd30121
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/1cd30121
Branch: refs/heads/master
Commit: 1cd3012198a10e62d4189f5b29c237d6309987bb
Parents: 9f9a470
Author: Andrew Grieve <[email protected]>
Authored: Wed Apr 24 13:51:25 2013 -0400
Committer: Andrew Grieve <[email protected]>
Committed: Wed Apr 24 13:51:25 2013 -0400
----------------------------------------------------------------------
spec/platforms/android.spec.js | 4 ++--
spec/platforms/blackberry.spec.js | 4 ++--
spec/platforms/common.spec.js | 4 ++--
src/platforms/android.js | 2 +-
src/platforms/blackberry.js | 2 +-
src/platforms/common.js | 4 ++--
6 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1cd30121/spec/platforms/android.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/android.spec.js b/spec/platforms/android.spec.js
index 277147a..d3c279f 100644
--- a/spec/platforms/android.spec.js
+++ b/spec/platforms/android.spec.js
@@ -69,9 +69,9 @@ describe('android project handler', function() {
shell.cp('-rf', android_one_project, temp);
});
- it('should copy stuff from one location to another by calling
common.straightCopy', function() {
+ it('should copy stuff from one location to another by calling
common.copyFile', function() {
var source = copyArray(valid_source);
- var s = spyOn(common, 'straightCopy');
+ var s = spyOn(common, 'copyFile');
android.install(source, dummy_id, temp, dummyplugin, {});
expect(s).toHaveBeenCalledWith(dummyplugin,
'src/android/DummyPlugin.java', temp,
'src/com/phonegap/plugins/dummyplugin/DummyPlugin.java');
});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1cd30121/spec/platforms/blackberry.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/blackberry.spec.js
b/spec/platforms/blackberry.spec.js
index a06c2b7..3976096 100644
--- a/spec/platforms/blackberry.spec.js
+++ b/spec/platforms/blackberry.spec.js
@@ -56,9 +56,9 @@ describe('blackberry project handler', function() {
shell.rm('-rf', temp);
});
describe('of <source-file> elements', function() {
- it('should copy stuff from one location to another by calling
common.straightCopy', function() {
+ it('should copy stuff from one location to another by calling
common.copyFile', function() {
var source = copyArray(valid_source);
- var s = spyOn(common, 'straightCopy');
+ var s = spyOn(common, 'copyFile');
blackberry.install(source, dummy_id, temp, dummyplugin, {});
expect(s).toHaveBeenCalledWith(dummyplugin,
'src/blackberry/client.js', temp, 'ext-qnx/cordova.echo/client.js');
expect(s).toHaveBeenCalledWith(dummyplugin,
'src/blackberry/index.js', temp, 'ext-qnx/cordova.echo/index.js');
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1cd30121/spec/platforms/common.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/common.spec.js b/spec/platforms/common.spec.js
index 9c568a5..65f8077 100644
--- a/spec/platforms/common.spec.js
+++ b/spec/platforms/common.spec.js
@@ -11,11 +11,11 @@ describe('common platform handler', function() {
it('should not throw if path cannot be resolved');
});
- describe('straightCopy', function() {
+ describe('copyFile', function() {
it('should throw if source path cannot be resolved');
it('should throw if target path exists');
it('should call mkdir -p on target path');
- it('should call cp -f with source/dest paths');
+ it('should call cp with source/dest paths');
});
describe('deleteJava', function() {
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1cd30121/src/platforms/android.js
----------------------------------------------------------------------
diff --git a/src/platforms/android.js b/src/platforms/android.js
index 8b696a6..3d0e75d 100644
--- a/src/platforms/android.js
+++ b/src/platforms/android.js
@@ -59,7 +59,7 @@ function handlePlugin(action, plugin_id, txs, project_dir,
plugin_dir, variables
var destFile = path.join(mod.attrib['target-dir'],
path.basename(mod.attrib['src']));
if (action == 'install') {
- common.straightCopy(plugin_dir, mod.attrib['src'],
project_dir, destFile);
+ common.copyFile(plugin_dir, mod.attrib['src'],
project_dir, destFile);
} else {
common.deleteJava(project_dir, destFile);
}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1cd30121/src/platforms/blackberry.js
----------------------------------------------------------------------
diff --git a/src/platforms/blackberry.js b/src/platforms/blackberry.js
index 029378a..d740559 100644
--- a/src/platforms/blackberry.js
+++ b/src/platforms/blackberry.js
@@ -47,7 +47,7 @@ function handlePlugin(action, plugin_id, txs, project_dir,
plugin_dir, variables
var destFile = path.join(mod.attrib['target-dir'],
path.basename(mod.attrib['src']));
if (action == 'install') {
- common.straightCopy(plugin_dir, mod.attrib['src'],
project_dir, destFile);
+ common.copyFile(plugin_dir, mod.attrib['src'],
project_dir, destFile);
} else {
common.deleteJava(project_dir, destFile);
}
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1cd30121/src/platforms/common.js
----------------------------------------------------------------------
diff --git a/src/platforms/common.js b/src/platforms/common.js
index 597a79b..fe2bc4f 100644
--- a/src/platforms/common.js
+++ b/src/platforms/common.js
@@ -18,11 +18,11 @@ module.exports = {
else return full_path;
},
// Many times we simply need to copy shit over, knowing if a source path
doesnt exist or if a target path already exists
- straightCopy:function(plugin_dir, src, project_dir, dest) {
+ copyFile:function(plugin_dir, src, project_dir, dest) {
src = module.exports.resolveSrcPath(plugin_dir, src);
dest = module.exports.resolveTargetPath(project_dir, dest);
shell.mkdir('-p', path.dirname(dest));
- shell.cp('-r', src, dest);
+ shell.cp(src, dest);
},
// Sometimes we want to remove some java, and prune any unnecessary empty
directories
deleteJava:function(project_dir, destFile) {