This module is used for assets and resource compression, Booster provides two compression tools, pngquant
and cwebp
(built-in), which compressor to use as the default depends on the minSdkVersion
.
- If specified property
booster.task.compression.compressor
, then use the specified one - If
minSdkVersion
>= 18, then usecwebp
- If 15 <=
minSdkVersion
<= 17, then usecwebp
but only compress opaque images, any image has transparency will be ignored - If
pngquant
has been installed, then usepngquant
- otherwise, do not compress any resources
本模块用于对资源进行压缩,Booster 提供了两种压缩工具:pngquant
和 cwebp
(内置),选择哪个压缩器作为默认的,这取决于 minSdkVersion
The following table shows the properties that transformer supports:
Property | Description | Example |
---|---|---|
booster.task.compression.compressor |
the compressor to apply (supports pngquant and cwebp ) |
pngquant |
booster.task.compression.pngquant |
colon separated paths (env.PATH in default) | /opt/pngquant/bin |
./gradlew assembleDebug -Pbooster.task.compression.compressor=pngquant -Pbooster.task.compression.pngquant=/opt/pngquant/bin
or configured in the gradle.properties
:
booster.task.compression.compressor=pngquant
booster.task.compression.pngquant=/opt/pngquant/bin
./gradlew assembleDebug -Pbooster.task.compression.compressor=cwebp
or configured in the gradle.properties
:
booster.task.compression.compressor=cwebp