This reverts commit f221ad1f92.
This commit is contained in:
@@ -19,14 +19,12 @@ import 'base/user_messages.dart';
|
||||
import 'base/utils.dart';
|
||||
import 'base/version.dart';
|
||||
import 'cache.dart';
|
||||
import 'desktop.dart';
|
||||
import 'device.dart';
|
||||
import 'fuchsia/fuchsia_workflow.dart';
|
||||
import 'globals.dart';
|
||||
import 'intellij/intellij.dart';
|
||||
import 'ios/ios_workflow.dart';
|
||||
import 'ios/plist_utils.dart';
|
||||
import 'linux/linux_doctor.dart';
|
||||
import 'linux/linux_workflow.dart';
|
||||
import 'macos/cocoapods_validator.dart';
|
||||
import 'macos/macos_workflow.dart';
|
||||
@@ -71,19 +69,12 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
|
||||
if (iosWorkflow.appliesToHostPlatform)
|
||||
_validators.add(iosValidator);
|
||||
|
||||
if (windowsWorkflow.appliesToHostPlatform)
|
||||
_validators.add(visualStudioValidator);
|
||||
|
||||
if (webWorkflow.appliesToHostPlatform)
|
||||
_validators.add(const WebValidator());
|
||||
|
||||
// Add desktop doctors to workflow if the flag is enabled.
|
||||
if (flutterDesktopEnabled) {
|
||||
if (linuxWorkflow.appliesToHostPlatform) {
|
||||
_validators.add(LinuxDoctorValidator());
|
||||
}
|
||||
if (windowsWorkflow.appliesToHostPlatform) {
|
||||
_validators.add(visualStudioValidator);
|
||||
}
|
||||
}
|
||||
|
||||
final List<DoctorValidator> ideValidators = <DoctorValidator>[];
|
||||
ideValidators.addAll(AndroidStudioValidator.allValidators);
|
||||
ideValidators.addAll(IntelliJValidator.installedValidators);
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
// Copyright 2019 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import '../base/io.dart';
|
||||
import '../base/process_manager.dart';
|
||||
import '../base/version.dart';
|
||||
import '../doctor.dart';
|
||||
|
||||
/// A validator that checks for Clang and Make build dependencies
|
||||
class LinuxDoctorValidator extends DoctorValidator {
|
||||
LinuxDoctorValidator() : super('Linux toolchain - develop for Linux desktop');
|
||||
|
||||
/// The minimum version of clang supported.
|
||||
final Version minimumClangVersion = Version(3, 4, 0);
|
||||
|
||||
@override
|
||||
Future<ValidationResult> validate() async {
|
||||
ValidationType validationType = ValidationType.installed;
|
||||
final List<ValidationMessage> messages = <ValidationMessage>[];
|
||||
/// Check for a minimum version of Clang.
|
||||
final ProcessResult clangResult = await processManager.run(const <String>[
|
||||
'clang++',
|
||||
'--version',
|
||||
]);
|
||||
if (clangResult.exitCode != 0) {
|
||||
validationType = ValidationType.missing;
|
||||
messages.add(ValidationMessage.error('clang++ is not installed'));
|
||||
} else {
|
||||
final String firstLine = clangResult.stdout.split('\n').first.trim();
|
||||
final String versionString = RegExp(r'[0-9]+\.[0-9]+\.[0-9]+').firstMatch(firstLine).group(0);
|
||||
final Version version = Version.parse(versionString);
|
||||
if (version >= minimumClangVersion) {
|
||||
messages.add(ValidationMessage('clang++ $version'));
|
||||
} else {
|
||||
validationType = ValidationType.partial;
|
||||
messages.add(ValidationMessage.error('clang++ $version is below minimum version of $minimumClangVersion'));
|
||||
}
|
||||
}
|
||||
|
||||
/// Check for make.
|
||||
// TODO(jonahwilliams): tighten this check to include a version when we have
|
||||
// a better idea about what is supported.
|
||||
final ProcessResult makeResult = await processManager.run(const <String>[
|
||||
'make',
|
||||
'--version',
|
||||
]);
|
||||
if (makeResult.exitCode != 0) {
|
||||
validationType = ValidationType.missing;
|
||||
messages.add(ValidationMessage.error('make is not installed'));
|
||||
} else {
|
||||
final String firstLine = makeResult.stdout.split('\n').first.trim();
|
||||
messages.add(ValidationMessage(firstLine));
|
||||
}
|
||||
|
||||
return ValidationResult(validationType, messages);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user