-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Gradle Args parsing #1606
fix: Gradle Args parsing #1606
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1606 +/- ##
==========================================
+ Coverage 71.82% 72.61% +0.78%
==========================================
Files 23 23
Lines 1796 1800 +4
==========================================
+ Hits 1290 1307 +17
+ Misses 506 493 -13
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks okay to me.
It would maybe be good to have a test case that covered the splitting of gradleArgs
into multiple extraArgs
tokens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nitpik but, looks good to me.
I added a new Added series of different test cases regarding using the |
3ab7111
to
1421eff
Compare
* fix: Gradle Args parsing * refactor: Applied ARGVParser.parseArgsStringToArgv -> parseArgsStringToArgv suggestion * test: Added deeper testing for gradle argument parsing
Platforms affected
Android / Gradle Argument pass through
Motivation and Context
gradle expects a specific usage which Cordova doesn't conform to.
Currently we append the gradle arguments at the end of the gradle argument list, but option arguments are suppose to appear before the task(s).
Closes #1604
Additionally, while testing I also discovered that arguments that requires multiple values (e.g.
--warning-mode all
) doesn't get passed through properly, yielding an argument array that looks like:when the expect array should look like:
Description
nopt
does not fit here because it expects that you know what your CLI arguments are. However since these arguments are gradle arguments, it's better if we can parse them and pass them through. This package handles quotations and such to ensure a proper argv array is created.Testing
Ran
npm test
and manually tested in hello world app using commands such as:cordova build android --minSdkVersion 30 -- --gradleArg="--stacktrace"
cordova build android --minSdkVersion 30 -- --gradleArg="--stacktrace --warning-mode all"
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)