Vector Drawable optimization tool
avocado is a command line tool (similar to svgo) that optimizes Android
VectorDrawable (VD) and AnimatedVectorDrawable (AVD) xml files.
You can install avocado using npm w/ the following command:
npm install -g avocadoUsage: avocado [options] [file]
Options:
-V, --version output the version number
-s, --string <string> input VD or AVD string
-i, --input <file> input file/directory, or "-" for STDIN
-o, --output <file> output file/directory (same as the input file by default), or "-" for STDOUT
-d, --dir <dir> optimizes and rewrite all *.xml files in a directory
-q, --quiet only output error messages
-h, --help output usage information…avocado rewrites the VectorDrawable using the smallest number of <group>s and <path>s possible, reducing their file sizes and making them faster to parse and draw at runtime. The example below shows the contents of a VectorDrawable before and after being run through avocado.
……If you want to contribute, first be sure to install the latest version of
Node.js and npm.
If you're not sure what IDE to use, I highly recommend checking out
vscode.
Then clone this repository and in the root directory, run:
npm installTo build the tool, run:
npm run buildTo test the tool, run:
npm run testNo open issues yet, or sync has not completed.