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 2016/03/05 07:49:36 UTC

[13/14] cordova-paramedic git commit: Added param to specify a platformPath

Added param to specify a platformPath


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

Branch: refs/heads/master
Commit: 5edd705385af36d3d505ef1d45901b1ab5d95df4
Parents: 8a5b6f4
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Nov 13 23:55:06 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Nov 13 23:55:06 2015 -0800

----------------------------------------------------------------------
 main.js      |  5 +++--
 package.json |  2 +-
 paramedic.js | 31 +++++++++++++++++--------------
 3 files changed, 21 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/5edd7053/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index ee5c294..b772665 100755
--- a/main.js
+++ b/main.js
@@ -18,7 +18,8 @@ var USAGE = "Error missing args. \n" +
 	"`PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server\n" +
 	"--justbuild : (optional) just builds the project, without running the tests \n" +
     "--browserify : (optional) plugins are browserified into cordova.js \n" +
-    "--verbose : (optional) verbose mode. Display more information output";
+    "--verbose : (optional) verbose mode. Display more information output\n" +
+    "--platformPath : (optional) path to install platform from, git or local file uri";
 
 var argv = parseArgs(process.argv.slice(2));
 
@@ -38,5 +39,5 @@ var onComplete = function(resCode,resObj,logStr) {
 	process.exit(resCode);
 };
 
-paramedic.run(argv.platform, argv.plugin, onComplete, argv.justbuild, argv.port, argv.timeout, argv.browserify, false, argv.verbose);
+paramedic.run(argv.platform, argv.plugin, onComplete, argv.justbuild, argv.port, argv.timeout, argv.browserify, false, argv.verbose, argv.platformPath);
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/5edd7053/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 0ed9b09..b820e44 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
     "test-appveyor":"npm run test-windows",
     "test-travis":"npm run test-ios",
     "test-android":"node main.js --platform android --plugin ./spec/testable-plugin/",
-    "test-ios": "node main.js --platform ios --plugin ./spec/testable-plugin/",
+    "test-ios": "node main.js --platform ios --plugin ./spec/testable-plugin/ --verbose",
     "test-windows" : "node main.js --platform windows --plugin ./spec/testable-plugin/",
     "test-wp8": "node main.js --platform wp8 --plugin ./spec/testable-plugin/"
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/5edd7053/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
index a49b5c5..357a33b 100644
--- a/paramedic.js
+++ b/paramedic.js
@@ -14,7 +14,7 @@ var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
 
 
 
-function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,browserify,bSilent,bVerbose) {
+function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,browserify,bSilent,bVerbose,platformPath) {
     this.tunneledUrl = "";
     this.port = nPort;
     this.justBuild = bJustBuild;
@@ -24,6 +24,7 @@ function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeo
     this.tempFolder = null;
     this.timeout = msTimeout;
     this.verbose = bVerbose;
+    this.platformPath = platformPath;
 
     if(browserify) {
         this.browserify = "--browserify";
@@ -219,13 +220,18 @@ ParamedicRunner.prototype = {
     },
     addAndRunPlatform: function() {
         var self = this;
-        if(self.justBuild) {
-            self.logMessage("cordova-paramedic: adding platform");
-            shell.exec('cordova platform add ' + self.platformId,{silent:!this.verbose});
-            shell.exec('cordova prepare '+ self.browserify,{silent:!this.verbose});
-            self.logMessage("building ...");
+
+        var plat = this.platformPath || this.platformId;
+        this.logMessage("cordova-paramedic: adding platform : " + plat);
+
+        shell.exec('cordova platform add ' + plat,{silent:!this.verbose});
+        shell.exec('cordova prepare '+ this.browserify,{silent:!this.verbose});   
+
+        if(this.justBuild) {
+
+            this.logMessage("building ...");
             
-            shell.exec('cordova build ' + self.platformId.split("@")[0],
+            shell.exec('cordova build ' + this.platformId.split("@")[0],
                 {async:true,silent:!this.verbose},
                 function(code,output){
                     if(code !== 0) {
@@ -240,12 +246,9 @@ ParamedicRunner.prototype = {
             );
         }
         else {
-            self.setConfigStartPage();
-            self.logMessage("cordova-paramedic: adding platform");
-            shell.exec('cordova platform add ' + self.platformId,{silent:!this.verbose});
-            shell.exec('cordova prepare '+ self.browserify,{silent:!this.verbose});
+            this.setConfigStartPage();
 
-            shell.exec('cordova emulate ' + self.platformId.split("@")[0] + " --phone",
+            shell.exec('cordova emulate ' + this.platformId.split("@")[0] + " --phone",
                 {async:true,silent:!this.verbose},
                 function(code,output){
                     if(code !== 0) {
@@ -275,7 +278,7 @@ ParamedicRunner.prototype = {
 
 var storedCWD =  null;
 
-exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bBrowserify,bSilent,bVerbose) {
+exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bBrowserify,bSilent,bVerbose,platformPath) {
 
     storedCWD = storedCWD || process.cwd();
     if(!_plugins) {
@@ -293,7 +296,7 @@ exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout
         };
 
         var runner = new ParamedicRunner(_platformId, plugins, callback, !!bJustBuild,
-                                         nPort || PORT, msTimeout || TIMEOUT, !!bBrowserify, !!bSilent, !!bVerbose);
+                                         nPort || PORT, msTimeout || TIMEOUT, !!bBrowserify, !!bSilent, !!bVerbose, platformPath);
 
         runner.storedCWD = storedCWD;
         return runner.run();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org