summaryrefslogtreecommitdiff
path: root/tools/aapt2
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-09-14 10:28:14 -0700
committerRyan Mitchell <rtmitchell@google.com>2020-09-17 08:19:49 -0700
commit59cefc8403ce2933a13687e6224ea4682c26434d (patch)
treec4e35c359ab16d069dbc1de27057143a3b65a947 /tools/aapt2
parent0a0bf365553c614a7ca1ab96a1aa71047fc48081 (diff)
Add ".webp" to default compress extensions
The .webp extension contains compressed image data so do not deflate .webp files in APKs. Bug: 166137617 Test: aapt2 link Merged-In: I70181437e0b51122c7aa5047bd0a0791ac3b8df6 Change-Id: I70181437e0b51122c7aa5047bd0a0791ac3b8df6
Diffstat (limited to 'tools/aapt2')
-rw-r--r--tools/aapt2/cmd/Link.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index 85414fb8a4e5..6e5b7a191287 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -2220,11 +2220,15 @@ int LinkCommand::Action(const std::vector<std::string>& args) {
}
// Populate some default no-compress extensions that are already compressed.
- options_.extensions_to_not_compress.insert(
- {".jpg", ".jpeg", ".png", ".gif", ".wav", ".mp2", ".mp3", ".ogg",
- ".aac", ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet", ".rtttl",
- ".imy", ".xmf", ".mp4", ".m4a", ".m4v", ".3gp", ".3gpp", ".3g2",
- ".3gpp2", ".amr", ".awb", ".wma", ".wmv", ".webm", ".mkv"});
+ options_.extensions_to_not_compress.insert({
+ // Image extensions
+ ".jpg", ".jpeg", ".png", ".gif", ".webp",
+ // Audio extensions
+ ".wav", ".mp2", ".mp3", ".ogg", ".aac", ".mid", ".midi", ".smf", ".jet", ".rtttl", ".imy",
+ ".xmf", ".amr", ".awb",
+ // Audio/video extensions
+ ".mpg", ".mpeg", ".mp4", ".m4a", ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2", ".wma", ".wmv",
+ ".webm", ".mkv"});
// Turn off auto versioning for static-libs.
if (context.GetPackageType() == PackageType::kStaticLib) {