You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by gt...@apache.org on 2013/03/22 23:56:26 UTC
[1/3] git commit: Added prototype ripple support to command line.
Updated Branches:
refs/heads/master 4ebae8573 -> 6c844bc80
Added prototype ripple support to command line.
This will allow:
cordova ripple ios
which will serve up the app's www folder and then wrap ripple around
it and launch a browser.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/cf499d00
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/cf499d00
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/cf499d00
Branch: refs/heads/master
Commit: cf499d000053b3e6f6631513fd5110c0861f8f01
Parents: 7c0d009
Author: Gord Tanner <gt...@gmail.com>
Authored: Thu Mar 7 11:56:18 2013 -0500
Committer: Gord Tanner <gt...@gmail.com>
Committed: Thu Mar 7 11:56:18 2013 -0500
----------------------------------------------------------------------
bootstrap.js | 5 +++++
cordova.js | 1 +
doc/help.txt | 2 ++
package.json | 3 ++-
src/ripple.js | 33 +++++++++++++++++++++++++++++++++
5 files changed, 43 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/cf499d00/bootstrap.js
----------------------------------------------------------------------
diff --git a/bootstrap.js b/bootstrap.js
index e45a5f9..ca4d964 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -111,3 +111,8 @@ platforms.forEach(function(platform) {
});
});
+// HACK: Install and configure ripple
+// Ripple will soon be in npm, this is a workaround until that happens
+shell.exec("git clone https://github.com/blackberry/Ripple-UI/ node_modules/ripple", {silent:false});
+shell.cd("node_modules/ripple");
+shell.exec("./configure && jake", {silent: false});
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/cf499d00/cordova.js
----------------------------------------------------------------------
diff --git a/cordova.js b/cordova.js
index 5840854..b8f5328 100755
--- a/cordova.js
+++ b/cordova.js
@@ -36,6 +36,7 @@ module.exports = {
plugin: require('./src/plugin'),
plugins: require('./src/plugin'),
serve: require('./src/serve'),
+ ripple: require('./src/ripple'),
on: function() {
cordova_events.on.apply(cordova_events, arguments);
},
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/cf499d00/doc/help.txt
----------------------------------------------------------------------
diff --git a/doc/help.txt b/doc/help.txt
index 28d74a9..937b7f5 100644
--- a/doc/help.txt
+++ b/doc/help.txt
@@ -19,6 +19,8 @@ Project-Level Commands
serve <platform> [port] ........... runs a local web server for the www/ directory of the given platform
the default port is 8000
note that you must edit the native code to point at the server!
+ ripple <platform> [port] .......... uses the serve command as a base and then wraps the server
+ with ripple to test your app in your desktop browser.
help .............................. shows this!
Example usage
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/cf499d00/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index bab301c..9a983cf 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,8 @@
"ncallbacks":"1.0.0",
"request":"2.11.4",
"semver":"1.1.0",
- "prompt":"0.2.7"
+ "prompt":"0.2.7",
+ "open": "0.0.*"
},
"devDependencies": {
"jasmine-node":"1.1.x"
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/cf499d00/src/ripple.js
----------------------------------------------------------------------
diff --git a/src/ripple.js b/src/ripple.js
new file mode 100644
index 0000000..2d4ee19
--- /dev/null
+++ b/src/ripple.js
@@ -0,0 +1,33 @@
+
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+var serve = require('./serve'),
+ ripple = require('ripple'),
+ open = require('open');
+
+module.exports = function (platform, port) {
+ port = port || 8000;
+ var server = serve(platform, port);
+
+ ripple.emulate.start({
+ remote: 'http://localhost:' + port
+ });
+
+ open('http://localhost:4400?enableripple=cordova-2.0.0');
+};
[2/3] git commit: Tighter Ripple Ingeration
Posted by gt...@apache.org.
Tighter Ripple Ingeration
- will now only start up one node server
- refactored serve to extract config to boot up ripple server
- ripple will be installed via npm!!11!!!one!!
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/a17c2056
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/a17c2056
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/a17c2056
Branch: refs/heads/master
Commit: a17c205689e1d6c2a4b891c3cc080317c719562b
Parents: cf499d0
Author: Gord Tanner <gt...@gmail.com>
Authored: Fri Mar 22 17:20:27 2013 -0400
Committer: Gord Tanner <gt...@gmail.com>
Committed: Fri Mar 22 17:20:27 2013 -0400
----------------------------------------------------------------------
bootstrap.js | 6 -----
package.json | 3 +-
src/ripple.js | 32 +++++++++++++++++++++++-----
src/serve.js | 57 ++++++++++++++++++++++++---------------------------
4 files changed, 55 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/a17c2056/bootstrap.js
----------------------------------------------------------------------
diff --git a/bootstrap.js b/bootstrap.js
index ca4d964..6eca53f 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -110,9 +110,3 @@ platforms.forEach(function(platform) {
}
});
});
-
-// HACK: Install and configure ripple
-// Ripple will soon be in npm, this is a workaround until that happens
-shell.exec("git clone https://github.com/blackberry/Ripple-UI/ node_modules/ripple", {silent:false});
-shell.cd("node_modules/ripple");
-shell.exec("./configure && jake", {silent: false});
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/a17c2056/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 9a983cf..27fdba3 100644
--- a/package.json
+++ b/package.json
@@ -32,7 +32,8 @@
"request":"2.11.4",
"semver":"1.1.0",
"prompt":"0.2.7",
- "open": "0.0.*"
+ "ripple-emulator":">=0.9.15",
+ "open": "0.0.3"
},
"devDependencies": {
"jasmine-node":"1.1.x"
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/a17c2056/src/ripple.js
----------------------------------------------------------------------
diff --git a/src/ripple.js b/src/ripple.js
index 2d4ee19..ddbf297 100644
--- a/src/ripple.js
+++ b/src/ripple.js
@@ -18,16 +18,36 @@
under the License.
*/
var serve = require('./serve'),
- ripple = require('ripple'),
+ ripple = require('ripple-emulator'),
open = require('open');
module.exports = function (platform, port) {
port = port || 8000;
- var server = serve(platform, port);
- ripple.emulate.start({
- remote: 'http://localhost:' + port
- });
+ serve.config(platform, port, function (cfg) {
+ ripple.emulate.start({
+ path: cfg.paths,
+ port: port
+ });
+
+ var device;
- open('http://localhost:4400?enableripple=cordova-2.0.0');
+ switch (platform) {
+ case "blackberry":
+ device = "Z10";
+ break;
+ case "ios":
+ device = "IPhone5";
+ break;
+ case "android":
+ device = "NexusS";
+ break;
+ default:
+ device = "XVGA";
+ break;
+ }
+
+ var uri = "http://localhost:" + port + "?enableripple=cordova-2.0.0-" + device;
+ open(uri);
+ });
};
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/a17c2056/src/serve.js
----------------------------------------------------------------------
diff --git a/src/serve.js b/src/serve.js
index b15f907..ba23e7f 100644
--- a/src/serve.js
+++ b/src/serve.js
@@ -79,6 +79,17 @@ function launch_server(www, platform_www, port) {
}
module.exports = function serve (platform, port) {
+ var returnValue = {};
+
+ module.exports.config(platform, port, function (config) {
+ returnValue.server = launch_server(config.paths[0], config.paths[1], port);
+ });
+
+ // Hack for testing despite its async nature.
+ return returnValue;
+};
+
+module.exports.config = function (platform, port, callback) {
var projectRoot = cordova_util.isCordova(process.cwd());
if (!projectRoot) {
@@ -100,46 +111,32 @@ module.exports = function serve (platform, port) {
// If we got to this point, the given platform is valid.
- // Default port is 8000 if not given. This is also the default of the Python module.
- port = port || 8000;
+ var result = {
+ paths: [],
+ // Default port is 8000 if not given. This is also the default of the Python module.
+ port: port || 8000
+ };
// Top-level www directory.
- var www = projectRoot + path.sep + 'www';
+ result.paths.push(projectRoot + path.sep + 'www');
- var parser, platformPath;
+ var parser;
- // Hack for testing despite its async nature.
- var returnValue = {};
switch (platform) {
case 'android':
- platformPath = path.join(projectRoot, 'platforms', 'android');
- parser = new android_parser(platformPath);
-
- // Update the related platform project from the config
- parser.update_project(cfg);
- var platform_www = parser.www_dir();
- returnValue.server = launch_server(www, platform_www, port);
+ parser = new android_parser(path.join(projectRoot, 'platforms', platform));
break;
case 'blackberry-10':
- platformPath = path.join(projectRoot, 'platforms', 'blackberry-10');
- parser = new blackberry_parser(platformPath);
-
- // Update the related platform project from the config
- parser.update_project(cfg, function() {
- // Shell it
- returnValue.server = launch_server(www, parser.www_dir(), port);
- });
+ parser = new blackberry_parser(path.join(projectRoot, 'platforms', platform));
break;
case 'ios':
- platformPath = path.join(projectRoot, 'platforms', 'ios');
- js = path.join(__dirname, '..', 'lib', 'ios', 'CordovaLib', 'javascript', 'cordova.ios.js');
- parser = new ios_parser(platformPath);
- // Update the related platform project from the config
- parser.update_project(cfg, function() {
- returnValue.server = launch_server(www, parser.www_dir(), port);
- });
+ parser = new ios_parser(path.join(projectRoot, 'platforms', platform));
break;
}
- return returnValue;
-};
+ // Update the related platform project from the config
+ parser.update_project(cfg, function() {
+ result.paths.push(parser.www_dir());
+ callback(result);
+ });
+}
[3/3] git commit: Merge branch 'next'
Posted by gt...@apache.org.
Merge branch 'next'
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/6c844bc8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/6c844bc8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/6c844bc8
Branch: refs/heads/master
Commit: 6c844bc806293d8265b4ccb91919ccdfe4ac3c96
Parents: 4ebae85 a17c205
Author: Gord Tanner <gt...@gmail.com>
Authored: Fri Mar 22 18:56:05 2013 -0400
Committer: Gord Tanner <gt...@gmail.com>
Committed: Fri Mar 22 18:56:05 2013 -0400
----------------------------------------------------------------------
bootstrap.js | 1 -
cordova.js | 1 +
doc/help.txt | 2 +
package.json | 4 ++-
src/ripple.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
src/serve.js | 57 ++++++++++++++++++++++++---------------------------
6 files changed, 86 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6c844bc8/bootstrap.js
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6c844bc8/doc/help.txt
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6c844bc8/package.json
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6c844bc8/src/serve.js
----------------------------------------------------------------------