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

refactor!: drop support for android SDK tool #1083

Merged
merged 4 commits into from
Apr 13, 2021

Conversation

raphinesse
Copy link
Contributor

@raphinesse raphinesse commented Oct 5, 2020

Motivation and Context

We have multiple places where we support both the legacy android SDK tool as well as avdmanager and sdkmanager from current SDK tools. This makes code more complicated and maintenance more difficult.

This PR removes the support for the android CLI tool from our code base. After this change, to use cordova-android users will need either:

Closes #595 #741

Description

  • emulator.list_images now always uses the avdmanager binary.
  • android_sdk.list_targets now always uses the avdmanager binary.
  • check_reqs.check_android does not consider legacy android binary for SDK detection anymore
  • We do not give error messages that involve using the legacy android binary anymore

There are multiple opportunities for further simplification after the code removal in this PR. I already have seized some of these in a local branch but I would prefer to open new PRs for these after this is merged.

Testing

  • Existing unit and E2E tests pass
  • The following manual tests give the expected results on my machine:
    • node -e "require('./bin/templates/cordova/lib/emulator').list_images().then(console.log)"
    • node -e "require('./bin/templates/cordova/lib/android_sdk').list_targets().then(console.log)"
    • node -e "require('./bin/templates/cordova/lib/check_reqs').check_android().then(console.log)"

Copy link
Contributor

@purplecabbage purplecabbage left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Contributor

@breautek breautek 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 adding the platform and building/running on emulator using one of my apps.

@raphinesse
Copy link
Contributor Author

Thanks for the review everyone! Since this is a breaking change for next major, how do we want to continue with this PR?

  • merge it into master now
  • leave it sitting open until we're confident not to release patches/minors for 9 anymore
  • integrate it into a long-running next-major branch where we collect breaking changes for next major

Side note: I will probably need some integration branch for multiple breaking changes anyway

@breautek
Copy link
Contributor

breautek commented Oct 6, 2020

integrate it into a long-running next-major branch where we collect breaking changes for next major

This might be a good idea for testing PRs against the collection of other breaking changes to be released.

raphinesse added a commit to raphinesse/cordova-android that referenced this pull request Oct 19, 2020
raphinesse added a commit to raphinesse/cordova-android that referenced this pull request Oct 22, 2020
@codecov-io
Copy link

codecov-io commented Nov 19, 2020

Codecov Report

Merging #1083 (caf8a3e) into master (aa679ea) will decrease coverage by 0.90%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1083      +/-   ##
==========================================
- Coverage   71.41%   70.50%   -0.91%     
==========================================
  Files          20       20              
  Lines        1770     1719      -51     
==========================================
- Hits         1264     1212      -52     
- Misses        506      507       +1     
Impacted Files Coverage Δ
bin/templates/cordova/lib/android_sdk.js 96.00% <100.00%> (-4.00%) ⬇️
bin/templates/cordova/lib/check_reqs.js 67.55% <100.00%> (-2.70%) ⬇️
bin/templates/cordova/lib/emulator.js 98.86% <100.00%> (-0.17%) ⬇️

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 aa679ea...caf8a3e. Read the comment docs.

@erisu erisu merged commit 9c3195c into apache:master Apr 13, 2021
@raphinesse raphinesse deleted the drop-android-cli-tool-support branch June 24, 2021 11:48
wedgberto pushed a commit to wedgberto/cordova-android that referenced this pull request May 17, 2022
* refactor(emulator)!: remove support for legacy `android` binary
`emulator.list_images` now always uses the `avdmanager` binary.
* refactor(android_sdk)!: remove support for legacy `android` binary
`android_sdk.list_targets` now always uses the `avdmanager` binary.
* refactor(check_reqs)!: do not look for legacy `android` binary
* refactor: replace installation instructions involving `android` binary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants