You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ripple.apache.org by gt...@apache.org on 2013/10/13 04:59:52 UTC

git commit: added more platforms for emulate on 3.0

Updated Branches:
  refs/heads/cordova-3.0 5553148ae -> b7720237d


added more platforms for emulate on 3.0


Project: http://git-wip-us.apache.org/repos/asf/incubator-ripple/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ripple/commit/b7720237
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ripple/tree/b7720237
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ripple/diff/b7720237

Branch: refs/heads/cordova-3.0
Commit: b7720237d5631002edec0785061a2200af84203e
Parents: 5553148
Author: Gord Tanner <gt...@gmail.com>
Authored: Sat Oct 12 22:59:49 2013 -0400
Committer: Gord Tanner <gt...@gmail.com>
Committed: Sat Oct 12 22:59:49 2013 -0400

----------------------------------------------------------------------
 lib/server/emulate.js        | 14 +++++++++++++-
 lib/server/emulate/hosted.js |  2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/b7720237/lib/server/emulate.js
----------------------------------------------------------------------
diff --git a/lib/server/emulate.js b/lib/server/emulate.js
index 9a9d9a1..625078a 100644
--- a/lib/server/emulate.js
+++ b/lib/server/emulate.js
@@ -67,9 +67,21 @@ module.exports = {
                     console.log("Cordova 3.0 Project detected...");
                     var platforms = fs.readdirSync(path.join(p, "platforms"));
                     if (platforms.indexOf('android') >= 0) {
-                        options.cordova = true;
+                        options.cordova = 'android';
                         p = path.join(p, "platforms", "android", "assets", "www");
                     }
+                    else if (platforms.indexOf('ios') >= 0) {
+                        options.cordova = 'ios';
+                        p = path.join(p, "platforms", "ios", "www");
+                    }
+                    else if (platforms.indexOf('firefoxos') >= 0) {
+                        options.cordova = 'firefoxos';
+                        p = path.join(p, "platforms", "firefoxos", "www");
+                    }
+                    else if (platforms.indexOf('blackberry10') >= 0) {
+                        options.cordova = 'blackberry10';
+                        p = path.join(p, "platforms", "blackberry10", "www");
+                    }
                 } catch (e) {
                     //Not a cordova project
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/b7720237/lib/server/emulate/hosted.js
----------------------------------------------------------------------
diff --git a/lib/server/emulate/hosted.js b/lib/server/emulate/hosted.js
index 0d2f6b2..1543362 100644
--- a/lib/server/emulate/hosted.js
+++ b/lib/server/emulate/hosted.js
@@ -163,7 +163,7 @@ function localInjection(opts) {
     return function (req, res, next) {
         if (req.query.enableripple && opts.cordova) {
             console.log('refreshing project ..');
-            exec('cordova prepare', function () {
+            exec('cordova prepare ' + opts.cordova, function () {
                 handle(req, res, next);
             });
         }