Skip to content
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(build): Allow platform args with double dash #1516

Merged
merged 1 commit into from
Dec 25, 2024

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Dec 21, 2024

Platforms affected

iOS

Motivation and Context

The Cordova docs say to provide platform-specific arguments after a -- on the CLI. Currently this works on Android, but does not work for iOS.

Closes GH-1488.

Description

Ensure that we parse any extra (platform-specific) arguments passed from cordova-cli in to the iOS build command through options.argv. These are arguments that are provided after a -- to the CLI command.

There is no change for existing arguments passed without the double dash.

The priority of arguments is now:

  1. Platform-specific arguments passed after a double-dash.
  2. Arguments passed without a double-dash (current behaviour).
  3. Values provided in a build.json config file.

Testing

Added unit tests to cover argument parsing and fallback behaviour.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)

@dpogue dpogue added this to the 8.0.0 milestone Dec 21, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 80.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 81.34%. Comparing base (3737f51) to head (b81f3c5).

Files with missing lines Patch % Lines
lib/build.js 80.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1516      +/-   ##
==========================================
+ Coverage   80.84%   81.34%   +0.50%     
==========================================
  Files          16       16              
  Lines        1848     1855       +7     
==========================================
+ Hits         1494     1509      +15     
+ Misses        354      346       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tested command while passing in buildFlag.

  • Before --
  • After --
  • Before and After --
    • Arguments after -- are used. Before will be dropped as expected.
  • Before -- with build.json
    • Arguments in build.json are dropped in favor for CLI args. No merging.
  • After -- with build.json
    • Arguments in build.json are dropped in favor for CLI args. No merging.
  • build.json only

@dpogue dpogue merged commit c1004fe into apache:master Dec 25, 2024
11 checks passed
@dpogue dpogue deleted the fix-args branch December 25, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double dash prevents forwarding platform-specific options
3 participants