Skip to content

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

Merged
merged 1 commit into from
Jan 24, 2018

Conversation

cbracken
Copy link
Member

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.

@cbracken
Copy link
Member Author

Prefactoring for the fix to #14190, #13353, #9959.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -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');
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member Author

@cbracken cbracken Jan 24, 2018

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.

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.
@cbracken cbracken merged commit 9654659 into flutter:master Jan 24, 2018
@cbracken cbracken deleted the android-sdkmanager branch January 24, 2018 20:38
DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018
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.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants