Unverified Commit f9cd87e6 authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

[flutter_tools] Add documentation to "cmdline-tools component is missing"...

[flutter_tools] Add documentation to "cmdline-tools component is missing" doctor validation error (#83356)
parent b9377f35
...@@ -186,7 +186,7 @@ class AndroidValidator extends DoctorValidator { ...@@ -186,7 +186,7 @@ class AndroidValidator extends DoctorValidator {
return ValidationResult(ValidationType.missing, messages); return ValidationResult(ValidationType.missing, messages);
} }
if (!androidSdk.cmdlineToolsAvailable) { if (!androidSdk.cmdlineToolsAvailable) {
messages.add(const ValidationMessage.error('cmdline-tools component is missing')); messages.add(ValidationMessage.error(_userMessages.androidMissingCmdTools));
return ValidationResult(ValidationType.missing, messages); return ValidationResult(ValidationType.missing, messages);
} }
......
...@@ -120,6 +120,9 @@ class UserMessages { ...@@ -120,6 +120,9 @@ class UserMessages {
String androidSdkBuildToolsOutdated(String managerPath, int sdkMinVersion, String buildToolsMinVersion, Platform platform) => String androidSdkBuildToolsOutdated(String managerPath, int sdkMinVersion, String buildToolsMinVersion, Platform platform) =>
'Flutter requires Android SDK $sdkMinVersion and the Android BuildTools $buildToolsMinVersion\n' 'Flutter requires Android SDK $sdkMinVersion and the Android BuildTools $buildToolsMinVersion\n'
'To update the Android SDK visit ${_androidSdkInstallUrl(platform)} for detailed instructions.'; 'To update the Android SDK visit ${_androidSdkInstallUrl(platform)} for detailed instructions.';
String get androidMissingCmdTools => 'cmdline-tools component is missing\n'
'Run `path/to/sdkmanager --install "cmdline-tools;latest"`\n'
'See https://developer.android.com/studio/command-line for more details.';
// Messages used in AndroidStudioValidator // Messages used in AndroidStudioValidator
String androidStudioVersion(String version) => 'version $version'; String androidStudioVersion(String version) => 'version $version';
......
...@@ -395,11 +395,13 @@ Review licenses that have not been accepted (y/N)? ...@@ -395,11 +395,13 @@ Review licenses that have not been accepted (y/N)?
userMessages: UserMessages(), userMessages: UserMessages(),
); );
final String errorMessage = UserMessages().androidMissingCmdTools;
final ValidationResult validationResult = await androidValidator.validate(); final ValidationResult validationResult = await androidValidator.validate();
expect(validationResult.type, ValidationType.missing); expect(validationResult.type, ValidationType.missing);
expect( expect(
validationResult.messages.last.message, validationResult.messages.last.message,
'cmdline-tools component is missing', errorMessage,
); );
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment