Make FileSystem dependency explicit througout (more). (#148095)

This is part 14 of a broken down version of the #140101 refactor.

This is an extension of part 8 (#146008), which had omitted removing the filesystem dependency in the SkiaGoldClient class.

This only makes one dependency explicit. Further PRs will do the same for other dependencies, until these APIs have no hidden dependencies.

This particular change attempts to be minimal. I made no effort to keep the order of parameters reasonable here. I have a TODO to do a refactor sweep later that does nothing but reorder arguments/parameters/fields to be consistent.
This commit is contained in:
Ian Hickson 2024-05-20 21:25:37 -07:00 committed by GitHub
parent 165e535474
commit d02292dbc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -293,6 +293,7 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
baseDirectory, baseDirectory,
log: log, log: log,
platform: platform, platform: platform,
fs: fs,
); );
await goldens.auth(); await goldens.auth();
return FlutterPostSubmitFileComparator( return FlutterPostSubmitFileComparator(
@ -384,6 +385,7 @@ class FlutterPreSubmitFileComparator extends FlutterGoldenFileComparator {
baseDirectory, baseDirectory,
platform: platform, platform: platform,
log: log, log: log,
fs: fs,
); );
await goldens.auth(); await goldens.auth();
@ -470,6 +472,7 @@ class FlutterSkippingFileComparator extends FlutterGoldenFileComparator {
fs.directory(basedir), fs.directory(basedir),
platform: platform, platform: platform,
log: log, log: log,
fs: fs,
); );
return FlutterSkippingFileComparator( return FlutterSkippingFileComparator(
basedir, basedir,
@ -571,6 +574,7 @@ class FlutterLocalFileComparator extends FlutterGoldenFileComparator with LocalC
baseDirectory, baseDirectory,
platform: platform, platform: platform,
log: log, log: log,
fs: fs,
); );
try { try {
// Check if we can reach Gold. // Check if we can reach Gold.

View File

@ -8,7 +8,6 @@ import 'dart:io' as io;
import 'package:crypto/crypto.dart'; import 'package:crypto/crypto.dart';
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:file/local.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
import 'package:platform/platform.dart'; import 'package:platform/platform.dart';
import 'package:process/process.dart'; import 'package:process/process.dart';
@ -50,7 +49,7 @@ class SkiaGoldClient {
/// override the defaults for [fs], [process], and [httpClient]. /// override the defaults for [fs], [process], and [httpClient].
SkiaGoldClient( SkiaGoldClient(
this.workDirectory, { this.workDirectory, {
this.fs = const LocalFileSystem(), required this.fs,
this.process = const LocalProcessManager(), this.process = const LocalProcessManager(),
required this.platform, required this.platform,
Abi? abi, Abi? abi,