Skip to content

Commit

Permalink
[flutter_tools] remove pub dependencies from universal (#97722)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasguerrero committed Feb 12, 2022
1 parent 350e3ee commit f523ddd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/flutter_cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class PubDependencies extends ArtifactSet {
}) : _logger = logger,
_flutterRoot = flutterRoot,
_pub = pub,
super(DevelopmentArtifact.universal);
super(DevelopmentArtifact.web);

final String Function() _flutterRoot;
final Logger _logger;
Expand Down
24 changes: 11 additions & 13 deletions packages/flutter_tools/test/general.shard/cache_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,17 @@ void main() {

expect(() => cache.storageBaseUrl, throwsToolExit());
});

testWithoutContext('PubDependencies should be registered as web based', () async {
final BufferLogger logger = BufferLogger.test();
final PubDependencies pubDependencies = PubDependencies(
flutterRoot: () => '',
logger: logger,
pub: () => FakePub(),
);

expect(pubDependencies.developmentArtifact, DevelopmentArtifact.web);
});
});

testWithoutContext('flattenNameSubdirs', () {
Expand Down Expand Up @@ -1076,19 +1087,6 @@ class FakeSimpleArtifact extends CachedArtifact {
Future<void> updateInner(ArtifactUpdater artifactUpdater, FileSystem fileSystem, OperatingSystemUtils operatingSystemUtils) async { }
}

class FakeDownloadedArtifact extends CachedArtifact {
FakeDownloadedArtifact(this.downloadedFile, Cache cache) : super(
'fake',
cache,
DevelopmentArtifact.universal,
);

final File downloadedFile;

@override
Future<void> updateInner(ArtifactUpdater artifactUpdater, FileSystem fileSystem, OperatingSystemUtils operatingSystemUtils) async { }
}

class FakeSecondaryCachedArtifact extends Fake implements CachedArtifact {
bool upToDate = false;
bool didUpdate = false;
Expand Down

0 comments on commit f523ddd

Please sign in to comment.