Repository: cordova-lib
Updated Branches:
  refs/heads/master cdcb4bcbc -> f513412a3


CB-11259: Improving prepare and build logging

This closes #439


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

Branch: refs/heads/master
Commit: f513412a30be34a1e846d1f81deb2350d435447b
Parents: cdcb4bc
Author: Richard Knoll <richard.b.kn...@gmail.com>
Authored: Mon May 2 10:54:21 2016 -0700
Committer: Richard Knoll <richard.b.kn...@gmail.com>
Committed: Thu May 12 16:06:05 2016 -0700

----------------------------------------------------------------------
 cordova-common/src/ConfigChanges/ConfigFile.js |  4 ++--
 cordova-common/src/PluginInfo/PluginInfo.js    |  2 +-
 cordova-common/src/events.js                   |  2 +-
 cordova-lib/spec-cordova/plugin_fetch.spec.js  |  2 +-
 cordova-lib/spec-plugman/install.spec.js       |  2 +-
 cordova-lib/src/cordova/create.js              | 10 ++++-----
 cordova-lib/src/cordova/platform.js            |  8 +++----
 cordova-lib/src/cordova/plugin.js              | 21 ++++++++++--------
 cordova-lib/src/cordova/prepare.js             |  6 +++---
 cordova-lib/src/cordova/restore-util.js        | 16 ++++++++------
 cordova-lib/src/hooks/HooksRunner.js           | 24 +++++++++++++++++++--
 cordova-lib/src/hooks/scriptsFinder.js         |  3 +--
 cordova-lib/src/plugman/browserify.js          |  4 ++--
 cordova-lib/src/plugman/fetch.js               |  2 +-
 cordova-lib/src/plugman/install.js             | 12 +++++------
 15 files changed, 72 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-common/src/ConfigChanges/ConfigFile.js
----------------------------------------------------------------------
diff --git a/cordova-common/src/ConfigChanges/ConfigFile.js 
b/cordova-common/src/ConfigChanges/ConfigFile.js
index ad12f38..9c540b9 100644
--- a/cordova-common/src/ConfigChanges/ConfigFile.js
+++ b/cordova-common/src/ConfigChanges/ConfigFile.js
@@ -105,13 +105,13 @@ ConfigFile.prototype.graft_child = function 
ConfigFile_graft_child(selector, xml
         var xml_to_graft = [modules.et.XML(xml_child.xml)];
         result = modules.xml_helpers.graftXML(self.data, xml_to_graft, 
selector, xml_child.after);
         if ( !result) {
-            throw new Error('grafting xml at selector "' + selector + '" from 
"' + filepath + '" during config install went bad :(');
+            throw new Error('Unable to graft xml at selector "' + selector + 
'" from "' + filepath + '" during config install');
         }
     } else {
         // plist file
         result = modules.plist_helpers.graftPLIST(self.data, xml_child.xml, 
selector);
         if ( !result ) {
-            throw new Error('grafting to plist "' + filepath + '" during 
config install went bad :(');
+            throw new Error('Unable to graft plist "' + filepath + '" during 
config install');
         }
     }
     self.is_changed = true;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-common/src/PluginInfo/PluginInfo.js
----------------------------------------------------------------------
diff --git a/cordova-common/src/PluginInfo/PluginInfo.js 
b/cordova-common/src/PluginInfo/PluginInfo.js
index e1a1b31..77199ec 100644
--- a/cordova-common/src/PluginInfo/PluginInfo.js
+++ b/cordova-common/src/PluginInfo/PluginInfo.js
@@ -331,7 +331,7 @@ function PluginInfo(dirname) {
     ///// PluginInfo Constructor logic  /////
     self.filepath = path.join(dirname, 'plugin.xml');
     if (!fs.existsSync(self.filepath)) {
-        throw new CordovaError('Cannot find plugin.xml for plugin \'' + 
path.basename(dirname) + '\'. Please try adding it again.');
+        throw new CordovaError('Cannot find plugin.xml for plugin "' + 
path.basename(dirname) + '". Please try adding it again.');
     }
 
     self.dir = dirname;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-common/src/events.js
----------------------------------------------------------------------
diff --git a/cordova-common/src/events.js b/cordova-common/src/events.js
index 8751976..e702bd8 100644
--- a/cordova-common/src/events.js
+++ b/cordova-common/src/events.js
@@ -40,7 +40,7 @@ module.exports.forwardEventsTo = function (eventEmitter) {
     }
 
     if (!(eventEmitter instanceof EventEmitter))
-        throw new Error('Cordova events could be redirected to another 
EventEmitter instance only');
+        throw new Error('Cordova events can be redirected to another 
EventEmitter instance only');
 
     // CB-10940 Skipping forwarding to self to avoid infinite recursion.
     // This is the case when the modules are npm-linked.

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/spec-cordova/plugin_fetch.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/plugin_fetch.spec.js 
b/cordova-lib/spec-cordova/plugin_fetch.spec.js
index 107b539..e4c4d45 100644
--- a/cordova-lib/spec-cordova/plugin_fetch.spec.js
+++ b/cordova-lib/spec-cordova/plugin_fetch.spec.js
@@ -48,7 +48,7 @@ var warnings = [];
 
 // Used to extract the constraint, the installed version, and the required
 // semver range from a warning message
-var UNMET_REQ_REGEX = /\s+([^\s]+)[^\d]+(\d+\.\d+\.\d+) installed, (.+) 
required\)/;
+var UNMET_REQ_REGEX = /\s+([^\s]+)[^\d]+(\d+\.\d+\.\d+) in project, (.+) 
required\)/;
 
 // We generate warnings when we don't fetch latest. Collect them to make sure 
we
 // are making the correct warnings

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/spec-plugman/install.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/install.spec.js 
b/cordova-lib/spec-plugman/install.spec.js
index 0e1e5cd..442f75f 100644
--- a/cordova-lib/spec-plugman/install.spec.js
+++ b/cordova-lib/spec-plugman/install.spec.js
@@ -531,7 +531,7 @@ describe('install', function() {
                 fail = jasmine.createSpy('fail').andCallFake(function(err) {
                     // <engine name="path-escaping-plugin" version=">=1.0.0" 
scriptSrc="../../../malicious/script" platform="*" />
                     expect(err).toBeDefined();
-                    expect(err.message.indexOf('security violation:')).toBe(0);
+                    expect(err.message.indexOf('Security violation:')).toBe(0);
                 });
 
             spyOn(PlatformJson.prototype, 
'isPluginInstalled').andReturn(false);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/cordova/create.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/create.js 
b/cordova-lib/src/cordova/create.js
index 0960131..7f5c2d3 100644
--- a/cordova-lib/src/cordova/create.js
+++ b/cordova-lib/src/cordova/create.js
@@ -54,7 +54,7 @@ function create(dir, optionalId, optionalName, cfg) {
         }
 
         if (!dir) {
-            throw new CordovaError('At least the dir must be provided to 
create new project. See `' + cordova_util.binname + ' help`.');
+            throw new CordovaError('Directory not specified. See `' + 
cordova_util.binname + ' help`.');
         }
 
         //read projects .cordova/config.json file for project settings
@@ -222,17 +222,17 @@ function create(dir, optionalId, optionalName, cfg) {
     })
     .then(function(input_directory) {
         var import_from_path = input_directory;
-        
-        //handle when input wants to specify sub-directory 
+
+        //handle when input wants to specify sub-directory
         try {
             var templatePkg = require(input_directory);
             if (templatePkg && templatePkg.dirname){
                 import_from_path = templatePkg.dirname;
             }
         } catch (e) {
-            events.emit('verbose', 'Can not load template package.json using 
directory ' + input_directory); 
+            events.emit('verbose', 'Can not load template package.json using 
directory ' + input_directory);
         }
-         
+
         if (!fs.existsSync(import_from_path)) {
             throw new CordovaError('Could not find directory: ' +
                 import_from_path);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js 
b/cordova-lib/src/cordova/platform.js
index 19f4edf..7490b5d 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -209,7 +209,7 @@ function addHelper(cmd, hooksRunner, projectRoot, targets, 
opts) {
                     // source location was specified, we always save that. 
Otherwise we save the version that was
                     // actually installed.
                     var versionToSave = saveVersion ? platDetails.version : 
spec;
-                    events.emit('verbose', 'saving ' + platform + '@' + 
versionToSave + ' into platforms.json');
+                    events.emit('verbose', 'Saving ' + platform + '@' + 
versionToSave + ' into platforms.json');
                     platformMetadata.save(projectRoot, platform, 
versionToSave);
 
                     if(opts.save || autosave){
@@ -356,7 +356,7 @@ function getVersionFromConfigFile(platform, cfg) {
 
 function remove(hooksRunner, projectRoot, targets, opts) {
     if (!targets || !targets.length) {
-        return Q.reject(new CordovaError('No platform[s] specified. Please 
specify platform[s] to remove. See `'+cordova_util.binname+' platform list`.'));
+        return Q.reject(new CordovaError('No platform(s) specified. Please 
specify platform(s) to remove. See `'+cordova_util.binname+' platform list`.'));
     }
     return hooksRunner.fire('before_platform_rm', opts)
     .then(function() {
@@ -372,7 +372,7 @@ function remove(hooksRunner, projectRoot, targets, opts) {
                 var platformName = target.split('@')[0];
                 var xml = cordova_util.projectConfig(projectRoot);
                 var cfg = new ConfigParser(xml);
-                events.emit('log', 'Removing ' + target + ' from config.xml 
file ...');
+                events.emit('log', 'Removing platform ' + target + ' from 
config.xml file...');
                 cfg.removeEngine(platformName);
                 cfg.write();
             });
@@ -380,7 +380,7 @@ function remove(hooksRunner, projectRoot, targets, opts) {
     }).then(function() {
         // Remove targets from platforms.json
         targets.forEach(function(target) {
-            events.emit('verbose', 'Removing ' + target + ' from 
platforms.json file ...');
+            events.emit('verbose', 'Removing platform ' + target + ' from 
platforms.json file...');
             platformMetadata.remove(projectRoot, target);
         });
     }).then(function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/cordova/plugin.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/plugin.js 
b/cordova-lib/src/cordova/plugin.js
index 74f1cca..cf7fdac 100644
--- a/cordova-lib/src/cordova/plugin.js
+++ b/cordova-lib/src/cordova/plugin.js
@@ -162,7 +162,7 @@ module.exports = function plugin(command, targets, opts) {
                             });
 
                             if (missingVariables.length) {
-                                events.emit('verbose', 'Removing ' + 
pluginInfo.dir + ' due to installation failure');
+                                events.emit('verbose', 'Removing ' + 
pluginInfo.dir + ' because mandatory plugin variables were missing.');
                                 shell.rm('-rf', pluginInfo.dir);
                                 var msg = 'Variable(s) missing (use: 
--variable ' + missingVariables.join('=value --variable ') + '=value).';
                                 return Q.reject(new CordovaError(msg));
@@ -281,12 +281,12 @@ module.exports = function plugin(command, targets, opts) {
                         }).then(function(){
                             //remove plugin from config.xml
                             if(saveToConfigXmlOn(config_json, opts)){
+                                events.emit('log', 'Removing plugin ' + target 
+ ' from config.xml file...');
                                 var configPath = 
cordova_util.projectConfig(projectRoot);
                                 if(fs.existsSync(configPath)){//should not 
happen with real life but needed for tests
                                     var configXml = new 
ConfigParser(configPath);
                                     configXml.removePlugin(target);
                                     configXml.write();
-                                    events.emit('results', 'config.xml entry 
for ' +target+ ' is removed');
                                 }
                             }
                         })
@@ -345,7 +345,7 @@ function determinePluginTarget(projectRoot, cfg, target, 
fetchOptions) {
     }
 
     // If no version is specified, retrieve the version (or source) from 
config.xml
-    events.emit('verbose', 'No version specified, retrieving version from 
config.xml');
+    events.emit('verbose', 'No version specified for ' + parsedSpec.package + 
', retrieving version from config.xml');
     var ver = getVersionFromConfigFile(id, cfg);
 
     if (cordova_util.isUrl(ver) || cordova_util.isDirectory(ver) || 
pluginSpec.parse(ver).scope) {
@@ -362,14 +362,17 @@ function determinePluginTarget(projectRoot, cfg, target, 
fetchOptions) {
     // their package.json
     var shouldUseNpmInfo = !fetchOptions.searchpath && 
!fetchOptions.noregistry;
 
+    events.emit('verbose', 'No version for ' + parsedSpec.package + ' saved in 
config.xml');
     if(shouldUseNpmInfo) {
-        events.emit('verbose', 'No version given in config.xml, attempting to 
use plugin engine info');
+        events.emit('verbose', 'Attempting to use npm info for ' + 
parsedSpec.package + ' to choose a compatible release');
+    } else {
+        events.emit('verbose', 'Not checking npm info for ' + 
parsedSpec.package + ' because searchpath or noregistry flag was given');
     }
 
-    return (shouldUseNpmInfo ? registry.info([id]) : Q({}))
+    return (shouldUseNpmInfo ? registry.info([id])
     .then(function(pluginInfo) {
         return getFetchVersion(projectRoot, pluginInfo, pkgJson.version);
-    })
+    }) : Q(null))
     .then(function(fetchVersion) {
         return fetchVersion ? (id + '@' + fetchVersion) : target;
     });
@@ -385,7 +388,7 @@ function validatePluginId(pluginId, installedPlugins) {
 
     var oldStylePluginId = pluginMapper[pluginId];
     if (oldStylePluginId) {
-        events.emit('log', 'Plugin "' + pluginId + '" is not present in the 
project. Converting value to "' + oldStylePluginId + '" and trying again.');
+        events.emit('log', 'Plugin "' + pluginId + '" is not present in the 
project. Checking for legacy id "' + oldStylePluginId + '".');
         return installedPlugins.indexOf(oldStylePluginId) >= 0 ? 
oldStylePluginId : null;
     }
 
@@ -641,7 +644,7 @@ function getFetchVersion(projectRoot, pluginInfo, 
cordovaVersion) {
         });
     } else {
         // If we have no engine, we want to fall back to the default behavior
-        events.emit('verbose', 'No plugin engine info found or not using 
registry, falling back to latest version');
+        events.emit('verbose', 'npm info for ' + pluginInfo.name + ' did not 
contain any engine info. Fetching latest release');
         return Q(null);
     }
 }
@@ -827,6 +830,6 @@ function listUnmetRequirements(name, failedRequirements) {
     events.emit('warn', 'Unmet project requirements for latest version of ' + 
name + ':');
 
     failedRequirements.forEach(function(req) {
-        events.emit('warn', '    ' + req.dependency + ' (' + req.installed + ' 
installed, ' + req.required + ' required)');
+        events.emit('warn', '    ' + req.dependency + ' (' + req.installed + ' 
in project, ' + req.required + ' required)');
     });
 }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/cordova/prepare.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/prepare.js 
b/cordova-lib/src/cordova/prepare.js
index 7484ba1..ff4f119 100644
--- a/cordova-lib/src/cordova/prepare.js
+++ b/cordova-lib/src/cordova/prepare.js
@@ -140,7 +140,7 @@ module.exports.preparePlatforms = preparePlatforms;
  *   plugins reinstalled properly.
  */
 function restoreMissingPluginsForPlatform(platform, projectRoot, options) {
-    events.emit('verbose', 'Searching PlatformJson files for differences 
between project vs. platform installed plugins');
+    events.emit('verbose', 'Checking for any plugins added to the project that 
have not been installed in ' + platform + ' platform');
 
     // Flow:
     // 1. Compare <platform>.json file in <project>/plugins ("old") and 
platforms/<platform> ("new")
@@ -163,7 +163,7 @@ function restoreMissingPluginsForPlatform(platform, 
projectRoot, options) {
         }, []);
 
     if (missingPlugins.length === 0) {
-        events.emit('verbose', 'No differences found between project and ' +
+        events.emit('verbose', 'No differences found between plugins added to 
project and installed in ' +
             platform + ' platform. Continuing...');
         return Q.resolve();
     }
@@ -176,7 +176,7 @@ function restoreMissingPluginsForPlatform(platform, 
projectRoot, options) {
             pluginOptions.variables = plugin.variables;
             pluginOptions.usePlatformWww = true;
 
-            events.emit('verbose', 'Reinstalling missing plugin ' + 
plugin.name + ' to ' + platform + ' platform');
+            events.emit('verbose', 'Reinstalling missing plugin ' + 
plugin.name + ' in ' + platform + ' platform');
             var pluginInfo = provider.get(path.join(projectRoot, 'plugins', 
plugin.name));
             return api.removePlugin(pluginInfo, pluginOptions)
             .then(function () {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/cordova/restore-util.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/restore-util.js 
b/cordova-lib/src/cordova/restore-util.js
index 25cb11e..ce14903 100644
--- a/cordova-lib/src/cordova/restore-util.js
+++ b/cordova-lib/src/cordova/restore-util.js
@@ -32,6 +32,8 @@ exports.installPlatformsFromConfigXML = 
installPlatformsFromConfigXML;
 
 
 function installPlatformsFromConfigXML(platforms, opts) {
+    events.emit('verbose', 'Checking config.xml for saved platforms that 
haven\'t been added to the project');
+
     var projectHome = cordova_util.cdProjectRoot();
     var configPath = cordova_util.projectConfig(projectHome);
     var cfg = new ConfigParser(configPath);
@@ -54,7 +56,7 @@ function installPlatformsFromConfigXML(platforms, opts) {
     });
 
     if (!targets || !targets.length) {
-        return Q('No platforms are listed in config.xml to restore');
+        return Q('No platforms found in config.xml that haven\'t been added to 
the project');
     }
 
 
@@ -66,7 +68,7 @@ function installPlatformsFromConfigXML(platforms, opts) {
     // gets executed simultaneously by each platform and leads to an exception 
being thrown
     return promiseutil.Q_chainmap_graceful(targets, function(target) {
         if (target) {
-            events.emit('log', 'Restoring platform ' + target + ' referenced 
on config.xml');
+            events.emit('log', 'Discovered platform \"' + target + '\" in 
config.xml. Adding it to the project');
             return cordova.raw.platform('add', target, opts);
         }
         return Q();
@@ -77,6 +79,8 @@ function installPlatformsFromConfigXML(platforms, opts) {
 
 //returns a Promise
 function installPluginsFromConfigXML(args) {
+    events.emit('verbose', 'Checking config.xml for saved plugins that 
haven\'t been added to the project');
+
     //Install plugins that are listed on config.xml
     var projectRoot = cordova_util.cdProjectRoot();
     var configPath = cordova_util.projectConfig(projectRoot);
@@ -86,7 +90,7 @@ function installPluginsFromConfigXML(args) {
     // Get all configured plugins
     var plugins = cfg.getPluginIdList();
     if (0 === plugins.length) {
-        return Q('No config.xml plugins to install');
+        return Q('No plugins found in config.xml that haven\'t been added to 
the project');
     }
 
 
@@ -104,7 +108,7 @@ function installPluginsFromConfigXML(args) {
             // Plugin already exists
             return Q();
         }
-        events.emit('log', 'Discovered plugin "' + featureId + '" in 
config.xml. Installing to the project');
+        events.emit('log', 'Discovered plugin "' + featureId + '" in 
config.xml. Adding it to the project');
         var pluginEntry = cfg.getPlugin(featureId);
 
         // Install from given URL if defined or using a plugin id. If spec 
isn't a valid version or version range,
@@ -128,8 +132,8 @@ function installPluginsFromConfigXML(args) {
         return plugin('add', installFrom, options);
     }, function (error) {
         // CB-10921 emit a warning in case of error
-        var msg = 'Failed to restore plugin ' + pluginName + ' from 
config.xml. ' +
-            'You might want to reinstall it again. Error: ' + error;
+        var msg = 'Failed to restore plugin \"' + pluginName + '\" from 
config.xml. ' +
+            'You might need to try adding it again. Error: ' + error;
         events.emit('warn', msg);
     });
 }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/hooks/HooksRunner.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/hooks/HooksRunner.js 
b/cordova-lib/src/hooks/HooksRunner.js
index 299b775..bd86046 100644
--- a/cordova-lib/src/hooks/HooksRunner.js
+++ b/cordova-lib/src/hooks/HooksRunner.js
@@ -125,6 +125,9 @@ function executeEventHandlersSerially(hook, opts) {
  * Returns promise.
  */
 function runScriptsSerially (scripts, context) {
+    if (scripts.length === 0) {
+        events.emit('verbose', 'No scripts found for hook "' + context.hook + 
'".');
+    }
     return scripts.reduce(function(prevScriptPromise, nextScript) {
         return prevScriptPromise.then(function() {
             return runScript(nextScript, context);
@@ -141,6 +144,23 @@ function runScript(script, context) {
         // we assume we should use module loader for .js files
         script.useModuleLoader = path.extname(script.path).toLowerCase() == 
'.js';
     }
+
+    var source;
+    var relativePath;
+
+    if (script.plugin) {
+        source = 'plugin ' + script.plugin.id;
+        relativePath = path.join('plugins', script.plugin.id, script.path);
+    } else if (script.useModuleLoader) {
+        source = 'config.xml';
+        relativePath = path.normalize(script.path);
+    } else {
+        source = 'hooks directory';
+        relativePath = path.join('hooks', context.hook, script.path);
+    }
+
+    events.emit('verbose', 'Executing script found in ' + source + ' for hook 
"' + context.hook + '": ' + relativePath);
+
     if(script.useModuleLoader) {
         return runScriptViaModuleLoader(script, context);
     } else {
@@ -179,7 +199,7 @@ function runScriptViaChildProcessSpawn(script, context) {
     var args = [opts.projectRoot];
 
     if (fs.statSync(script.fullPath).isDirectory()) {
-        events.emit('verbose', 'skipped directory "' + script.fullPath + '" 
within hook directory');
+        events.emit('verbose', 'Skipped directory "' + script.fullPath + '" 
within hook directory');
         return Q();
     }
 
@@ -205,7 +225,7 @@ function runScriptViaChildProcessSpawn(script, context) {
         .catch(function(err) {
             // Don't treat non-executable files as errors. They could be 
READMEs, or Windows-only scripts.
             if (!isWindows && err.code == 'EACCES') {
-                events.emit('verbose', 'skipped non-executable file: ' + 
script.fullPath);
+                events.emit('verbose', 'Skipped non-executable file: ' + 
script.fullPath);
             } else {
                 throw new Error('Hook failed with error code ' + err.code + ': 
' + script.fullPath);
             }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/hooks/scriptsFinder.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/hooks/scriptsFinder.js 
b/cordova-lib/src/hooks/scriptsFinder.js
index ae9cced..4f4ba16 100644
--- a/cordova-lib/src/hooks/scriptsFinder.js
+++ b/cordova-lib/src/hooks/scriptsFinder.js
@@ -68,12 +68,11 @@ function getPluginsHookScripts(hook, opts) {
     // In case before_plugin_install, after_plugin_install, 
before_plugin_uninstall hooks we receive opts.plugin and
     // retrieve scripts exclusive for this plugin.
     if(opts.plugin) {
-        events.emit('verbose', 'Executing "' + hook + '"  hook for "' + 
opts.plugin.id + '" on ' + opts.plugin.platform + '.');
+        events.emit('verbose', 'Finding scripts for "' + hook + '" hook from 
plugin ' + opts.plugin.id + ' on ' + opts.plugin.platform + ' platform only.');
         // if plugin hook is not run for specific platform then use all 
available platforms
         return getPluginScriptFiles(opts.plugin, hook, opts.plugin.platform  ? 
[opts.plugin.platform] : opts.cordova.platforms);
     }
 
-    events.emit('verbose', 'Executing "' + hook + '"  hook for all plugins.');
     return getAllPluginsHookScriptFiles(hook, opts);
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/plugman/browserify.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/browserify.js 
b/cordova-lib/src/plugman/browserify.js
index fd7d832..39adabb 100644
--- a/cordova-lib/src/plugman/browserify.js
+++ b/cordova-lib/src/plugman/browserify.js
@@ -54,7 +54,7 @@ function generateFinalBundle(platform, libraryRelease, 
outReleaseFile, commitId,
     });
 
     outReleaseFileStream.on('error', function(err) {
-        events.emit('warn', 'error while generating cordova.js');
+        events.emit('warn', 'Error while generating cordova.js');
         deferred.reject(err);
     });
     return deferred.promise;
@@ -112,7 +112,7 @@ module.exports = function doBrowserify (project, 
platformApi, pluginInfoProvider
         var modulesMetadata = [];
 
         var plugins = 
Object.keys(platformJson.root.installed_plugins).concat(Object.keys(platformJson.root.dependent_plugins));
-        events.emit('verbose', 'Iterating over installed plugins:', plugins);
+        events.emit('verbose', 'Iterating over plugins in project:', plugins);
         plugins.forEach(function (plugin) {
             var pluginDir = path.join(project.locations.plugins, plugin);
             var pluginInfo = pluginInfoProvider.get(pluginDir);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/plugman/fetch.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/fetch.js b/cordova-lib/src/plugman/fetch.js
index 6db2723..c39a998 100644
--- a/cordova-lib/src/plugman/fetch.js
+++ b/cordova-lib/src/plugman/fetch.js
@@ -324,7 +324,7 @@ function copyPlugin(pinfo, plugins_dir, link) {
     }
 
     if(fs.existsSync(altDest)) {
-        events.emit('log', pinfo.id + '" will not install due to "' + altDest 
+ '" being installed.');
+        events.emit('log', pinfo.id + '" will not be added because its 
alternate id "' + altDest + '" is already present.');
         return altDest;
     }
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f513412a/cordova-lib/src/plugman/install.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/install.js 
b/cordova-lib/src/plugman/install.js
index 07a8e8f..85f7052 100644
--- a/cordova-lib/src/plugman/install.js
+++ b/cordova-lib/src/plugman/install.js
@@ -113,7 +113,7 @@ function possiblyFetch(id, plugins_dir, options) {
     var alias =  parsedSpec.scope ? null : 
pluginMapper.newToOld[parsedSpec.id] || newId;
     // if the plugin alias has already been fetched, use it.
     if (alias && fs.existsSync(path.join(plugins_dir, alias))) {
-        events.emit('warn', 'Found ' + alias + ' is already fetched, so it is 
installed instead of ' + parsedSpec.id);
+        events.emit('warn', 'Plugin with alternate id ' + alias + ' is already 
fetched, so installing it instead of ' + parsedSpec.id);
         return Q(path.join(plugins_dir, alias));
     }
 
@@ -263,15 +263,15 @@ function getEngines(pluginInfo, platform, project_dir, 
plugin_dir){
         // check for other engines
         } else {
             if (typeof engine.platform === 'undefined' || typeof 
engine.scriptSrc === 'undefined') {
-                throw new CordovaError('warn', 'engine.platform or 
engine.scriptSrc is not defined in custom engine \'' +
-                    theName + '\' from plugin \'' + pluginInfo.id + '\' for ' 
+ platform);
+                throw new CordovaError('warn', 'engine.platform or 
engine.scriptSrc is not defined in custom engine "' +
+                    theName + '" from plugin "' + pluginInfo.id + '" for ' + 
platform);
             }
 
             platformIndex = engine.platform.indexOf(platform);
             // CB-7183: security check for scriptSrc path escaping outside the 
plugin
             var scriptSrcPath = path.resolve(plugin_dir, engine.scriptSrc);
             if (scriptSrcPath.indexOf(plugin_dir) !== 0) {
-                throw new Error('security violation: scriptSrc 
'+scriptSrcPath+' is out of plugin dir '+plugin_dir);
+                throw new Error('Security violation: scriptSrc ' + 
scriptSrcPath + ' is out of plugin dir ' + plugin_dir);
             }
             if (platformIndex > -1 || engine.platform === '*') {
                 uncheckedEngines.push({ 'name': theName, 'platform': 
engine.platform, 'scriptSrc':scriptSrcPath, 'minVersion' :  engine.version});
@@ -570,7 +570,7 @@ function installDependency(dep, install, options) {
 
     dep.install_dir = path.join(install.plugins_dir, dep.id);
     if ( fs.existsSync(dep.install_dir) ) {
-        events.emit('verbose', 'Dependent plugin "' + dep.id + '" already 
fetched, using that version.');
+        events.emit('verbose', 'Plugin dependency "' + dep.id + '" already 
fetched, using that version.');
         opts = underscore.extend({}, options, {
             cli_variables: install.filtered_variables,
             is_top_level: false
@@ -579,7 +579,7 @@ function installDependency(dep, install, options) {
         return runInstall(install.actions, install.platform, 
install.project_dir, dep.install_dir, install.plugins_dir, opts);
 
     } else {
-        events.emit('verbose', 'Dependent plugin "' + dep.id + '" not fetched, 
retrieving then installing.');
+        events.emit('verbose', 'Plugin dependency "' + dep.id + '" not 
fetched, retrieving then installing.');
 
         opts = underscore.extend({}, options, {
             cli_variables: install.filtered_variables,


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

Reply via email to