You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by js...@apache.org on 2014/07/25 21:01:14 UTC

git commit: CB-7199 control git/npm using platform.js

Repository: cordova-lib
Updated Branches:
  refs/heads/master bc02fcc68 -> d75575ea0


CB-7199 control git/npm using platform.js

www will default to git
if you want a platform to use git, just add source:git to its platforms.js section


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

Branch: refs/heads/master
Commit: d75575ea0481f8e32521d4aac479cba2f47649b0
Parents: bc02fcc
Author: Josh Soref <js...@blackberry.com>
Authored: Fri Jul 25 14:58:41 2014 -0400
Committer: Josh Soref <js...@blackberry.com>
Committed: Fri Jul 25 14:59:19 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/cordova/lazy_load.js | 3 ++-
 cordova-lib/src/cordova/platforms.js | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d75575ea/cordova-lib/src/cordova/lazy_load.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/lazy_load.js b/cordova-lib/src/cordova/lazy_load.js
index 7376f3a..fd6df2d 100644
--- a/cordova-lib/src/cordova/lazy_load.js
+++ b/cordova-lib/src/cordova/lazy_load.js
@@ -63,6 +63,7 @@ function Platform(platformString) {
         this.name = platformString;
         if (platforms[this.name]) this.version = platforms[this.name].version;
     }
+    this.source = 'source' in platforms[this.name] ? platforms[this.name].source : 'npm';
 }
 
 // Returns a promise for the path to the lazy-loaded directory.
@@ -84,7 +85,7 @@ function based_on_config(project_root, platform, opts) {
 // Returns a promise for the path to the lazy-loaded directory.
 function cordova(platform, opts) {
     platform = new Platform(platform);
-    var use_git = opts && opts.usegit || platform.name === 'www';
+    var use_git = opts && opts.usegit || platform.source === 'git';
     if ( use_git ) {
         return module.exports.cordova_git(platform);
     } else {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d75575ea/cordova-lib/src/cordova/platforms.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platforms.js b/cordova-lib/src/cordova/platforms.js
index 1400de2..8841bb4 100644
--- a/cordova-lib/src/cordova/platforms.js
+++ b/cordova-lib/src/cordova/platforms.js
@@ -60,6 +60,7 @@ module.exports = {
     'www':{
         hostos : [],
         url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git',
+        source : 'git',
         version: '3.5.0'
     },
     'firefoxos':{