|
|
|
|
@@ -51,7 +51,7 @@ void main() {
|
|
|
|
|
final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
|
|
|
|
|
await bundle.build(packagesPath: '.packages');
|
|
|
|
|
expect(bundle.entries.keys,
|
|
|
|
|
unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.bin'])
|
|
|
|
|
unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.smcbin'])
|
|
|
|
|
);
|
|
|
|
|
const String expectedJsonAssetManifest = '{}';
|
|
|
|
|
const Map<Object, Object> expectedBinAssetManifest = <Object, Object>{};
|
|
|
|
|
@@ -60,7 +60,7 @@ void main() {
|
|
|
|
|
expectedJsonAssetManifest,
|
|
|
|
|
);
|
|
|
|
|
expect(
|
|
|
|
|
const StandardMessageCodec().decodeMessage(ByteData.sublistView(Uint8List.fromList(await bundle.entries['AssetManifest.bin']!.contentsAsBytes()))),
|
|
|
|
|
const StandardMessageCodec().decodeMessage(ByteData.sublistView(Uint8List.fromList(await bundle.entries['AssetManifest.smcbin']!.contentsAsBytes()))),
|
|
|
|
|
expectedBinAssetManifest
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@@ -103,7 +103,7 @@ flutter:
|
|
|
|
|
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>[
|
|
|
|
|
'AssetManifest.json',
|
|
|
|
|
'AssetManifest.bin',
|
|
|
|
|
'AssetManifest.smcbin',
|
|
|
|
|
'FontManifest.json',
|
|
|
|
|
'NOTICES.Z',
|
|
|
|
|
'assets/foo/dog.png',
|
|
|
|
|
@@ -128,7 +128,7 @@ flutter:
|
|
|
|
|
final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
|
|
|
|
|
await bundle.build(packagesPath: '.packages');
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json',
|
|
|
|
|
'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
// Simulate modifying the files by updating the filestat time manually.
|
|
|
|
|
globals.fs.file(globals.fs.path.join('assets', 'foo', 'fizz.txt'))
|
|
|
|
|
..createSync(recursive: true)
|
|
|
|
|
@@ -137,7 +137,7 @@ flutter:
|
|
|
|
|
expect(bundle.needsBuild(), true);
|
|
|
|
|
await bundle.build(packagesPath: '.packages');
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json',
|
|
|
|
|
'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt',
|
|
|
|
|
'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt',
|
|
|
|
|
'assets/foo/fizz.txt']));
|
|
|
|
|
}, overrides: <Type, Generator>{
|
|
|
|
|
FileSystem: () => testFileSystem,
|
|
|
|
|
@@ -158,7 +158,7 @@ flutter:
|
|
|
|
|
final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
|
|
|
|
|
await bundle.build(packagesPath: '.packages');
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json',
|
|
|
|
|
'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
expect(bundle.needsBuild(), false);
|
|
|
|
|
|
|
|
|
|
// Delete the wildcard directory and update pubspec file.
|
|
|
|
|
@@ -180,7 +180,7 @@ name: example''')
|
|
|
|
|
expect(bundle.needsBuild(), true);
|
|
|
|
|
await bundle.build(packagesPath: '.packages');
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json',
|
|
|
|
|
'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
}, overrides: <Type, Generator>{
|
|
|
|
|
FileSystem: () => testFileSystem,
|
|
|
|
|
ProcessManager: () => FakeProcessManager.any(),
|
|
|
|
|
@@ -204,7 +204,7 @@ flutter:
|
|
|
|
|
final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
|
|
|
|
|
await bundle.build(packagesPath: '.packages');
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json',
|
|
|
|
|
'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
expect(bundle.needsBuild(), false);
|
|
|
|
|
}, overrides: <Type, Generator>{
|
|
|
|
|
FileSystem: () => testFileSystem,
|
|
|
|
|
@@ -237,7 +237,7 @@ flutter:
|
|
|
|
|
).createBundle();
|
|
|
|
|
await bundle.build(packagesPath: '.packages', deferredComponentsEnabled: true);
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json',
|
|
|
|
|
'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt']));
|
|
|
|
|
expect(bundle.deferredComponentsEntries.length, 1);
|
|
|
|
|
expect(bundle.deferredComponentsEntries['component1']!.length, 2);
|
|
|
|
|
expect(bundle.needsBuild(), false);
|
|
|
|
|
@@ -268,7 +268,7 @@ flutter:
|
|
|
|
|
await bundle.build(packagesPath: '.packages');
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['assets/foo/bar.txt',
|
|
|
|
|
'assets/bar/barbie.txt', 'assets/wild/dash.txt', 'AssetManifest.json',
|
|
|
|
|
'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
expect(bundle.deferredComponentsEntries.isEmpty, true);
|
|
|
|
|
expect(bundle.needsBuild(), false);
|
|
|
|
|
}, overrides: <Type, Generator>{
|
|
|
|
|
@@ -302,7 +302,7 @@ flutter:
|
|
|
|
|
).createBundle();
|
|
|
|
|
await bundle.build(packagesPath: '.packages', deferredComponentsEnabled: true);
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['assets/foo/bar.txt',
|
|
|
|
|
'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
'AssetManifest.json', 'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
expect(bundle.deferredComponentsEntries.length, 1);
|
|
|
|
|
expect(bundle.deferredComponentsEntries['component1']!.length, 2);
|
|
|
|
|
expect(bundle.needsBuild(), false);
|
|
|
|
|
@@ -316,7 +316,7 @@ flutter:
|
|
|
|
|
await bundle.build(packagesPath: '.packages', deferredComponentsEnabled: true);
|
|
|
|
|
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['assets/foo/bar.txt',
|
|
|
|
|
'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
'AssetManifest.json', 'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
expect(bundle.deferredComponentsEntries.length, 1);
|
|
|
|
|
expect(bundle.deferredComponentsEntries['component1']!.length, 3);
|
|
|
|
|
}, overrides: <Type, Generator>{
|
|
|
|
|
@@ -663,7 +663,7 @@ flutter:
|
|
|
|
|
await bundle.build(packagesPath: '.packages');
|
|
|
|
|
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['packages/foo/bar/fizz.txt',
|
|
|
|
|
'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
'AssetManifest.json', 'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
expect(bundle.needsBuild(), false);
|
|
|
|
|
|
|
|
|
|
// Does not track dependency's wildcard directories.
|
|
|
|
|
@@ -799,7 +799,7 @@ flutter:
|
|
|
|
|
|
|
|
|
|
expect(await bundle.build(packagesPath: '.packages'), 0);
|
|
|
|
|
expect(bundle.entries.keys, unorderedEquals(<String>['assets/foo.txt',
|
|
|
|
|
'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
'AssetManifest.json', 'AssetManifest.smcbin', 'FontManifest.json', 'NOTICES.Z']));
|
|
|
|
|
}, overrides: <Type, Generator>{
|
|
|
|
|
FileSystem: () => MemoryFileSystem.test(),
|
|
|
|
|
ProcessManager: () => FakeProcessManager.any(),
|
|
|
|
|
|