cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject git commit: add full ff support to plugman
Date Sat, 24 Aug 2013 01:44:00 GMT
Updated Branches:
  refs/heads/ffos 0192d1ab2 -> ecc6a85f5


add full ff support to plugman


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

Branch: refs/heads/ffos
Commit: ecc6a85f56f2d8c999dd1ec8c4412e7d6aad5095
Parents: 0192d1a
Author: Steven Gill <stevengill97@gmail.com>
Authored: Fri Aug 23 18:43:54 2013 -0700
Committer: Steven Gill <stevengill97@gmail.com>
Committed: Fri Aug 23 18:43:54 2013 -0700

----------------------------------------------------------------------
 main.js                       |  2 +-
 plugman.js                    |  2 +-
 src/install.js                |  5 +----
 src/platforms/blackberry10.js |  2 ++
 src/platforms/firefoxos.js    | 18 +++++++++++++++++-
 src/util/config-changes.js    |  3 +--
 6 files changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ecc6a85f/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 88fd7f2..47e63c6 100755
--- a/main.js
+++ b/main.js
@@ -26,7 +26,7 @@ var path = require('path')
     , plugins = require('./src/util/plugins')
     , plugman = require('./plugman');
 
-var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8' , 'windows8'
]
+var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8' , 'windows8',
'firefoxos' ]
         , 'project' : path
         , 'plugin' : [String, path, url]
         , 'version' : Boolean

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ecc6a85f/plugman.js
----------------------------------------------------------------------
diff --git a/plugman.js b/plugman.js
index b921f4d..439916a 100755
--- a/plugman.js
+++ b/plugman.js
@@ -45,7 +45,7 @@ plugman.commands =  {
     },
     'install'  : function(cli_opts) {
         if(!cli_opts.platform || !cli_opts.project || !cli_opts.plugin) {
-            return console.log(plugman.help());
+            return //console.log(plugman.help());
         }
         var cli_variables = {}
         if (cli_opts.variable) {

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ecc6a85f/src/install.js
----------------------------------------------------------------------
diff --git a/src/install.js b/src/install.js
index 556ac7e..a0e8558 100644
--- a/src/install.js
+++ b/src/install.js
@@ -37,9 +37,7 @@ module.exports = function installPlugin(platform, project_dir, id, plugins_dir,
         if (callback) return callback(err);
         else throw err;
     }
-
     var current_stack = new action_stack();
-
     options.is_top_level = true;
     possiblyFetch(current_stack, platform, project_dir, id, plugins_dir, options, callback);
 };
@@ -256,7 +254,7 @@ function handleInstall(actions, plugin_id, plugin_et, platform, project_dir,
plu
             resourceFiles = platformTag.findall('./resource-file'),
             libFiles = platformTag.findall('./lib-file');
         assets = assets.concat(platformTag.findall('./asset'));
-
+        
         // queue up native stuff
         sourceFiles && sourceFiles.forEach(function(source) {
             actions.push(actions.createAction(handler["source-file"].install, [source, plugin_dir,
project_dir, plugin_id], handler["source-file"].uninstall, [source, project_dir, plugin_id]));
@@ -287,7 +285,6 @@ function handleInstall(actions, plugin_id, plugin_et, platform, project_dir,
plu
             if (callback) callback(err);
             else throw err;
         } else {
-
             // queue up the plugin so prepare knows what to do.
             config_changes.add_installed_plugin_to_prepare_queue(plugins_dir, plugin_basename,
platform, filtered_variables, is_top_level);
             // call prepare after a successful install

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ecc6a85f/src/platforms/blackberry10.js
----------------------------------------------------------------------
diff --git a/src/platforms/blackberry10.js b/src/platforms/blackberry10.js
index c3d1ce9..bb9f2e1 100644
--- a/src/platforms/blackberry10.js
+++ b/src/platforms/blackberry10.js
@@ -37,8 +37,10 @@ module.exports = {
         install:function(source_el, plugin_dir, project_dir, plugin_id) {
             var src = source_el.attrib['src'];
             var target = source_el.attrib['target-dir'] || plugin_id;
+            console.log(target);
             TARGETS.forEach(function(arch) {
                 var dest = path.join("native", arch, "chrome", "plugin", target, path.basename(src));
+                console.log(dest);
                 common.copyFile(plugin_dir, src, project_dir, dest);
             });
         },

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ecc6a85f/src/platforms/firefoxos.js
----------------------------------------------------------------------
diff --git a/src/platforms/firefoxos.js b/src/platforms/firefoxos.js
index d177318..db325d3 100644
--- a/src/platforms/firefoxos.js
+++ b/src/platforms/firefoxos.js
@@ -1,7 +1,23 @@
-var path = require('path');
+var path = require('path')
+    , common = require('./common');
 
 module.exports = {
     www_dir: function(project_dir) {
         return path.join(project_dir, 'www');
+    },
+    package_name:function(project_dir) {
+        var config_path = path.join(module.exports.www_dir(project_dir), 'config.xml');
+        var widget_doc = xml_helpers.parseElementtreeSync(config_path);
+        return widget_doc._root.attrib['id'];
+    },
+    "source-file":{
+        install:function(source_el, plugin_dir, project_dir, plugin_id) {
+            var dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib['src']));
+            common.copyFile(plugin_dir, source_el.attrib['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']));
+            common.removeFile(project_dir, dest);
+        }
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ecc6a85f/src/util/config-changes.js
----------------------------------------------------------------------
diff --git a/src/util/config-changes.js b/src/util/config-changes.js
index 3c79bde..7ebd8b8 100644
--- a/src/util/config-changes.js
+++ b/src/util/config-changes.js
@@ -55,7 +55,6 @@ var keep_these_frameworks = [
 module.exports = {
     add_installed_plugin_to_prepare_queue:function(plugins_dir, plugin, platform, vars, is_top_level)
{
         checkPlatform(platform);
-
         var config = module.exports.get_platform_json(plugins_dir, platform);
         config.prepare_queue.installed.push({'plugin':plugin, 'vars':vars, 'topLevel':is_top_level});
         module.exports.save_platform_json(config, plugins_dir, platform);
@@ -284,6 +283,7 @@ module.exports = {
     add_plugin_changes:function(platform, project_dir, plugins_dir, plugin_id, plugin_vars,
is_top_level, should_increment) {
         var platform_config = module.exports.get_platform_json(plugins_dir, platform);
         var plugin_dir = path.join(plugins_dir, plugin_id);
+        
         plugin_id = xml_helpers.parseElementtreeSync(path.join(plugin_dir, 'plugin.xml'),
'utf-8')._root.attrib['id'];
 
         // get config munge, aka how should this plugin change various config files
@@ -409,7 +409,6 @@ module.exports = {
         checkPlatform(platform);
 
         var platform_config = module.exports.get_platform_json(plugins_dir, platform);
-
         // Uninstallation first
         platform_config.prepare_queue.uninstalled.forEach(function(u) {
             module.exports.remove_plugin_changes(platform, project_dir, plugins_dir, u.plugin,
u.id, u.topLevel, true);


Mime
View raw message