-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Add AndroidSdk.sdkManagerPath, sdkManagerVersion #14247
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
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.
LGTM
a36919b
to
733b238
Compare
@@ -285,6 +286,24 @@ class AndroidSdk { | |||
_latestVersion = _sdkVersions.isEmpty ? null : _sdkVersions.last; | |||
} | |||
|
|||
/// Returns the filesystem path of the Android SDK manager tool or null if not found. | |||
String get sdkManagerPath { | |||
final String toolPath = fs.path.join(directory, 'tools', 'bin', 'sdkmanager'); |
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.
What about the Windows check we had previously where we were adding .bat
?
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.
You should only be executing this with processManager, which automatically figures out the correct ending.
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.
Right, but we'll return null
from this method on Windows, unless I'm missing something -- we check fs.isFileSync(toolPath)
immediately below here.
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.
Switched to canRun
, which handles the platform differences. Also got rid of the check in the path getter for consistency with other path getters in this file. Moved it to the version check.
733b238
to
c2be7f0
Compare
Convenience getters for the the path to the Android SDK manager and the currently installed version of the tool. Pre-factoring to support better checks around the --android-licenses command, which uses a feature of the SDK manager that is unsupported in older versions of the tool.
c2be7f0
to
de51636
Compare
Convenience getters for the the path to the Android SDK manager and the currently installed version of the tool. Pre-factoring to support better checks around the --android-licenses command, which uses a feature of the SDK manager that is unsupported in older versions of the tool.
Convenience getters for the the path to the Android SDK manager and the
currently installed version of the tool.
Pre-factoring to support better checks around the --android-licenses
command, which uses a feature of the SDK manager that is unsupported in
older versions of the tool.