-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: cordova requirements command and SDK lookup based on tools #1877
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1877 +/- ##
==========================================
+ Coverage 60.77% 61.39% +0.62%
==========================================
Files 23 24 +1
Lines 4813 4919 +106
==========================================
+ Hits 2925 3020 +95
- Misses 1888 1899 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fc9a44f to
6741c41
Compare
6ffcd66 to
a28582c
Compare
erisu
left a comment
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.
Everything looks OK to me.
I just added a few nitpicks 😄
I've been updating license headers across the board to follow a consistent pattern for the various file types.
Co-authored-by: エリス <[email protected]>
Co-authored-by: エリス <[email protected]>
Co-authored-by: エリス <[email protected]>
Platforms affected
Android/All OS
Motivation and Context
Fixes #1841
Description
This PR does two things:
The resolving algorithm will prefer the
"latest"(a specific Android SDK package that installs the cmdline tools to alatestdirectory), however if this package is not installed, it will choose the latest stable versioned cmdline-tools, e.g.19.0. It usessemverto coarce the directory names and sort them in descending order.Prelease packages are acceptable but prioritized lower than stable releases of the same version.
Directories that are not parseable as a version are ignored.
Directories that are valid name wise are not asserted for it's contents and assumes that it's structure matches what is expected based on Android SDK cmdline-tools installation.
$ANDROID_HOME/tools/binbinaries. These are legacy tools that are not compatible with modern toolsets. The cmdline-tools is the replacement. There is existing code that would infer the Android SDK home directory based on the result ofwhichofavdmanagerAdditional Notes
The cmd-line tools resolution prefers the latest cmdline-tools version possible because that is what our guide says to install. However cmdline-tools can introduce breaking changes. Typically in the java runtime required to run these tools.
It would be better if we define a version or a range of versions for Cordova CLI to prefer, but doing so I'd consider out of scope for addressing the reported issue.
Testing
npm test passes.
Manually tested on windows using
cordova requirements android/cordova build android:Checklist
(platform)if this change only applies to one platform (e.g.(android))