Unverified Commit 07161e82 authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

[flutter_tool] Don't use context in ProcessUtils (#48444)

parent 4e6d649f
...@@ -255,7 +255,7 @@ Future<int> _exit(int code) async { ...@@ -255,7 +255,7 @@ Future<int> _exit(int code) async {
} }
// Run shutdown hooks before flushing logs // Run shutdown hooks before flushing logs
await runShutdownHooks(); await shutdownHooks.runShutdownHooks();
final Completer<void> completer = Completer<void>(); final Completer<void> completer = Completer<void>();
......
...@@ -907,7 +907,7 @@ Directory _getLocalEngineRepo({ ...@@ -907,7 +907,7 @@ Directory _getLocalEngineRepo({
.createTempSync('flutter_tool_local_engine_repo.'); .createTempSync('flutter_tool_local_engine_repo.');
// Remove the local engine repo before the tool exits. // Remove the local engine repo before the tool exits.
addShutdownHook( shutdownHooks.addShutdownHook(
() => localEngineRepo.deleteSync(recursive: true), () => localEngineRepo.deleteSync(recursive: true),
ShutdownStage.CLEANUP, ShutdownStage.CLEANUP,
); );
......
...@@ -288,7 +288,7 @@ abstract class IOSApp extends ApplicationPackage { ...@@ -288,7 +288,7 @@ abstract class IOSApp extends ApplicationPackage {
} else { } else {
// Try to unpack as an ipa. // Try to unpack as an ipa.
final Directory tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_app.'); final Directory tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_app.');
addShutdownHook(() async { shutdownHooks.addShutdownHook(() async {
await tempDir.delete(recursive: true); await tempDir.delete(recursive: true);
}, ShutdownStage.STILL_RECORDING); }, ShutdownStage.STILL_RECORDING);
os.unzip(globals.fs.file(applicationBinary), tempDir); os.unzip(globals.fs.file(applicationBinary), tempDir);
......
...@@ -120,8 +120,12 @@ Future<T> runInContext<T>( ...@@ -120,8 +120,12 @@ Future<T> runInContext<T>(
OperatingSystemUtils: () => OperatingSystemUtils(), OperatingSystemUtils: () => OperatingSystemUtils(),
PersistentToolState: () => PersistentToolState(), PersistentToolState: () => PersistentToolState(),
ProcessInfo: () => ProcessInfo(), ProcessInfo: () => ProcessInfo(),
ProcessUtils: () => ProcessUtils(), ProcessUtils: () => ProcessUtils(
processManager: globals.processManager,
logger: globals.logger,
),
Pub: () => const Pub(), Pub: () => const Pub(),
ShutdownHooks: () => ShutdownHooks(logger: globals.logger),
Signals: () => Signals(), Signals: () => Signals(),
SimControl: () => SimControl(), SimControl: () => SimControl(),
Stdio: () => const Stdio(), Stdio: () => const Stdio(),
......
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