Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
cb5b5c34
Unverified
Commit
cb5b5c34
authored
Sep 27, 2022
by
Andrew Kolos
Committed by
GitHub
Sep 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tighten asset variant detection criteria to only include device-pixel-ratio variants (#110721)
parent
2853a601
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
277 additions
and
144 deletions
+277
-144
pubspec.yaml
dev/integration_tests/flutter_gallery/pubspec.yaml
+0
-1
asset.dart
packages/flutter_tools/lib/src/asset.dart
+66
-78
bundle_builder.dart
packages/flutter_tools/lib/src/bundle_builder.dart
+0
-1
asset_bundle_package_test.dart
...r_tools/test/general.shard/asset_bundle_package_test.dart
+15
-15
asset_bundle_test.dart
...s/flutter_tools/test/general.shard/asset_bundle_test.dart
+1
-1
asset_bundle_variant_test.dart
...r_tools/test/general.shard/asset_bundle_variant_test.dart
+195
-48
No files found.
dev/integration_tests/flutter_gallery/pubspec.yaml
View file @
cb5b5c34
...
@@ -169,7 +169,6 @@ flutter:
...
@@ -169,7 +169,6 @@ flutter:
-
packages/flutter_gallery_assets/products/table.png
-
packages/flutter_gallery_assets/products/table.png
-
packages/flutter_gallery_assets/products/teaset.png
-
packages/flutter_gallery_assets/products/teaset.png
-
packages/flutter_gallery_assets/products/top.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/ali.png
-
packages/flutter_gallery_assets/people/square/peter.png
-
packages/flutter_gallery_assets/people/square/peter.png
-
packages/flutter_gallery_assets/people/square/sandra.png
-
packages/flutter_gallery_assets/people/square/sandra.png
...
...
packages/flutter_tools/lib/src/asset.dart
View file @
cb5b5c34
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/bundle_builder.dart
View file @
cb5b5c34
...
@@ -121,7 +121,6 @@ Future<AssetBundle?> buildAssets({
...
@@ -121,7 +121,6 @@ Future<AssetBundle?> buildAssets({
final
AssetBundle
assetBundle
=
AssetBundleFactory
.
instance
.
createBundle
();
final
AssetBundle
assetBundle
=
AssetBundleFactory
.
instance
.
createBundle
();
final
int
result
=
await
assetBundle
.
build
(
final
int
result
=
await
assetBundle
.
build
(
manifestPath:
manifestPath
,
manifestPath:
manifestPath
,
assetDirPath:
assetDirPath
,
packagesPath:
packagesPath
,
packagesPath:
packagesPath
,
targetPlatform:
targetPlatform
,
targetPlatform:
targetPlatform
,
);
);
...
...
packages/flutter_tools/test/general.shard/asset_bundle_package_test.dart
View file @
cb5b5c34
...
@@ -222,11 +222,11 @@ $assetsSection
...
@@ -222,11 +222,11 @@ $assetsSection
assets:
<
String
>[
'a/foo'
],
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
(
'p/p/'
,
assets
);
const
String
expectedManifest
=
'{"packages/test_package/a/foo":'
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
(
await
buildAndVerifyAssets
(
assets
,
assets
,
...
@@ -251,11 +251,11 @@ $assetsSection
...
@@ -251,11 +251,11 @@ $assetsSection
'test_package'
,
'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
);
writeAssets
(
'p/p/lib/'
,
assets
);
const
String
expectedManifest
=
'{"packages/test_package/a/foo":'
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
(
await
buildAndVerifyAssets
(
assets
,
assets
,
...
@@ -344,15 +344,15 @@ $assetsSection
...
@@ -344,15 +344,15 @@ $assetsSection
assets:
<
String
>[
'a/foo'
],
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
(
'p/p/'
,
assets
);
writeAssets
(
'p2/p/'
,
assets
);
writeAssets
(
'p2/p/'
,
assets
);
const
String
expectedAssetManifest
=
const
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":'
'{"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/foo","packages/test_package2/a/
v
/foo"]}'
;
'["packages/test_package2/a/foo","packages/test_package2/a/
2x
/foo"]}'
;
await
buildAndVerifyAssets
(
await
buildAndVerifyAssets
(
assets
,
assets
,
...
@@ -384,15 +384,15 @@ $assetsSection
...
@@ -384,15 +384,15 @@ $assetsSection
'test_package2'
,
'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
(
'p/p/lib/'
,
assets
);
writeAssets
(
'p2/p/lib/'
,
assets
);
writeAssets
(
'p2/p/lib/'
,
assets
);
const
String
expectedAssetManifest
=
const
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":'
'{"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/foo","packages/test_package2/a/
v
/foo"]}'
;
'["packages/test_package2/a/foo","packages/test_package2/a/
2x
/foo"]}'
;
await
buildAndVerifyAssets
(
await
buildAndVerifyAssets
(
assets
,
assets
,
...
@@ -421,12 +421,12 @@ $assetsSection
...
@@ -421,12 +421,12 @@ $assetsSection
'test_package2'
,
'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
);
writeAssets
(
'p2/p/lib/'
,
assets
);
const
String
expectedAssetManifest
=
const
String
expectedAssetManifest
=
'{"packages/test_package2/a/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
(
await
buildAndVerifyAssets
(
assets
,
assets
,
...
@@ -553,7 +553,7 @@ $assetsSection
...
@@ -553,7 +553,7 @@ $assetsSection
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
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/'
,];
final
List
<
String
>
assetOnManifest
=
<
String
>[
'a/'
,];
writePubspecFile
(
writePubspecFile
(
...
@@ -564,7 +564,7 @@ $assetsSection
...
@@ -564,7 +564,7 @@ $assetsSection
writeAssets
(
'p/p/'
,
assetsOnDisk
);
writeAssets
(
'p/p/'
,
assetsOnDisk
);
const
String
expectedAssetManifest
=
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
(
await
buildAndVerifyAssets
(
assetsOnDisk
,
assetsOnDisk
,
...
@@ -580,7 +580,7 @@ $assetsSection
...
@@ -580,7 +580,7 @@ $assetsSection
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
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
>[];
final
List
<
String
>
assetOnManifest
=
<
String
>[];
writePubspecFile
(
writePubspecFile
(
...
...
packages/flutter_tools/test/general.shard/asset_bundle_test.dart
View file @
cb5b5c34
...
@@ -643,7 +643,7 @@ name: example
...
@@ -643,7 +643,7 @@ name: example
flutter:
flutter:
assets:
assets:
- foo.txt
-
assets/
foo.txt
'''
);
'''
);
globals
.
fs
.
file
(
'assets/foo.txt'
).
createSync
(
recursive:
true
);
globals
.
fs
.
file
(
'assets/foo.txt'
).
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/test/general.shard/asset_bundle_variant_test.dart
View file @
cb5b5c34
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment