cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/2] cordova-lib git commit: Revert "CB-8244 android: Have `plugin add --link` create symlinks for `<source-file>`, `<framework>`, etc"
Date Tue, 06 Jan 2015 22:53:39 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 197c49a17 -> 4430ed266


Revert "CB-8244 android: Have `plugin add --link` create symlinks for `<source-file>`,
`<framework>`, etc"

This reverts commit 197c49a1727fab676543595867aa3557966f7d12.


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/16755c7d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/16755c7d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/16755c7d

Branch: refs/heads/master
Commit: 16755c7dac6f6ae5dfc85317e7c6f65f3488e9f5
Parents: 197c49a
Author: Steve Gill <stevengill97@gmail.com>
Authored: Tue Jan 6 14:52:43 2015 -0800
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Tue Jan 6 14:52:43 2015 -0800

----------------------------------------------------------------------
 cordova-lib/src/cordova/plugin.js            |  1 -
 cordova-lib/src/plugman/platforms/android.js |  8 ++++----
 cordova-lib/src/plugman/platforms/common.js  | 13 ++++++-------
 3 files changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/16755c7d/cordova-lib/src/cordova/plugin.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/plugin.js b/cordova-lib/src/cordova/plugin.js
index f954a14..805518d 100644
--- a/cordova-lib/src/cordova/plugin.js
+++ b/cordova-lib/src/cordova/plugin.js
@@ -141,7 +141,6 @@ module.exports = function plugin(command, targets, opts) {
                                         browserify: opts.browserify || false,
                                         searchpath: searchPath,
                                         noregistry: opts.noregistry,
-                                        link: opts.link
                                     },
                                     tokens,
                                     key,

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/16755c7d/cordova-lib/src/plugman/platforms/android.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/android.js b/cordova-lib/src/plugman/platforms/android.js
index aad54b4..2c47b22 100644
--- a/cordova-lib/src/plugman/platforms/android.js
+++ b/cordova-lib/src/plugman/platforms/android.js
@@ -62,7 +62,7 @@ module.exports = {
             }
             var dest = path.join(targetDir, path.basename(src));
 
-            common.copyNewFile(plugin_dir, src, project_dir, dest, options.link);
+            common.copyNewFile(plugin_dir, src, project_dir, dest);
         },
         uninstall:function(source_el, project_dir, plugin_id) {
             var dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib['src']));
@@ -81,7 +81,7 @@ module.exports = {
         install:function(lib_el, plugin_dir, project_dir, plugin_id, options) {
             var src = lib_el.attrib.src;
             var dest = path.join('libs', path.basename(src));
-            common.copyFile(plugin_dir, src, project_dir, dest, options.link);
+            common.copyFile(plugin_dir, src, project_dir, dest);
         },
         uninstall:function(lib_el, project_dir, plugin_id) {
             var src = lib_el.attrib.src;
@@ -94,7 +94,7 @@ module.exports = {
             var src = el.attrib.src;
             var target = el.attrib.target;
             events.emit('verbose', 'Copying resource file ' + src + ' to ' + target);
-            common.copyFile(plugin_dir, src, project_dir, path.normalize(target), options.link);
+            common.copyFile(plugin_dir, src, project_dir, path.normalize(target));
         },
         uninstall:function(el, project_dir, plugin_id) {
             var target = el.attrib.target;
@@ -114,7 +114,7 @@ module.exports = {
 
             if (custom) {
                 var subRelativeDir = module.exports.getCustomSubprojectRelativeDir(plugin_id,
project_dir, src);
-                common.copyNewFile(plugin_dir, src, project_dir, subRelativeDir, options.link);
+                common.copyNewFile(plugin_dir, src, project_dir, subRelativeDir);
                 subDir = path.resolve(project_dir, subRelativeDir);
             } else {
                 var sdk_dir = module.exports.getProjectSdkDir(project_dir);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/16755c7d/cordova-lib/src/plugman/platforms/common.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/common.js b/cordova-lib/src/plugman/platforms/common.js
index 14ed0ad..2226d0c 100644
--- a/cordova-lib/src/plugman/platforms/common.js
+++ b/cordova-lib/src/plugman/platforms/common.js
@@ -37,7 +37,8 @@ module.exports = common = {
         var full_path = path.resolve(project_dir, relative_path);
         return full_path;
     },
-    copyFile:function(plugin_dir, src, project_dir, dest, /* optional */ link) {
+    // Many times we simply need to copy shit over, knowing if a source path doesnt exist
or if a target path already exists
+    copyFile:function(plugin_dir, src, project_dir, dest) {
         src = module.exports.resolveSrcPath(plugin_dir, src);
         if (!fs.existsSync(src)) throw new Error('"' + src + '" not found!');
 
@@ -55,22 +56,20 @@ module.exports = common = {
 
         shell.mkdir('-p', path.dirname(dest));
 
-        if (link) {
-            fs.symlinkSync(path.relative(path.dirname(dest), src), dest);
-        } else if (fs.statSync(src).isDirectory()) {
-            // XXX shelljs decides to create a directory when -R|-r is used which sucks.
http://goo.gl/nbsjq
+        // XXX shelljs decides to create a directory when -R|-r is used which sucks. http://goo.gl/nbsjq
+        if(fs.statSync(src).isDirectory()) {
             shell.cp('-Rf', src+'/*', dest);
         } else {
             shell.cp('-f', src, dest);
         }
     },
     // Same as copy file but throws error if target exists
-    copyNewFile:function(plugin_dir, src, project_dir, dest, /* optional */ link) {
+    copyNewFile:function(plugin_dir, src, project_dir, dest) {
         var target_path = common.resolveTargetPath(project_dir, dest);
         if (fs.existsSync(target_path))
             throw new Error('"' + target_path + '" already exists!');
 
-        common.copyFile(plugin_dir, src, project_dir, dest, link);
+        common.copyFile(plugin_dir, src, project_dir, dest);
     },
     // checks if file exists and then deletes. Error if doesn't exist
     removeFile:function(project_dir, src) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message