You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2016/01/28 09:57:08 UTC

[1/2] android commit: CB-10443 Fix `this.root` null reference

Repository: cordova-android
Updated Branches:
  refs/heads/master 233c2bd88 -> 7669378c6


CB-10443 Fix `this.root` null reference

parseOpts function referenced this.root but the this object is not the new Api as expected. This leads to an exception upon calling path.relative(this.root, ...).


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

Branch: refs/heads/master
Commit: 1494082a2a463d750fdd72355cb8b4b0a80275d9
Parents: 233c2bd
Author: Dimitar Kerezov <di...@telerik.com>
Authored: Thu Jan 28 09:50:59 2016 +0200
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Thu Jan 28 11:55:15 2016 +0300

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1494082a/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 47aaa16..0a2e5fa 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -31,7 +31,7 @@ var events = require('cordova-common').events;
 var spawn = require('cordova-common').superspawn.spawn;
 var CordovaError = require('cordova-common').CordovaError;
 
-function parseOpts(options, resolvedTarget) {
+function parseOpts(options, resolvedTarget, projectRoot) {
     options = options || {};
     options.argv = nopt({
         gradle: Boolean,
@@ -72,7 +72,7 @@ function parseOpts(options, resolvedTarget) {
     var packageArgs = {};
 
     if (options.argv.keystore)
-        packageArgs.keystore = path.relative(this.root, path.resolve(options.argv.keystore));
+        packageArgs.keystore = path.relative(projectRoot, path.resolve(options.argv.keystore));
 
     ['alias','storePassword','password','keystoreType'].forEach(function (flagName) {
         if (options.argv[flagName])
@@ -126,7 +126,7 @@ function parseOpts(options, resolvedTarget) {
  * Returns a promise.
  */
 module.exports.runClean = function(options) {
-    var opts = parseOpts(options);
+    var opts = parseOpts(options, null, this.root);
     var builder = builders.getBuilder(opts.buildMethod);
     return builder.prepEnv(opts)
     .then(function() {
@@ -147,7 +147,7 @@ module.exports.runClean = function(options) {
  *   information.
  */
 module.exports.run = function(options, optResolvedTarget) {
-    var opts = parseOpts(options, optResolvedTarget);
+    var opts = parseOpts(options, optResolvedTarget, this.root);
     var builder = builders.getBuilder(opts.buildMethod);
     var self = this;
     return builder.prepEnv(opts)


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


[2/2] android commit: CB-10443 Pass original options instead of remaining

Posted by an...@apache.org.
CB-10443 Pass original options instead of remaining

Nopt parses all options regardless of what is passed as "knownOpts". This leaves the remain property an emtpy array.
This ultimately leads to a bug in the parseOpts function where the options undergo a second parsing from nopt.
The end result is - this options are not respected at all..
This closes #248


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

Branch: refs/heads/master
Commit: 7669378c6eca5ed4eef9e339caacc3c7efdcc43f
Parents: 1494082
Author: Dimitar Kerezov <di...@telerik.com>
Authored: Thu Jan 28 09:51:50 2016 +0200
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Thu Jan 28 11:55:29 2016 +0300

----------------------------------------------------------------------
 bin/templates/cordova/build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/7669378c/bin/templates/cordova/build
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/build b/bin/templates/cordova/build
index da44783..de86a36 100755
--- a/bin/templates/cordova/build
+++ b/bin/templates/cordova/build
@@ -39,7 +39,7 @@ var buildOpts = nopt({
 }, { 'd' : '--verbose' });
 
 // Make buildOptions compatible with PlatformApi build method spec
-buildOpts.argv = buildOpts.argv.remain;
+buildOpts.argv = buildOpts.argv.original;
 
 new Api().build(buildOpts)
 .catch(function(err) {


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