Commit 2075816d authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Decide whether to compress files in the FLX based on filename extensions (#5317)

Previously the FLX builder compressed assets only if they were not dynamically
generated.  This meant that the license file was not compressed.
parent b69a6b95
......@@ -88,15 +88,23 @@ class _ZipToolBuilder extends ZipBuilder {
}
}
static const List<String> _kNoCompressFileExtensions = const <String>['.png', '.jpg'];
bool isAssetCompressed(AssetBundleEntry entry) {
return !_kNoCompressFileExtensions.any(
(String extension) => entry.archivePath.endsWith(extension)
);
}
Iterable<String> _getCompressedNames() {
return entries
.where((AssetBundleEntry entry) => !entry.isStringEntry)
.where(isAssetCompressed)
.map((AssetBundleEntry entry) => entry.archivePath);
}
Iterable<String> _getStoredNames() {
return entries
.where((AssetBundleEntry entry) => entry.isStringEntry)
.where((AssetBundleEntry entry) => !isAssetCompressed(entry))
.map((AssetBundleEntry entry) => entry.archivePath);
}
}
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