You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by no...@apache.org on 2020/04/01 04:59:45 UTC

[cordova-android] branch master updated: fix: GH-873 App bundle builds to obey command-line arguments (#941)

This is an automated email from the ASF dual-hosted git repository.

normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new c93f93f  fix: GH-873 App bundle builds to obey command-line arguments (#941)
c93f93f is described below

commit c93f93f63730e7b838aae274fcbe757bfe69f1cd
Author: Norman Breau <no...@normanbreau.com>
AuthorDate: Wed Apr 1 01:59:39 2020 -0300

    fix: GH-873 App bundle builds to obey command-line arguments (#941)
---
 bin/templates/cordova/lib/builders/ProjectBuilder.js |  4 ++--
 spec/unit/builders/ProjectBuilder.spec.js            | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/bin/templates/cordova/lib/builders/ProjectBuilder.js b/bin/templates/cordova/lib/builders/ProjectBuilder.js
index 9bf95ca..1fcbd63 100644
--- a/bin/templates/cordova/lib/builders/ProjectBuilder.js
+++ b/bin/templates/cordova/lib/builders/ProjectBuilder.js
@@ -141,10 +141,10 @@ class ProjectBuilder {
             if (opts.arch) {
                 args.push('-PcdvBuildArch=' + opts.arch);
             }
-
-            args.push.apply(args, opts.extraArgs);
         }
 
+        args.push.apply(args, opts.extraArgs);
+
         return args;
     }
 
diff --git a/spec/unit/builders/ProjectBuilder.spec.js b/spec/unit/builders/ProjectBuilder.spec.js
index 5050c9a..2b9a0b1 100644
--- a/spec/unit/builders/ProjectBuilder.spec.js
+++ b/spec/unit/builders/ProjectBuilder.spec.js
@@ -113,6 +113,23 @@ describe('ProjectBuilder', () => {
             });
             expect(args[0]).toBe('clean');
         });
+
+        describe('should accept extra arguments', () => {
+            it('apk', () => {
+                const args = builder.getArgs('debug', {
+                    extraArgs: ['-PcdvVersionCode=12344']
+                });
+                expect(args).toContain('-PcdvVersionCode=12344');
+            });
+
+            it('bundle', () => {
+                const args = builder.getArgs('debug', {
+                    packageType: 'bundle',
+                    extraArgs: ['-PcdvVersionCode=12344']
+                });
+                expect(args).toContain('-PcdvVersionCode=12344');
+            });
+        });
     });
 
     describe('runGradleWrapper', () => {


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