You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/06/21 03:16:03 UTC

[1/4] git commit: CB-6976 Add support for Windows Universal apps (Windows 8.1 and WP 8.1)

Repository: cordova-cli
Updated Branches:
  refs/heads/master 19cf56979 -> 218e3513e


CB-6976 Add support for Windows Universal apps (Windows 8.1 and WP 8.1)


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

Branch: refs/heads/master
Commit: 4de816dd5f9454f35ea75b8667fe55c4b8868483
Parents: 637994c
Author: sgrebnov <v-...@microsoft.com>
Authored: Fri Jun 20 17:17:45 2014 +0400
Committer: sgrebnov <v-...@microsoft.com>
Committed: Fri Jun 20 17:17:45 2014 +0400

----------------------------------------------------------------------
 src/cli.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4de816dd/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index 56533f7..209d1d6 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -165,6 +165,20 @@ function cli(inputArgs) {
             throw new CordovaError(msg)
         }
 
+        // CB-6976 Windows Universal Apps. Allow mixing windows and windows8 aliases
+        opts.platforms = opts.platforms.map(function(platform) {
+            // allow using old windows8 alias for new unified windows platform
+            if (platform == 'windows8' && require('fs').existsSync('platforms/windows')) {
+                return 'windows';
+            } 
+            // allow using new windows alias for old windows8 platform
+            if (platform == 'windows' && !require('fs').existsSync('platforms/windows') 
+                && require('fs').existsSync('platforms/windows8')) {
+                return 'windows8';
+            }
+            return platform;
+        })
+
         // Reconstruct the args to be passed along to platform scripts.
         // This is an ugly temporary fix. The code spawning or otherwise
         // calling into platform code should be dealing with this based


[2/4] git commit: Merge branch 'win81' of https://github.com/MSOpenTech/cordova-cli

Posted by pu...@apache.org.
Merge branch 'win81' of https://github.com/MSOpenTech/cordova-cli


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

Branch: refs/heads/master
Commit: beaf0d92231fa59cb3e033f88114c76b60dd2080
Parents: 19cf569 4de816d
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Jun 20 17:45:45 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Jun 20 17:45:45 2014 -0700

----------------------------------------------------------------------
 src/cli.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/beaf0d92/src/cli.js
----------------------------------------------------------------------


[4/4] git commit: fix linting/hinting

Posted by pu...@apache.org.
fix linting/hinting


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

Branch: refs/heads/master
Commit: 218e3513e87eca4967f4cb01734509ff2adc3ce7
Parents: c0addf2
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Jun 20 18:15:36 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Jun 20 18:15:36 2014 -0700

----------------------------------------------------------------------
 src/cli.js | 103 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 51 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/218e3513/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index a254964..28ede27 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -19,20 +19,20 @@
 
 /* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
           indent:4, unused:vars, latedef:nofunc,
-          laxcomma:true, asi:true
+          laxcomma:true
 */
 
 
 var path = require('path')
 ,   help = require('./help')
-,   fs = require('fs')
+,   fs = require('fs');
 
 // nopt and underscore are require()d in try-catch below to print a nice error
 // message if one of them is not installed.
-var nopt, _
+var nopt, _;
 
 
-module.exports = cli
+module.exports = cli;
 function cli(inputArgs) {
 
     try {
@@ -67,22 +67,22 @@ function cli(inputArgs) {
         , 'device' : Boolean
         , 'emulator': Boolean
         , 'target' : String
-        }
+        };
 
     var shortHands =
         { 'd' : '--verbose'
         , 'v' : '--version'
         , 'h' : '--help'
         , 'src' : '--copy-from'
-        }
+        };
 
     // If no inputArgs given, use process.argv.
-    inputArgs = inputArgs || process.argv
-    var args = nopt(knownOpts, shortHands, inputArgs)
+    inputArgs = inputArgs || process.argv;
+    var args = nopt(knownOpts, shortHands, inputArgs);
 
     if (args.version) {
         console.log( require('../package').version );
-        return
+        return;
     }
 
     var cordova_lib = require('cordova-lib'),
@@ -123,30 +123,30 @@ function cli(inputArgs) {
     // In this case "--verbose" is not parsed by nopt and args.vergbose will be
     // false, the unparsed args after -- are kept in unparsedArgs and can be
     // passed downstream to some scripts invoked by Cordova.
-    var unparsedArgs = []
-    var parseStopperIdx =  args.argv.original.indexOf('--')
+    var unparsedArgs = [];
+    var parseStopperIdx =  args.argv.original.indexOf('--');
     if (parseStopperIdx != -1) {
-        unparsedArgs = args.argv.original.slice(parseStopperIdx + 1)
+        unparsedArgs = args.argv.original.slice(parseStopperIdx + 1);
     }
 
     // args.argv.remain contains both the undashed args (like platform names)
     // and whatever unparsed args that were protected by " -- ".
     // "undashed" stores only the undashed args without those after " -- " .
-    var remain = args.argv.remain
-    var undashed = remain.slice(0, remain.length - unparsedArgs.length)
-    var cmd = undashed[0]
-    var subcommand
-    var msg
-    var known_platforms = Object.keys(cordova_lib.cordova_platforms)
+    var remain = args.argv.remain;
+    var undashed = remain.slice(0, remain.length - unparsedArgs.length);
+    var cmd = undashed[0];
+    var subcommand;
+    var msg;
+    var known_platforms = Object.keys(cordova_lib.cordova_platforms);
 
     if ( !cmd || cmd == 'help' || args.help ) {
-        return help()
+        return help();
     }
 
     if ( !cordova.hasOwnProperty(cmd) ) {
         msg =
             'Cordova does not know ' + cmd + '; try `' + cordova_lib.binname +
-            ' help` for a list of all the available commands.'
+            ' help` for a list of all the available commands.';
         throw new CordovaError(msg);
     }
 
@@ -160,11 +160,11 @@ function cli(inputArgs) {
 
     if (cmd == 'emulate' || cmd == 'build' || cmd == 'prepare' || cmd == 'compile' || cmd == 'run') {
         // All options without dashes are assumed to be platform names
-        opts.platforms = undashed.slice(1)
-        var badPlatforms = _.difference(opts.platforms, known_platforms)
+        opts.platforms = undashed.slice(1);
+        var badPlatforms = _.difference(opts.platforms, known_platforms);
         if( !_.isEmpty(badPlatforms) ) {
-            msg = 'Unknown platforms: ' + badPlatforms.join(', ')
-            throw new CordovaError(msg)
+            msg = 'Unknown platforms: ' + badPlatforms.join(', ');
+            throw new CordovaError(msg);
         }
 
         // CB-6976 Windows Universal Apps. Allow mixing windows and windows8 aliases
@@ -180,30 +180,30 @@ function cli(inputArgs) {
                 return 'windows8';
             }
             return platform;
-        })
+        });
 
         // Reconstruct the args to be passed along to platform scripts.
         // This is an ugly temporary fix. The code spawning or otherwise
         // calling into platform code should be dealing with this based
         // on the parsed args object.
-        var downstreamArgs = []
-        var argNames = [ 'debug', 'release', 'device', 'emulator' ]
+        var downstreamArgs = [];
+        var argNames = [ 'debug', 'release', 'device', 'emulator' ];
         argNames.forEach(function(flag) {
             if (args[flag]) {
-                downstreamArgs.push('--' + flag)
+                downstreamArgs.push('--' + flag);
             }
-        })
+        });
         if (args.target) {
-            downstreamArgs.push('--target=' + args.target)
+            downstreamArgs.push('--target=' + args.target);
         }
         if (args.archs) {
-            downstreamArgs.push('--archs=' + args.archs)
+            downstreamArgs.push('--archs=' + args.archs);
         }
-        opts.options = downstreamArgs.concat(unparsedArgs)
+        opts.options = downstreamArgs.concat(unparsedArgs);
 
         cordova.raw[cmd].call(null, opts).done();
     } else if (cmd == 'serve') {
-        var port = undashed[1]
+        var port = undashed[1];
         cordova.raw.serve(port).done();
     } else if (cmd == 'create') {
         var cfg = {};
@@ -240,36 +240,35 @@ function cli(inputArgs) {
             msg =
                 'save and restore commands are experimental, please ' +
                 'add "--experimental" to indicate that you understand that ' +
-                'it may change in the future'
+                'it may change in the future';
             throw new CordovaError(msg);
         }
-        subcommand  = undashed[1]
+        subcommand  = undashed[1];
         if (subcommand == 'plugins') {
-            cordova.raw[cmd].call(null, 'plugins', { shrinkwrap:args.shrinkwrap })
+            cordova.raw[cmd].call(null, 'plugins', { shrinkwrap:args.shrinkwrap });
         } else {
             msg =
                 'Let cordova know what you want to '+ cmd +
-                ', try "cordova '+ cmd +' plugins"'
-            throw new CordovaError(msg)
+                ', try "cordova '+ cmd +' plugins"';
+            throw new CordovaError(msg);
         }
     } else {
         // platform/plugins add/rm [target(s)]
-        subcommand = undashed[1] // sub-command like "add", "ls", "rm" etc.
-        var targets = undashed.slice(2) // array of targets, either platforms or plugins
-        var cli_vars = {}
+        subcommand = undashed[1]; // sub-command like "add", "ls", "rm" etc.
+        var targets = undashed.slice(2); // array of targets, either platforms or plugins
+        var cli_vars = {};
         if (args.variable) {
             args.variable.forEach( function(s) {
-                var keyval = s.split('=')
-                var key = keyval[0].toUpperCase()
-                cli_vars[key] = keyval[1]
-            })
+                var keyval = s.split('=');
+                var key = keyval[0].toUpperCase();
+                cli_vars[key] = keyval[1];
+            });
         }
-        var download_opts =
-            { searchpath : args.searchpath
-            , noregistry : args.noregistry
-            , usenpm : args.usenpm
-            , cli_variables : cli_vars
-            }
-        cordova.raw[cmd](subcommand, targets, download_opts).done()
+        var download_opts = { searchpath : args.searchpath
+                            , noregistry : args.noregistry
+                            , usenpm : args.usenpm
+                            , cli_variables : cli_vars
+                            };
+        cordova.raw[cmd](subcommand, targets, download_opts).done();
     }
 }


[3/4] git commit: moved require('fs') to top

Posted by pu...@apache.org.
moved require('fs') to top


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

Branch: refs/heads/master
Commit: c0addf208d4408d327b7f1000d617c8c2507f55f
Parents: beaf0d9
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Jun 20 17:58:58 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Jun 20 17:58:58 2014 -0700

----------------------------------------------------------------------
 src/cli.js | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/c0addf20/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index 1587ec9..a254964 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -24,7 +24,8 @@
 
 
 var path = require('path')
-  , help = require('./help')
+,   help = require('./help')
+,   fs = require('fs')
 
 // nopt and underscore are require()d in try-catch below to print a nice error
 // message if one of them is not installed.
@@ -169,12 +170,13 @@ function cli(inputArgs) {
         // CB-6976 Windows Universal Apps. Allow mixing windows and windows8 aliases
         opts.platforms = opts.platforms.map(function(platform) {
             // allow using old windows8 alias for new unified windows platform
-            if (platform == 'windows8' && require('fs').existsSync('platforms/windows')) {
+            if (platform == 'windows8' && fs.existsSync('platforms/windows')) {
                 return 'windows';
-            } 
+            }
             // allow using new windows alias for old windows8 platform
-            if (platform == 'windows' && !require('fs').existsSync('platforms/windows') 
-                && require('fs').existsSync('platforms/windows8')) {
+            if (platform == 'windows' &&
+                !fs.existsSync('platforms/windows') &&
+                fs.existsSync('platforms/windows8')) {
                 return 'windows8';
             }
             return platform;