You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/08/13 02:32:09 UTC

[1/8] git commit: Add JSCS config file

Repository: cordova-lib
Updated Branches:
  refs/heads/cb-7219 6b358cac2 -> 1c0c4f00d


Add JSCS config file

But not running it as part of `npm test` yet.

See discussion here:
http://markmail.org/thread/rzzvn2ax3tqzabfw

JSHint people want to focus on syntax linting and are dropping style oriented
options. They recommends using JSCS (in addition to JSHint) for style:
https://github.com/jshint/jshint/issues/1339

JSCS has recently added the options dropped from JSHint.
https://github.com/mdevils/node-jscs/issues/102

This commit contains a JSCS config file with some basic settings that generate
very few errors with the existing cordova-cli and lib code.

My goal is to eventually run JSCS together with JSHint as part of `npm test`.
The nice thing about JSCS is that style flame wars can be way more structured
with it as we can argue about very specific well named JSCS config options :)

I'm using it with SublimeLinter-jscs
https://sublime.wbond.net/packages/SublimeLinter-jscs


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

Branch: refs/heads/cb-7219
Commit: 437eb12647311eb50878bf4d9095f403fbb8a7ba
Parents: c4ab88d
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Thu Jul 31 13:42:47 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Wed Aug 6 11:50:15 2014 -0400

----------------------------------------------------------------------
 cordova-lib/.jscs.json | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/437eb126/cordova-lib/.jscs.json
----------------------------------------------------------------------
diff --git a/cordova-lib/.jscs.json b/cordova-lib/.jscs.json
new file mode 100644
index 0000000..5cc7e26
--- /dev/null
+++ b/cordova-lib/.jscs.json
@@ -0,0 +1,24 @@
+{
+    "disallowMixedSpacesAndTabs": true,
+    "disallowTrailingWhitespace": true,
+    "validateLineBreaks": "LF",
+    "validateIndentation": 4,
+    "requireLineFeedAtFileEnd": true,
+
+    "disallowSpaceAfterPrefixUnaryOperators": true,
+    "disallowSpaceBeforePostfixUnaryOperators": true,
+    "requireSpaceAfterLineComment": true,
+    "requireCapitalizedConstructors": true,
+
+    "disallowSpacesInNamedFunctionExpression": {
+        "beforeOpeningRoundBrace": true
+    },
+
+    "requireSpaceAfterKeywords": [
+      "if",
+      "else",
+      "for",
+      "while",
+      "do"
+    ]
+}


[5/8] git commit: Fix error in comments for munge functions

Posted by st...@apache.org.
Fix error in comments for munge functions


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

Branch: refs/heads/cb-7219
Commit: eca366199ee5a3f1634f63a838b797fbe42097fc
Parents: 94c0cc8
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Fri Aug 8 11:45:16 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Fri Aug 8 11:45:16 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/util/config-changes.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/eca36619/cordova-lib/src/plugman/util/config-changes.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/config-changes.js b/cordova-lib/src/plugman/util/config-changes.js
index 6e713f5..11765b3 100644
--- a/cordova-lib/src/plugman/util/config-changes.js
+++ b/cordova-lib/src/plugman/util/config-changes.js
@@ -797,7 +797,7 @@ function process_munge(obj, createParents, func, keys /* or key1, key2 .... */ )
 }
 
 // All values from munge are added to base as
-// base[file][selector][child] += base[file][selector][child]
+// base[file][selector][child] += munge[file][selector][child]
 // Returns a munge object containing values that exist in munge
 // but not in base.
 function increment_munge(base, munge) {
@@ -820,7 +820,7 @@ function increment_munge(base, munge) {
 }
 
 // Update the base munge object as
-// base[file][selector][child] -= base[file][selector][child]
+// base[file][selector][child] -= munge[file][selector][child]
 // nodes that reached zero value are removed from base and added to the returned munge
 // object.
 function decrement_munge(base, munge) {


[7/8] git commit: Fix link/copy parent check for windows

Posted by st...@apache.org.
Fix link/copy parent check for windows

Reported as cca issue #260
https://github.com/MobileChromeApps/mobile-chrome-apps/issues/260


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

Branch: refs/heads/cb-7219
Commit: 13fe6b03bbfc86a5d2e5b565132946a7be2051fb
Parents: c60bd17
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Tue Aug 12 16:53:16 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Tue Aug 12 16:53:16 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/cordova/create.js | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/13fe6b03/cordova-lib/src/cordova/create.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/create.js b/cordova-lib/src/cordova/create.js
index 7aef292..c8cb694 100644
--- a/cordova-lib/src/cordova/create.js
+++ b/cordova-lib/src/cordova/create.js
@@ -105,11 +105,15 @@ function create(dir, id, name, cfg) {
         config_json.lib.www.id = config_json.lib.www.id || 'dummy_id';
         symlink  = !!config_json.lib.www.link;
 
-        // Make sure that the source www/ is not a direct ancestor of the target www/, or else we will recursively copy forever.
-        // To do this, we make sure that the shortest relative path from source-to-target must start by going up at least one directory.
-        var relative_path_from_source_to_target = path.relative(config_json.lib.www.url, www_dir);
-        var does_relative_path_go_up_at_least_one_dir = relative_path_from_source_to_target.split(path.sep)[0] == '..';
-        if (!does_relative_path_go_up_at_least_one_dir) {
+        // Make sure that the source www/ is not a direct ancestor of the
+        // target www/, or else we will recursively copy forever. To do this,
+        // we make sure that the shortest relative path from source-to-target
+        // must start by going up at least one directory or with a drive
+        // letter for Windows.
+        var rel_path = path.relative(config_json.lib.www.url, www_dir);
+        var goes_up = rel_path.split(path.sep)[0] == '..';
+
+        if (!(goes_up || rel_path[1] == ':')) {
             throw new CordovaError(
                 'Project dir "' +
                 dir +


[3/8] git commit: CB-7255 Fixed writing plist unescaped

Posted by st...@apache.org.
CB-7255 Fixed writing plist unescaped

- Use current plist npm instead of plist-with-patches
- Solve resulting deprecation warnings

We originally switched to plist-with-patches to add some patches which didn't
get through to the upstream plist at the time. The upstream plist has those
fixes now, and some more.

github: close #70


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

Branch: refs/heads/cb-7219
Commit: 2aabd736c75fb05e17e724df38af7e56fa2743c8
Parents: 190eb20
Author: Ulrich Geilmann <ug...@googlemail.com>
Authored: Mon Aug 4 22:45:06 2014 +0200
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Thu Aug 7 15:40:11 2014 -0400

----------------------------------------------------------------------
 cordova-lib/package.json                             | 2 +-
 cordova-lib/spec-cordova/metadata/ios_parser.spec.js | 4 ++--
 cordova-lib/spec-plugman/platforms/ios.spec.js       | 2 +-
 cordova-lib/spec-plugman/util/config-changes.spec.js | 2 +-
 cordova-lib/src/cordova/metadata/ios_parser.js       | 4 ++--
 cordova-lib/src/plugman/platforms/ios.js             | 4 ++--
 cordova-lib/src/plugman/util/config-changes.js       | 7 ++++---
 cordova-lib/src/plugman/util/plist-helpers.js        | 6 +++---
 8 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2aabd736/cordova-lib/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/package.json b/cordova-lib/package.json
index 1518065..6bffa4d 100644
--- a/cordova-lib/package.json
+++ b/cordova-lib/package.json
@@ -25,7 +25,7 @@
     "npm": "1.3.4",
     "npmconf": "0.1.x",
     "osenv": "0.0.x",
-    "plist-with-patches": "0.5.x",
+    "plist": "1.0.x",
     "properties-parser": "~0.2.3",
     "q": "~0.9",
     "rc": "0.3.0",

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2aabd736/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/ios_parser.spec.js b/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
index 7cceb98..b17ce0d 100644
--- a/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
@@ -20,7 +20,7 @@ var platforms = require('../../src/cordova/platforms'),
     util = require('../../src/cordova/util'),
     path = require('path'),
     shell = require('shelljs'),
-    plist = require('plist-with-patches'),
+    plist = require('plist'),
     xcode = require('xcode'),
     et = require('elementtree'),
     fs = require('fs'),
@@ -89,7 +89,7 @@ describe('ios project parser', function () {
             var update_name, xc_write;
             beforeEach(function() {
                 mv = spyOn(shell, 'mv');
-                plist_parse = spyOn(plist, 'parseFileSync').andReturn({
+                plist_parse = spyOn(plist, 'parse').andReturn({
                 });
                 plist_build = spyOn(plist, 'build').andReturn('');
                 update_name = jasmine.createSpy('update_name');

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2aabd736/cordova-lib/spec-plugman/platforms/ios.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platforms/ios.spec.js b/cordova-lib/spec-plugman/platforms/ios.spec.js
index cc8dcfd..d0acd9e 100644
--- a/cordova-lib/spec-plugman/platforms/ios.spec.js
+++ b/cordova-lib/spec-plugman/platforms/ios.spec.js
@@ -23,7 +23,7 @@ var ios = require('../../src/plugman/platforms/ios'),
     et = require('elementtree'),
     shell = require('shelljs'),
     os = require('osenv'),
-    plist = require('plist-with-patches'),
+    plist = require('plist'),
     bplist = require('bplist-parser'),
     temp = path.join(os.tmpdir(), 'plugman'),
     plugins_dir = path.join(temp, 'cordova', 'plugins'),

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2aabd736/cordova-lib/spec-plugman/util/config-changes.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/util/config-changes.spec.js b/cordova-lib/spec-plugman/util/config-changes.spec.js
index c7137ee..d745c18 100644
--- a/cordova-lib/spec-plugman/util/config-changes.spec.js
+++ b/cordova-lib/spec-plugman/util/config-changes.spec.js
@@ -28,7 +28,7 @@ var configChanges = require('../../src/plugman/util/config-changes'),
     events  = require('../../src/events'),
     et      = require('elementtree'),
     path    = require('path'),
-    plist = require('plist-with-patches'),
+    plist = require('plist'),
     shell   = require('shelljs'),
     xcode = require('xcode'),
     temp    = path.join(os.tmpdir(), 'plugman'),

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2aabd736/cordova-lib/src/cordova/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/ios_parser.js b/cordova-lib/src/cordova/metadata/ios_parser.js
index fa136dc..a6254ac 100644
--- a/cordova-lib/src/cordova/metadata/ios_parser.js
+++ b/cordova-lib/src/cordova/metadata/ios_parser.js
@@ -29,7 +29,7 @@ var fs            = require('fs'),
     util          = require('../util'),
     events        = require('../../events'),
     shell         = require('shelljs'),
-    plist         = require('plist-with-patches'),
+    plist         = require('plist'),
     Q             = require('q'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError');
@@ -65,7 +65,7 @@ module.exports.prototype = {
 
         // Update package id (bundle id)
         var plistFile = path.join(this.cordovaproj, this.originalName + '-Info.plist');
-        var infoPlist = plist.parseFileSync(plistFile);
+        var infoPlist = plist.parse(fs.readFileSync(plistFile, 'utf8'));
         infoPlist['CFBundleIdentifier'] = pkg;
 
         // Update version (bundle version)

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2aabd736/cordova-lib/src/plugman/platforms/ios.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/ios.js b/cordova-lib/src/plugman/platforms/ios.js
index 6e2f3fd..49336fc 100644
--- a/cordova-lib/src/plugman/platforms/ios.js
+++ b/cordova-lib/src/plugman/platforms/ios.js
@@ -26,7 +26,7 @@ var path = require('path')
   , fs   = require('fs')
   , glob = require('glob')
   , xcode = require('xcode')
-  , plist = require('plist-with-patches')
+  , plist = require('plist')
   , shell = require('shelljs')
   , events = require('../../events')
   , cachedProjectFiles = {}
@@ -38,7 +38,7 @@ module.exports = {
     },
     package_name:function(project_dir) {
         var plist_file = glob.sync(path.join(project_dir, '**', '*-Info.plist'))[0];
-        return plist.parseFileSync(plist_file).CFBundleIdentifier;
+        return plist.parse(fs.readFileSync(plist_file, 'utf8')).CFBundleIdentifier;
     },
     'source-file':{
         install:function(source_el, plugin_dir, project_dir, plugin_id, project) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2aabd736/cordova-lib/src/plugman/util/config-changes.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/config-changes.js b/cordova-lib/src/plugman/util/config-changes.js
index f93a9b5..6e713f5 100644
--- a/cordova-lib/src/plugman/util/config-changes.js
+++ b/cordova-lib/src/plugman/util/config-changes.js
@@ -38,7 +38,7 @@
 var fs   = require('fs'),
     path = require('path'),
     glob = require('glob'),
-    plist = require('plist-with-patches'),
+    plist = require('plist'),
     bplist = require('bplist-parser'),
     et   = require('elementtree'),
     semver = require('semver'),
@@ -554,8 +554,9 @@ function ConfigFile_load() {
         //       We always write out text plist, not binary.
         //       Do we still need to support binary plist?
         //       If yes, use plist.parseStringSync() and read the file once.
-        self.plist_module = (isBinaryPlist(filepath) ? bplist : plist);
-        self.data = self.plist_module.parseFileSync(filepath);
+        self.data = isBinaryPlist(filepath) ?
+                bplist.parseBuffer(fs.readFileSync(filepath)) :
+                plist.parse(fs.readFileSync(filepath, 'utf8'));
     }
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/2aabd736/cordova-lib/src/plugman/util/plist-helpers.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/plist-helpers.js b/cordova-lib/src/plugman/util/plist-helpers.js
index b8d93f2..605a6c2 100644
--- a/cordova-lib/src/plugman/util/plist-helpers.js
+++ b/cordova-lib/src/plugman/util/plist-helpers.js
@@ -23,12 +23,12 @@
 
 // contains PLIST utility functions
 
-var plist = require('plist-with-patches');
+var plist = require('plist');
 
 // adds node to doc at selector
 module.exports.graftPLIST = graftPLIST;
 function graftPLIST(doc, xml, selector) {
-    var obj = plist.parseStringSync('<plist>'+xml+'</plist>');
+    var obj = plist.parse('<plist>'+xml+'</plist>');
 
     var node = doc[selector];
     if (node && Array.isArray(node) && Array.isArray(obj))
@@ -42,7 +42,7 @@ function graftPLIST(doc, xml, selector) {
 // removes node from doc at selector
 module.exports.prunePLIST = prunePLIST;
 function prunePLIST(doc, xml, selector) {
-    var obj = plist.parseStringSync('<plist>'+xml+'</plist>');
+    var obj = plist.parse('<plist>'+xml+'</plist>');
 
     pruneOBJECT(doc, selector, obj);
 


[2/8] git commit: Style fixes - white space only

Posted by st...@apache.org.
Style fixes - white space only


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

Branch: refs/heads/cb-7219
Commit: 190eb20db2cb1c9d233bd50c80627cd4734910c1
Parents: 437eb12
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Wed Aug 6 13:14:09 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Wed Aug 6 13:14:09 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/events.js                      |  2 +-
 cordova-lib/src/plugman/plugman.js             | 16 ++++++++--------
 cordova-lib/src/plugman/util/config-changes.js |  2 +-
 cordova-lib/src/util/windows/jsproj.js         |  2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/190eb20d/cordova-lib/src/events.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/events.js b/cordova-lib/src/events.js
index 8c9272d..a6ec340 100644
--- a/cordova-lib/src/events.js
+++ b/cordova-lib/src/events.js
@@ -16,4 +16,4 @@
     specific language governing permissions and limitations
     under the License.
 */
-module.exports = new (require('events').EventEmitter)();
\ No newline at end of file
+module.exports = new (require('events').EventEmitter)();

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/190eb20d/cordova-lib/src/plugman/plugman.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/plugman.js b/cordova-lib/src/plugman/plugman.js
index 5598628..d39544b 100644
--- a/cordova-lib/src/plugman/plugman.js
+++ b/cordova-lib/src/plugman/plugman.js
@@ -102,10 +102,10 @@ plugman.commands =  {
         var cli_variables = {};
         if (cli_opts.variable) {
             cli_opts.variable.forEach(function (variable) {
-                    var tokens = variable.split('=');
-                    var key = tokens.shift().toUpperCase();
-                    if (/^[\w-_]+$/.test(key)) cli_variables[key] = tokens.join('=');
-                });
+                var tokens = variable.split('=');
+                var key = tokens.shift().toUpperCase();
+                if (/^[\w-_]+$/.test(key)) cli_variables[key] = tokens.join('=');
+            });
         }
         var opts = {
             subdir: '.',
@@ -208,10 +208,10 @@ plugman.commands =  {
         var cli_variables = {};
         if (cli_opts.variable) {
             cli_opts.variable.forEach(function (variable) {
-                    var tokens = variable.split('=');
-                    var key = tokens.shift().toUpperCase();
-                    if (/^[\w-_]+$/.test(key)) cli_variables[key] = tokens.join('=');
-                });
+                var tokens = variable.split('=');
+                var key = tokens.shift().toUpperCase();
+                if (/^[\w-_]+$/.test(key)) cli_variables[key] = tokens.join('=');
+            });
         }
         plugman.create( cli_opts.name, cli_opts.plugin_id, cli_opts.plugin_version, cli_opts.path || '.', cli_variables );
     },

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/190eb20d/cordova-lib/src/plugman/util/config-changes.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/config-changes.js b/cordova-lib/src/plugman/util/config-changes.js
index b8b21c5..f93a9b5 100644
--- a/cordova-lib/src/plugman/util/config-changes.js
+++ b/cordova-lib/src/plugman/util/config-changes.js
@@ -357,7 +357,7 @@ function generate_plugin_config_munge(plugin_dir, vars) {
         var parent = change.attrib['parent'];
         var after = change.attrib['after'];
         var xmls = change.getchildren();
-		xmls.forEach(function(xml) {
+        xmls.forEach(function(xml) {
             // 1. stringify each xml
             var stringified = (new et.ElementTree(xml)).write({xml_declaration:false});
             // interp vars

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/190eb20d/cordova-lib/src/util/windows/jsproj.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/util/windows/jsproj.js b/cordova-lib/src/util/windows/jsproj.js
index d1cd7e4..d847603 100644
--- a/cordova-lib/src/util/windows/jsproj.js
+++ b/cordova-lib/src/util/windows/jsproj.js
@@ -135,7 +135,7 @@ jsproj.prototype = {
         relative_path.forEach(function(filePath) {
             filePath = filePath.split('/').join('\\');
             filePath = this.isUniversalWindowsApp ? '$(MSBuildThisFileDirectory)' + filePath : filePath;
-            
+
             var content = new et.Element('Content');
             content.attrib.Include = filePath;
             item.append(content);


[6/8] git commit: Style fixes - comments

Posted by st...@apache.org.
Style fixes - comments

//xyz -> // Xyz (space and capitalization).


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

Branch: refs/heads/cb-7219
Commit: c60bd17d65af3d431ada55d32d824266b721c089
Parents: eca3661
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Fri Aug 8 14:46:55 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Fri Aug 8 14:46:55 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/create.js              | 16 +++++++-------
 cordova-lib/src/plugman/platform.js            | 24 ++++++++++-----------
 cordova-lib/src/plugman/registry/manifest.js   |  9 ++++----
 cordova-lib/src/plugman/util/config-changes.js |  4 ++--
 4 files changed, 26 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/c60bd17d/cordova-lib/src/plugman/create.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/create.js b/cordova-lib/src/plugman/create.js
index 684b126..a63ffea 100644
--- a/cordova-lib/src/plugman/create.js
+++ b/cordova-lib/src/plugman/create.js
@@ -37,38 +37,38 @@ module.exports = function create( name, id, version, pluginPath, options ) {
         clobber,
         jsMod;
 
-    //check we are not already in a plugin
+    // Check we are not already in a plugin
     if( fs.existsSync( cwd + 'plugin.xml' ) ) {
         return Q.reject( new CordovaError( 'plugin.xml already exists. Are you already in a plugin?' ) );
     }
 
-    //Create a plugin.xml file
+    // Create a plugin.xml file
     root = et.Element( 'plugin' );
     root.set( 'xmlns', 'http://apache.org/cordova/ns/plugins/1.0' );
     root.set( 'xmlns:android', 'http://schemas.android.com/apk/res/android' );
     root.set( 'id', id );
     root.set( 'version', version );
 
-    //Add the name tag
+    // Add the name tag
     pluginName = et.XML( '<name>' );
     pluginName.text = name;
     root.append( pluginName );
 
-    //loop through the options( variables ) for other tags
+    // Loop through the options( variables ) for other tags
     for( var key in options ) {
         var temp = et.XML( '<' + key + '>');
         temp.text = options[ key ];
         root.append( temp );
     }
 
-    //setup the directory structure
+    // Setup the directory structure
     shell.mkdir( '-p', cwd + 'www' );
     shell.mkdir( '-p', cwd + 'src' );
 
-    //create a base plugin.js file
+    // Create a base plugin.js file
     baseJS = fs.readFileSync( templatesDir + 'base.js', 'utf-8').replace( /%pluginName%/g, name );
     fs.writeFileSync( cwd + 'www/' + name + '.js', baseJS, 'utf-8' );
-    //Add it to the xml as a js module
+    // Add it to the xml as a js module
     jsMod = et.Element( 'js-module' );
     jsMod.set( 'src', 'www/' + name + '.js' );
     jsMod.set( 'name', name );
@@ -79,7 +79,7 @@ module.exports = function create( name, id, version, pluginPath, options ) {
 
     root.append( jsMod );
 
-    //Write out the plugin.xml file
+    // Write out the plugin.xml file
     fs.writeFileSync( cwd + 'plugin.xml', new et.ElementTree( root ).write( {indent: 4} ), 'utf-8' );
 
     return Q();

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/c60bd17d/cordova-lib/src/plugman/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platform.js b/cordova-lib/src/plugman/platform.js
index 414e975..8761986 100644
--- a/cordova-lib/src/plugman/platform.js
+++ b/cordova-lib/src/plugman/platform.js
@@ -33,23 +33,23 @@ module.exports = {
         var pluginxml,
             platform;
 
-        //check to make sure we are in the plugin first
+        // Check to make sure we are in the plugin first
         if( !fs.existsSync( 'plugin.xml' ) ) {
             return Q.reject( new Error( "can't find a plugin.xml.  Are you in the plugin?" ) );
         }
 
-        //Get the current plugin.xml file
+        // Get the current plugin.xml file
         pluginxml = et.parse( fs.readFileSync('plugin.xml', 'utf-8') );
 
-        //Check if this platform exists
+        // Check if this platform exists
         if( pluginxml.find("./platform/[@name='"+ platformName +"']") ) {
             return Q.reject( new Error( "platform: " + platformName + " already added"  ) );
         }
 
-        //Get the platform specific elements
+        // Get the platform specific elements
         platform = doPlatform( platformName, pluginxml.find("./name").text, pluginxml.getroot().get( "id" ) );
 
-        //Make sure we support it
+        // Make sure we support it
         if( !platform ) {
             return Q.reject( new Error( "platform: " + platformName + " not yet supported"  ) );
         }
@@ -60,26 +60,26 @@ module.exports = {
         return Q();
     },
     remove: function( platformName ) {
-        //check to make sure we are in the plugin first
+        // Check to make sure we are in the plugin first
         if( !fs.existsSync( 'plugin.xml' ) ) {
             return Q.reject( new Error( "can't find a plugin.xml.  Are you in the plugin?" ) );
         }
 
-        //Get the current plugin.xml file
+        // Get the current plugin.xml file
         var pluginxml = et.parse( fs.readFileSync('plugin.xml', 'utf-8') );
 
-        //Check if this platform exists
+        // Check if this platform exists
         if( !pluginxml.find("./platform/[@name='"+ platformName +"']") ) {
             return Q.reject( new Error( "platform: " + platformName + " hasn't been added"  ) );
         }
 
-        //Remove the Platform in question
+        // Remove the Platform in question
         pluginxml.getroot().remove( 0, pluginxml.find("./platform/[@name='"+ platformName +"']") );
 
-        //Rewrite the plugin.xml file back out
+        // Rewrite the plugin.xml file back out
         fs.writeFileSync( "plugin.xml", pluginxml.write( "plugin.xml", {indent: 4} ), 'utf-8' );
 
-        //Remove the src/"platform"
+        // Remove the src/"platform"
         shell.rm( '-rf', 'src/' + platformName );
 
         return Q();
@@ -107,7 +107,7 @@ function doPlatform( platformName, pluginName, pluginID, pluginVersion ) {
 }
 
 function doPlatformBase( templatesDir, platformName, pluginName, pluginID, pluginVersion ) {
-    //Create the default plugin file
+    // Create the default plugin file
     var baseFiles = [],
         i = 0;
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/c60bd17d/cordova-lib/src/plugman/registry/manifest.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/registry/manifest.js b/cordova-lib/src/plugman/registry/manifest.js
index 5306b0e..4496f34 100644
--- a/cordova-lib/src/plugman/registry/manifest.js
+++ b/cordova-lib/src/plugman/registry/manifest.js
@@ -88,7 +88,7 @@ function generatePackageJsonFromPluginXml(plugin_path) {
         if(keywords)     package_json.keywords     = keywords.split(',');
         if(platforms)    package_json.platforms    = platforms;
 
-        // adding engines
+        // Adding engines
         if(engines) {
             package_json.engines = [];
             for(var i = 0, j = engines.length ; i < j ; i++) {
@@ -96,10 +96,10 @@ function generatePackageJsonFromPluginXml(plugin_path) {
             }
         }
 
-        //set docs_path to doc/index.md exists
+        // Set docs_path to doc/index.md exists
         var docs_path = path.resolve(plugin_path, 'doc/index.md');
         if(!(fs.existsSync(docs_path))){
-            //set docs_path to doc/en/index.md
+            // Set docs_path to doc/en/index.md
             docs_path = path.resolve(plugin_path, 'doc/en/index.md');
         }
         if(fs.existsSync(docs_path)){
@@ -107,9 +107,8 @@ function generatePackageJsonFromPluginXml(plugin_path) {
             package_json.englishdoc = englishdoc;
         }
 
-        // write package.json
+        // Write package.json
         var package_json_path = path.resolve(plugin_path, 'package.json');
-        //console.log('about to write package.json');
         fs.writeFileSync(package_json_path, JSON.stringify(package_json, null, 4), 'utf8');
         return package_json;
     });

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/c60bd17d/cordova-lib/src/plugman/util/config-changes.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/config-changes.js b/cordova-lib/src/plugman/util/config-changes.js
index 11765b3..45cde7d 100644
--- a/cordova-lib/src/plugman/util/config-changes.js
+++ b/cordova-lib/src/plugman/util/config-changes.js
@@ -421,8 +421,8 @@ ConfigKeeper.prototype.get = ConfigKeeper_get;
 function ConfigKeeper_get(project_dir, platform, file) {
     var self = this;
 
-    //This fixes a bug with older plugins - when specifying config xml instead of res/xml/config.xml
-    //https://issues.apache.org/jira/browse/CB-6414
+    // This fixes a bug with older plugins - when specifying config xml instead of res/xml/config.xml
+    // https://issues.apache.org/jira/browse/CB-6414
     if(file == 'config.xml' && platform == 'android'){
         file = 'res/xml/config.xml';
     }


[4/8] git commit: Add link to BuildBot at ci.cordova.io in README

Posted by st...@apache.org.
Add link to BuildBot at ci.cordova.io in README


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

Branch: refs/heads/cb-7219
Commit: 94c0cc8d02522d3d7dc532ab6a4e4952e7ca152e
Parents: 2aabd73
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Thu Aug 7 16:50:24 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Thu Aug 7 16:50:24 2014 -0400

----------------------------------------------------------------------
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/94c0cc8d/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index ec4e3df..c28cae4 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,8 @@
 
 [![Build status](https://ci.appveyor.com/api/projects/status/q9s459ssqvs1t7j6/branch/master)](https://ci.appveyor.com/project/Humbedooh/cordova-lib)
 [![Build Status](https://travis-ci.org/apache/cordova-lib.svg?branch=master)](https://travis-ci.org/apache/cordova-lib)
-[![npm version](http://b.adge.me/npm/v/cordova-lib.svg)](https://www.npmjs.org/package/cordova-lib)
+[![npm version](http://b.adge.me/npm/v/cordova-lib.svg)](https://www.npmjs.org/package/cordova-lib)  
+[BuildBot waterfall](http://ci.cordova.io/) with [cordova-mobile-spec](https://github.com/apache/cordova-mobile-spec) running on real Android and iOS devices.
 
 # cordova-lib
 Contains npm modules used primarily by [cordova](https://github.com/apache/cordova-cli/) and [plugman](https://github.com/apache/cordova-plugman/).


[8/8] git commit: CB-7219 prepare-browserify computes commitId and platformVersion

Posted by st...@apache.org.
CB-7219 prepare-browserify computes commitId and platformVersion


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

Branch: refs/heads/cb-7219
Commit: 1c0c4f00d5ceac6fd62f00089ff350c1c3768862
Parents: 13fe6b0 6b358ca
Author: Steven Gill <st...@gmail.com>
Authored: Tue Aug 12 17:32:03 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Tue Aug 12 17:32:03 2014 -0700

----------------------------------------------------------------------
 cordova-lib/src/plugman/prepare-browserify.js | 184 +++++++++++----------
 1 file changed, 99 insertions(+), 85 deletions(-)
----------------------------------------------------------------------