Fixes resulting from audit of issues links (#20772)
* Fixes resulting from audit of issues links I looked at every link to GitHub in our repo. For cases where we had a TODO that was waiting for a bug to be fixed, and the bug has now been fixed, I applied the pending change. For cases where the link was out of date, I updated the link. * Update run_test.dart skip this test again since it failed on linux and macos bots
This commit is contained in:
@@ -73,7 +73,7 @@ Future<Null> main(List<String> args) async {
|
||||
new PrecacheCommand(),
|
||||
new RunCommand(verboseHelp: verboseHelp),
|
||||
new ScreenshotCommand(),
|
||||
new ShellCompletionCommand(verboseHelp: verboseHelp),
|
||||
new ShellCompletionCommand(),
|
||||
new StopCommand(),
|
||||
new TestCommand(verboseHelp: verboseHelp),
|
||||
new TraceCommand(),
|
||||
|
||||
@@ -17,7 +17,6 @@ import '../base/io.dart';
|
||||
import '../base/logger.dart';
|
||||
import '../base/process.dart';
|
||||
import '../base/process_manager.dart';
|
||||
import '../base/utils.dart';
|
||||
import '../build_info.dart';
|
||||
import '../device.dart';
|
||||
import '../globals.dart';
|
||||
@@ -519,32 +518,6 @@ class AndroidDevice extends Device {
|
||||
await runCheckedAsync(adbCommandForDevice(<String>['pull', remotePath, outputFile.path]));
|
||||
await runCheckedAsync(adbCommandForDevice(<String>['shell', 'rm', remotePath]));
|
||||
}
|
||||
|
||||
// TODO(dantup): discoverApps is no longer used and can possibly be removed.
|
||||
// Waiting for a response here:
|
||||
// https://github.com/flutter/flutter/pull/18873#discussion_r198862179
|
||||
@override
|
||||
Future<List<DiscoveredApp>> discoverApps() async {
|
||||
final RegExp discoverExp = new RegExp(r'DISCOVER: (.*)');
|
||||
final List<DiscoveredApp> result = <DiscoveredApp>[];
|
||||
final StreamSubscription<String> logs = getLogReader().logLines.listen((String line) {
|
||||
final Match match = discoverExp.firstMatch(line);
|
||||
if (match != null) {
|
||||
final Map<String, dynamic> app = json.decode(match.group(1));
|
||||
result.add(new DiscoveredApp(app['id'], app['observatoryPort']));
|
||||
}
|
||||
});
|
||||
|
||||
await runCheckedAsync(adbCommandForDevice(<String>[
|
||||
'shell', 'am', 'broadcast', '-a', 'io.flutter.view.DISCOVER'
|
||||
]));
|
||||
|
||||
await waitGroup<Null>(<Future<Null>>[
|
||||
new Future<Null>.delayed(const Duration(seconds: 1)),
|
||||
logs.cancel(),
|
||||
]);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> parseAdbDeviceProperties(String str) {
|
||||
|
||||
@@ -361,11 +361,7 @@ class AndroidSdk {
|
||||
if (platformsDir.existsSync()) {
|
||||
platforms = platformsDir
|
||||
.listSync()
|
||||
.where((FileSystemEntity entity) => entity is Directory)
|
||||
.map<Directory>((FileSystemEntity entity) {
|
||||
final Directory dir = entity;
|
||||
return dir;
|
||||
});
|
||||
.whereType<Directory>();
|
||||
}
|
||||
|
||||
List<Version> buildTools = <Version>[]; // 19.1.0, 22.0.1, ...
|
||||
|
||||
@@ -150,8 +150,7 @@ class AndroidStudio implements Comparable<AndroidStudio> {
|
||||
final Iterable<Directory> directories = fs
|
||||
.directory(path)
|
||||
.listSync()
|
||||
.where((FileSystemEntity e) => e is Directory)
|
||||
.cast<Directory>();
|
||||
.whereType<Directory>();
|
||||
for (Directory directory in directories) {
|
||||
final String name = directory.basename;
|
||||
// An exact match, or something like 'Android Studio 3.0 Preview.app'.
|
||||
|
||||
@@ -46,14 +46,7 @@ Future<ReplayProcessManager> getReplayProcessManager(String location) async {
|
||||
|
||||
ProcessManager manager;
|
||||
try {
|
||||
manager = await ReplayProcessManager.create(dir,
|
||||
// TODO(tvolkert): Once https://github.com/flutter/flutter/issues/7166 is
|
||||
// resolved, we can use the default `streamDelay`. In the
|
||||
// meantime, native file I/O operations cause our `tail` process
|
||||
// streams to flush before our protocol discovery is listening on
|
||||
// them, causing us to timeout waiting for the observatory port.
|
||||
streamDelay: const Duration(milliseconds: 50),
|
||||
);
|
||||
manager = await ReplayProcessManager.create(dir);
|
||||
} on ArgumentError catch (error) {
|
||||
throwToolExit('Invalid replay-from: $error');
|
||||
}
|
||||
|
||||
@@ -25,22 +25,6 @@ class AnsiTerminal {
|
||||
static const String _reset = '\u001B[0m';
|
||||
static const String _clear = '\u001B[2J\u001B[H';
|
||||
|
||||
static const int _EBADF = 9;
|
||||
static const int _ENXIO = 6;
|
||||
static const int _ENOTTY = 25;
|
||||
static const int _ENETRESET = 102;
|
||||
static const int _INVALID_HANDLE = 6;
|
||||
|
||||
/// Setting the line mode can throw for some terminals (with "Operation not
|
||||
/// supported on socket"), but the error can be safely ignored.
|
||||
static const List<int> _lineModeIgnorableErrors = <int>[
|
||||
_EBADF,
|
||||
_ENXIO,
|
||||
_ENOTTY,
|
||||
_ENETRESET,
|
||||
_INVALID_HANDLE,
|
||||
];
|
||||
|
||||
bool supportsColor = platform.stdoutSupportsAnsi;
|
||||
|
||||
String bolden(String message) {
|
||||
@@ -59,24 +43,15 @@ class AnsiTerminal {
|
||||
String clearScreen() => supportsColor ? _clear : '\n\n';
|
||||
|
||||
set singleCharMode(bool value) {
|
||||
// TODO(goderbauer): instead of trying to set lineMode and then catching
|
||||
// [_ENOTTY] or [_INVALID_HANDLE], we should check beforehand if stdin is
|
||||
// connected to a terminal or not.
|
||||
// (Requires https://github.com/dart-lang/sdk/issues/29083 to be resolved.)
|
||||
final Stream<List<int>> stdin = io.stdin;
|
||||
if (stdin is io.Stdin) {
|
||||
try {
|
||||
// The order of setting lineMode and echoMode is important on Windows.
|
||||
if (value) {
|
||||
stdin.echoMode = false;
|
||||
stdin.lineMode = false;
|
||||
} else {
|
||||
stdin.lineMode = true;
|
||||
stdin.echoMode = true;
|
||||
}
|
||||
} on io.StdinException catch (error) {
|
||||
if (!_lineModeIgnorableErrors.contains(error.osError?.errorCode))
|
||||
rethrow;
|
||||
if (stdin is io.Stdin && stdin.hasTerminal) {
|
||||
// The order of setting lineMode and echoMode is important on Windows.
|
||||
if (value) {
|
||||
stdin.echoMode = false;
|
||||
stdin.lineMode = false;
|
||||
} else {
|
||||
stdin.lineMode = true;
|
||||
stdin.echoMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class BuildCommand extends FlutterCommand {
|
||||
addSubcommand(new BuildApkCommand(verboseHelp: verboseHelp));
|
||||
addSubcommand(new BuildAotCommand(verboseHelp: verboseHelp));
|
||||
addSubcommand(new BuildIOSCommand(verboseHelp: verboseHelp));
|
||||
addSubcommand(new BuildFlxCommand(verboseHelp: verboseHelp));
|
||||
addSubcommand(new BuildFlxCommand());
|
||||
addSubcommand(new BuildBundleCommand(verboseHelp: verboseHelp));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ import '../globals.dart';
|
||||
import 'build.dart';
|
||||
|
||||
class BuildFlxCommand extends BuildSubCommand {
|
||||
|
||||
BuildFlxCommand({bool verboseHelp = false});
|
||||
@override
|
||||
final String name = 'flx';
|
||||
|
||||
|
||||
@@ -129,10 +129,7 @@ class CreateCommand extends FlutterCommand {
|
||||
final bool generatePackage = template == 'package';
|
||||
|
||||
final Directory projectDir = fs.directory(argResults.rest.first);
|
||||
String dirPath = fs.path.normalize(projectDir.absolute.path);
|
||||
// TODO(goderbauer): Work-around for: https://github.com/dart-lang/path/issues/24
|
||||
if (fs.path.basename(dirPath) == '.')
|
||||
dirPath = fs.path.dirname(dirPath);
|
||||
final String dirPath = fs.path.normalize(projectDir.absolute.path);
|
||||
String organization = argResults['org'];
|
||||
if (!argResults.wasParsed('org')) {
|
||||
final FlutterProject project = await FlutterProject.fromDirectory(projectDir);
|
||||
|
||||
@@ -231,13 +231,9 @@ class IdeConfigCommand extends FlutterCommand {
|
||||
}
|
||||
|
||||
final String flutterRoot = fs.path.absolute(Cache.flutterRoot);
|
||||
String dirPath = fs.path.normalize(
|
||||
final String dirPath = fs.path.normalize(
|
||||
fs.directory(fs.path.absolute(Cache.flutterRoot)).absolute.path,
|
||||
);
|
||||
// TODO(goderbauer): Work-around for: https://github.com/dart-lang/path/issues/24
|
||||
if (fs.path.basename(dirPath) == '.') {
|
||||
dirPath = fs.path.dirname(dirPath);
|
||||
}
|
||||
|
||||
final String error = _validateFlutterDir(dirPath, flutterRoot: flutterRoot);
|
||||
if (error != null) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import '../base/io.dart';
|
||||
import '../runner/flutter_command.dart';
|
||||
|
||||
class ShellCompletionCommand extends FlutterCommand {
|
||||
ShellCompletionCommand({bool verboseHelp = false}) {
|
||||
ShellCompletionCommand() {
|
||||
argParser.addFlag(
|
||||
'overwrite',
|
||||
defaultsTo: false,
|
||||
|
||||
@@ -277,13 +277,6 @@ abstract class Device {
|
||||
|
||||
Future<void> takeScreenshot(File outputFile) => new Future<Null>.error('unimplemented');
|
||||
|
||||
// TODO(dantup): discoverApps is no longer used and can possibly be removed.
|
||||
// Waiting for a response here:
|
||||
// https://github.com/flutter/flutter/pull/18873#discussion_r198862179
|
||||
/// Find the apps that are currently running on this device.
|
||||
Future<List<DiscoveredApp>> discoverApps() =>
|
||||
new Future<List<DiscoveredApp>>.value(<DiscoveredApp>[]);
|
||||
|
||||
@override
|
||||
int get hashCode => id.hashCode;
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class Doctor {
|
||||
}
|
||||
|
||||
List<Workflow> get workflows {
|
||||
return new List<Workflow>.from(validators.where((DoctorValidator validator) => validator is Workflow));
|
||||
return validators.whereType<Workflow>().toList();
|
||||
}
|
||||
|
||||
/// Print a summary of the state of the tooling, as well as how to get more info.
|
||||
@@ -479,19 +479,17 @@ class IntelliJValidatorOnMac extends IntelliJValidator {
|
||||
}
|
||||
|
||||
try {
|
||||
final Iterable<FileSystemEntity> installDirs = installPaths
|
||||
final Iterable<Directory> installDirs = installPaths
|
||||
.map((String installPath) => fs.directory(installPath))
|
||||
.map((Directory dir) => dir.existsSync() ? dir.listSync() : <FileSystemEntity>[])
|
||||
.expand((List<FileSystemEntity> mappedDirs) => mappedDirs)
|
||||
.where((FileSystemEntity mappedDir) => mappedDir is Directory);
|
||||
for (FileSystemEntity dir in installDirs) {
|
||||
if (dir is Directory) {
|
||||
checkForIntelliJ(dir);
|
||||
if (!dir.path.endsWith('.app')) {
|
||||
for (FileSystemEntity subdir in dir.listSync()) {
|
||||
if (subdir is Directory) {
|
||||
checkForIntelliJ(subdir);
|
||||
}
|
||||
.whereType<Directory>();
|
||||
for (Directory dir in installDirs) {
|
||||
checkForIntelliJ(dir);
|
||||
if (!dir.path.endsWith('.app')) {
|
||||
for (FileSystemEntity subdir in dir.listSync()) {
|
||||
if (subdir is Directory) {
|
||||
checkForIntelliJ(subdir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,8 @@ class VsCode {
|
||||
final Iterable<FileSystemEntity> extensionDirs = fs
|
||||
.directory(extensionDirectory)
|
||||
.listSync()
|
||||
.where((FileSystemEntity d) => d is Directory)
|
||||
.where(
|
||||
(FileSystemEntity d) => d.basename.toLowerCase().startsWith(extensionIdentifierLower));
|
||||
.whereType<Directory>()
|
||||
.where((Directory d) => d.basename.toLowerCase().startsWith(extensionIdentifierLower));
|
||||
|
||||
if (extensionDirs.isNotEmpty) {
|
||||
final FileSystemEntity extensionDir = extensionDirs.first;
|
||||
|
||||
@@ -196,8 +196,8 @@ void main() {
|
||||
}
|
||||
fileFilter.addAll(fs.directory(pkgUri)
|
||||
.listSync(recursive: true)
|
||||
.where((FileSystemEntity file) => file is File)
|
||||
.map((FileSystemEntity file) => canonicalizePath(file.path))
|
||||
.whereType<File>()
|
||||
.map<String>((File file) => canonicalizePath(file.path))
|
||||
.toList());
|
||||
}
|
||||
final int bytes = await devFS.update(fileFilter: fileFilter);
|
||||
|
||||
Reference in New Issue
Block a user