mirror of
https://github.com/flutter/flutter
synced 2024-09-22 01:32:07 +00:00
Inline buildScriptSnapshot calls (#16940)
This commit is contained in:
parent
993f3947da
commit
f570e046c9
|
@ -375,15 +375,6 @@ void main() {
|
|||
}));
|
||||
}
|
||||
|
||||
Future<Null> buildScriptSnapshot({ String mainPath = 'main.dart' }) {
|
||||
return snapshotter.buildScriptSnapshot(
|
||||
mainPath: mainPath,
|
||||
snapshotPath: 'output.snapshot',
|
||||
depfilePath: 'output.snapshot.d',
|
||||
packagesPath: '.packages',
|
||||
);
|
||||
}
|
||||
|
||||
void expectFingerprintHas({
|
||||
String entryPoint: 'main.dart',
|
||||
Map<String, String> checksums = const <String, String>{},
|
||||
|
@ -402,7 +393,12 @@ void main() {
|
|||
await fs.file('main.dart').writeAsString('void main() {}');
|
||||
await fs.file('output.snapshot').create();
|
||||
await fs.file('output.snapshot.d').writeAsString('snapshot : main.dart');
|
||||
await buildScriptSnapshot();
|
||||
await snapshotter.buildScriptSnapshot(
|
||||
mainPath: 'main.dart',
|
||||
snapshotPath: 'output.snapshot',
|
||||
depfilePath: 'output.snapshot.d',
|
||||
packagesPath: '.packages',
|
||||
);
|
||||
|
||||
expect(genSnapshot.callCount, 1);
|
||||
expect(genSnapshot.snapshotType.platform, isNull);
|
||||
|
@ -431,7 +427,12 @@ void main() {
|
|||
'main.dart': '27f5ebf0f8c559b2af9419d190299a5e',
|
||||
'output.snapshot': 'deadbeef000b204e9800998ecaaaaa',
|
||||
});
|
||||
await buildScriptSnapshot();
|
||||
await snapshotter.buildScriptSnapshot(
|
||||
mainPath: 'main.dart',
|
||||
snapshotPath: 'output.snapshot',
|
||||
depfilePath: 'output.snapshot.d',
|
||||
packagesPath: '.packages',
|
||||
);
|
||||
|
||||
expect(genSnapshot.callCount, 1);
|
||||
expectFingerprintHas(checksums: <String, String>{
|
||||
|
@ -447,7 +448,12 @@ void main() {
|
|||
'main.dart': '27f5ebf0f8c559b2af9419d190299a5e',
|
||||
'output.snapshot': 'd41d8cd98f00b204e9800998ecf8427e',
|
||||
});
|
||||
await buildScriptSnapshot();
|
||||
await snapshotter.buildScriptSnapshot(
|
||||
mainPath: 'main.dart',
|
||||
snapshotPath: 'output.snapshot',
|
||||
depfilePath: 'output.snapshot.d',
|
||||
packagesPath: '.packages',
|
||||
);
|
||||
|
||||
expect(genSnapshot.callCount, 1);
|
||||
expectFingerprintHas(checksums: <String, String>{
|
||||
|
@ -476,7 +482,12 @@ void main() {
|
|||
'other.dart': 'e0c35f083f0ad76b2d87100ec678b516',
|
||||
'output.snapshot': 'd41d8cd98f00b204e9800998ecf8427e',
|
||||
});
|
||||
await buildScriptSnapshot(mainPath: 'other.dart');
|
||||
await snapshotter.buildScriptSnapshot(
|
||||
mainPath: 'other.dart',
|
||||
snapshotPath: 'output.snapshot',
|
||||
depfilePath: 'output.snapshot.d',
|
||||
packagesPath: '.packages',
|
||||
);
|
||||
|
||||
expect(genSnapshot.callCount, 1);
|
||||
expectFingerprintHas(
|
||||
|
@ -499,7 +510,12 @@ void main() {
|
|||
'main.dart': '27f5ebf0f8c559b2af9419d190299a5e',
|
||||
'output.snapshot': 'd41d8cd98f00b204e9800998ecf8427e',
|
||||
});
|
||||
await buildScriptSnapshot();
|
||||
await snapshotter.buildScriptSnapshot(
|
||||
mainPath: 'main.dart',
|
||||
snapshotPath: 'output.snapshot',
|
||||
depfilePath: 'output.snapshot.d',
|
||||
packagesPath: '.packages',
|
||||
);
|
||||
|
||||
expect(genSnapshot.callCount, 0);
|
||||
expectFingerprintHas(checksums: <String, String>{
|
||||
|
|
Loading…
Reference in a new issue