Update flutter_tools to use package:file throughout (#7385)
This removes direct file access from within flutter_tools in favor of using `package:file` via a `FileSystem` that's accessed via the `ApplicationContext`. This lays the groundwork for us to be able to easily swap out the underlying file system when running Flutter tools, which will be used to provide a record/replay file system, analogous to what we have for process invocations.
This commit is contained in:
@@ -7,6 +7,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter_tools/src/base/config.dart';
|
||||
import 'package:flutter_tools/src/base/context.dart';
|
||||
import 'package:flutter_tools/src/base/file_system.dart';
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/base/os.dart';
|
||||
import 'package:flutter_tools/src/base/process_manager.dart';
|
||||
@@ -41,6 +42,7 @@ void testUsingContext(String description, dynamic testMethod(), {
|
||||
|
||||
// Initialize the test context with some default mocks.
|
||||
// Seed these context entries first since others depend on them
|
||||
testContext.putIfAbsent(FileSystem, () => new LocalFileSystem());
|
||||
testContext.putIfAbsent(ProcessManager, () => new ProcessManager());
|
||||
testContext.putIfAbsent(Logger, () => new BufferLogger());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user