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: gradle build tools config #1293

Merged
merged 1 commit into from Jul 26, 2021

Conversation

breautek
Copy link
Contributor

@breautek breautek commented Jul 26, 2021

Platforms affected

android

Motivation and Context

Fixes a regression outlined in #1290

Closes #1290

While cordova-android always used the latest build tools version by default, through gradle parameters users could pin their build tools version to a specific version. In 10.x this behaviour was changed so that the gradle parameter value was used as hte minimum version instead of the desired build tools version.

Description

I added a MIN_BUILD_TOOLS_VERSION as our declared minimum build tools version. The previously declared BUILD_TOOLS_VERSION now is unset by default, but will become either the latest build tools version that is available or the declared build tools version configured by config.xml preference or the gradle args CLI parameter.

LATEST_INSTALLED_BUILD_TOOLS config variable was completely removed in favour of BUILD_TOOLS_VERSION

The above changes were made in effort to not introduce anything breaking.

Requires #1294 to fix CI testing.

Testing

Ran npm test successfully.

Manually testing the following cases:

  • Default configuration, latest build tools version 29 errors out as expected (min 30.0.3)
  • Default configuration, latest build tools version 30.0.3 runs successfully.
  • Default configuration, latest build tools version 31 runs successfully as expected (uses 30.0.3)
  • android-buildtoolsversion preference 29, errors out as expected (min 30.0.3)
  • android-buildtoolsversion preference 30.0.3 runs successfully
  • --gradleArg=-PcdvBuildToolsVersion=29.0.3 errors out as expected (min 30.0.3)
  • --gradleArg=-PcdvBuildToolsVersion=30.0.3 runs successfully

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • 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)
  • I've updated the documentation if necessary

@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2021

Codecov Report

Merging #1293 (a33ef91) into master (5e50c1d) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1293   +/-   ##
=======================================
  Coverage   73.25%   73.25%           
=======================================
  Files          21       21           
  Lines        1645     1645           
=======================================
  Hits         1205     1205           
  Misses        440      440           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e50c1d...a33ef91. Read the comment docs.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

gradle args cdvBuildToolsVersion is not correctly honoured
3 participants