Unverified Commit cb5b5c34 authored by Andrew Kolos's avatar Andrew Kolos Committed by GitHub

Tighten asset variant detection criteria to only include device-pixel-ratio variants (#110721)

parent 2853a601
......@@ -169,7 +169,6 @@ flutter:
- packages/flutter_gallery_assets/products/table.png
- packages/flutter_gallery_assets/products/teaset.png
- packages/flutter_gallery_assets/products/top.png
- packages/flutter_gallery_assets/people/ali.png
- packages/flutter_gallery_assets/people/square/ali.png
- packages/flutter_gallery_assets/people/square/peter.png
- packages/flutter_gallery_assets/people/square/sandra.png
......
This diff is collapsed.
......@@ -121,7 +121,6 @@ Future<AssetBundle?> buildAssets({
final AssetBundle assetBundle = AssetBundleFactory.instance.createBundle();
final int result = await assetBundle.build(
manifestPath: manifestPath,
assetDirPath: assetDirPath,
packagesPath: packagesPath,
targetPlatform: targetPlatform,
);
......
......@@ -222,11 +222,11 @@ $assetsSection
assets: <String>['a/foo'],
);
final List<String> assets = <String>['a/foo', 'a/v/foo'];
final List<String> assets = <String>['a/foo', 'a/2x/foo'];
writeAssets('p/p/', assets);
const String expectedManifest = '{"packages/test_package/a/foo":'
'["packages/test_package/a/foo","packages/test_package/a/v/foo"]}';
'["packages/test_package/a/foo","packages/test_package/a/2x/foo"]}';
await buildAndVerifyAssets(
assets,
......@@ -251,11 +251,11 @@ $assetsSection
'test_package',
);
final List<String> assets = <String>['a/foo', 'a/v/foo'];
final List<String> assets = <String>['a/foo', 'a/2x/foo'];
writeAssets('p/p/lib/', assets);
const String expectedManifest = '{"packages/test_package/a/foo":'
'["packages/test_package/a/foo","packages/test_package/a/v/foo"]}';
'["packages/test_package/a/foo","packages/test_package/a/2x/foo"]}';
await buildAndVerifyAssets(
assets,
......@@ -344,15 +344,15 @@ $assetsSection
assets: <String>['a/foo'],
);
final List<String> assets = <String>['a/foo', 'a/v/foo'];
final List<String> assets = <String>['a/foo', 'a/2x/foo'];
writeAssets('p/p/', assets);
writeAssets('p2/p/', assets);
const String expectedAssetManifest =
'{"packages/test_package/a/foo":'
'["packages/test_package/a/foo","packages/test_package/a/v/foo"],'
'["packages/test_package/a/foo","packages/test_package/a/2x/foo"],'
'"packages/test_package2/a/foo":'
'["packages/test_package2/a/foo","packages/test_package2/a/v/foo"]}';
'["packages/test_package2/a/foo","packages/test_package2/a/2x/foo"]}';
await buildAndVerifyAssets(
assets,
......@@ -384,15 +384,15 @@ $assetsSection
'test_package2',
);
final List<String> assets = <String>['a/foo', 'a/v/foo'];
final List<String> assets = <String>['a/foo', 'a/2x/foo'];
writeAssets('p/p/lib/', assets);
writeAssets('p2/p/lib/', assets);
const String expectedAssetManifest =
'{"packages/test_package/a/foo":'
'["packages/test_package/a/foo","packages/test_package/a/v/foo"],'
'["packages/test_package/a/foo","packages/test_package/a/2x/foo"],'
'"packages/test_package2/a/foo":'
'["packages/test_package2/a/foo","packages/test_package2/a/v/foo"]}';
'["packages/test_package2/a/foo","packages/test_package2/a/2x/foo"]}';
await buildAndVerifyAssets(
assets,
......@@ -421,12 +421,12 @@ $assetsSection
'test_package2',
);
final List<String> assets = <String>['a/foo', 'a/v/foo'];
final List<String> assets = <String>['a/foo', 'a/2x/foo'];
writeAssets('p2/p/lib/', assets);
const String expectedAssetManifest =
'{"packages/test_package2/a/foo":'
'["packages/test_package2/a/foo","packages/test_package2/a/v/foo"]}';
'["packages/test_package2/a/foo","packages/test_package2/a/2x/foo"]}';
await buildAndVerifyAssets(
assets,
......@@ -553,7 +553,7 @@ $assetsSection
writePubspecFile('pubspec.yaml', 'test');
writePackagesFile('test_package:p/p/lib/');
final List<String> assetsOnDisk = <String>['a/foo','a/b/foo'];
final List<String> assetsOnDisk = <String>['a/foo','a/2x/foo'];
final List<String> assetOnManifest = <String>['a/',];
writePubspecFile(
......@@ -564,7 +564,7 @@ $assetsSection
writeAssets('p/p/', assetsOnDisk);
const String expectedAssetManifest =
'{"packages/test_package/a/foo":["packages/test_package/a/foo","packages/test_package/a/b/foo"]}';
'{"packages/test_package/a/foo":["packages/test_package/a/foo","packages/test_package/a/2x/foo"]}';
await buildAndVerifyAssets(
assetsOnDisk,
......@@ -580,7 +580,7 @@ $assetsSection
writePubspecFile('pubspec.yaml', 'test');
writePackagesFile('test_package:p/p/lib/');
final List<String> assetsOnDisk = <String>['a/foo', 'a/b/foo'];
final List<String> assetsOnDisk = <String>['a/foo', 'a/2x/foo'];
final List<String> assetOnManifest = <String>[];
writePubspecFile(
......
......@@ -643,7 +643,7 @@ name: example
flutter:
assets:
- foo.txt
- assets/foo.txt
''');
globals.fs.file('assets/foo.txt').createSync(recursive: true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment