You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2013/11/14 21:00:06 UTC

git commit: Fix issue not finding platform script when in subdir - check platforms which have subdir - append subdir to libDir for detected platforms

Updated Branches:
  refs/heads/master 7b78259ee -> 19513a1c3


Fix issue not finding platform script when in subdir
- check platforms which have subdir
- append subdir to libDir for detected platforms


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

Branch: refs/heads/master
Commit: 19513a1c31e5cb44971a7c751adef70d66f39ffd
Parents: 7b78259
Author: SomaticIT <co...@somatic.fr>
Authored: Wed Nov 6 19:12:30 2013 +0100
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Thu Nov 14 14:59:47 2013 -0500

----------------------------------------------------------------------
 spec/platform.spec.js |  4 +---
 src/platform.js       | 14 +++++++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/19513a1c/spec/platform.spec.js
----------------------------------------------------------------------
diff --git a/spec/platform.spec.js b/spec/platform.spec.js
index 33b69e0..c9fee80 100644
--- a/spec/platform.spec.js
+++ b/spec/platform.spec.js
@@ -76,9 +76,7 @@ describe('platform command', function() {
 
         fakeLazyLoad = function(id, platform, version) {
             if (platform == 'wp7' || platform == 'wp8') {
-                return Q(path.join('lib', 'wp', id, version, platform));
-            } else if (platform == 'windows8') {
-                return Q(path.join('lib', 'windows8', id, version, 'windows8'));
+                return Q(path.join('lib', 'wp', id, version));
             } else {
                 return Q(path.join('lib', platform, id, version));
             }

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/19513a1c/src/platform.js
----------------------------------------------------------------------
diff --git a/src/platform.js b/src/platform.js
index 9619ea8..214d396 100644
--- a/src/platform.js
+++ b/src/platform.js
@@ -116,6 +116,10 @@ module.exports = function platform(command, targets) {
                 .then(function() {
                     return lazy_load.based_on_config(projectRoot, plat);
                 }).then(function(libDir) {
+                    // Check for platforms are in subdirectories into repositories
+                    if (["wp7", "wp8", "windows8", "windows81", "blackberry10"].indexOf(plat) !== -1)
+                        libDir = path.join(libDir, target);
+
                     var script = path.join(libDir, 'bin', 'update');
                     var d = Q.defer();
                     child_process.exec(script + ' "' + path.join(projectRoot, 'platforms', plat) + '"', function(err, stdout, stderr) {
@@ -222,12 +226,11 @@ function call_into_create(target, projectRoot, cfg, libDir, template_dir) {
         events.emit('verbose', 'Checking if platform "' + target + '" passes minimum requirements...');
         return module.exports.supports(projectRoot, target)
         .then(function() {
-            // CB-5183 WP7/8 path is not correctly resolved by CLI
-            if (target == 'wp7' || target == 'wp8' || target == 'windows8') {
-                libDir =  path.join(libDir, target);
-            }            
+            // Check for platforms are in subdirectories into repositories
+            if (["wp7", "wp8", "windows8", "windows81", "blackberry10"].indexOf(target) !== -1)
+                libDir = path.join(libDir, target);
+
             // Create a platform app using the ./bin/create scripts that exist in each repo.
-            // Run platform's create script
             var bin = path.join(libDir, 'bin', 'create');
             var args = (target=='ios') ? '--arc' : '';
             var pkg = cfg.packageName().replace(/[^\w.]/g,'_');
@@ -239,6 +242,7 @@ function call_into_create(target, projectRoot, cfg, libDir, template_dir) {
             events.emit('log', 'Creating ' + target + ' project...');
             events.emit('verbose', 'Running bin/create for platform "' + target + '" with command: "' + command + '" (output to follow)');
 
+            // Run platform's create script
             var d = Q.defer();
             child_process.exec(command, function(err, create_output, stderr) {
                 events.emit('verbose', create_output);