Skip to content

Commit

Permalink
Make FileSystem dependency explicit througout (more). (#148095)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Hixie committed May 21, 2024
1 parent 165e535 commit d02292d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/flutter_goldens/lib/flutter_goldens.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
baseDirectory,
log: log,
platform: platform,
fs: fs,
);
await goldens.auth();
return FlutterPostSubmitFileComparator(
Expand Down Expand Up @@ -384,6 +385,7 @@ class FlutterPreSubmitFileComparator extends FlutterGoldenFileComparator {
baseDirectory,
platform: platform,
log: log,
fs: fs,
);

await goldens.auth();
Expand Down Expand Up @@ -470,6 +472,7 @@ class FlutterSkippingFileComparator extends FlutterGoldenFileComparator {
fs.directory(basedir),
platform: platform,
log: log,
fs: fs,
);
return FlutterSkippingFileComparator(
basedir,
Expand Down Expand Up @@ -571,6 +574,7 @@ class FlutterLocalFileComparator extends FlutterGoldenFileComparator with LocalC
baseDirectory,
platform: platform,
log: log,
fs: fs,
);
try {
// Check if we can reach Gold.
Expand Down
3 changes: 1 addition & 2 deletions packages/flutter_goldens/lib/skia_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'dart:io' as io;

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

0 comments on commit d02292d

Please sign in to comment.