From 0368ebfc29d5e307979c5705764e30df5ca12f9e Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 26 Jul 2016 12:55:51 -0700 Subject: [PATCH] AAPT2: Add version info and release notes Bug:30402888 Change-Id: Idb532cc71921eb1cfba31c00a6fb7108e31fddd8 --- tools/aapt2/Main.cpp | 16 +++++++++++++++- tools/aapt2/readme.md | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tools/aapt2/readme.md diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp index 00d8aaeeda55e..a74b5aa2478ee 100644 --- a/tools/aapt2/Main.cpp +++ b/tools/aapt2/Main.cpp @@ -21,6 +21,18 @@ namespace aapt { +// DO NOT UPDATE, this is more of a marketing version. +static const char* sMajorVersion = "2"; + +// Update minor version whenever a feature or flag is added. +static const char* sMinorVersion = "0"; + +int printVersion() { + std::cerr << "Android Asset Packaging Tool (aapt) " + << sMajorVersion << "." << sMinorVersion << std::endl; + return 0; +} + extern int compile(const std::vector& args); extern int link(const std::vector& args); extern int dump(const std::vector& args); @@ -47,12 +59,14 @@ int main(int argc, char** argv) { return aapt::dump(args); } else if (command == "diff") { return aapt::diff(args); + } else if (command == "version") { + return aapt::printVersion(); } std::cerr << "unknown command '" << command << "'\n"; } else { std::cerr << "no command specified\n"; } - std::cerr << "\nusage: aapt2 [compile|link|dump|diff] ..." << std::endl; + std::cerr << "\nusage: aapt2 [compile|link|dump|diff|version] ..." << std::endl; return 1; } diff --git a/tools/aapt2/readme.md b/tools/aapt2/readme.md new file mode 100644 index 0000000000000..95c0173f921af --- /dev/null +++ b/tools/aapt2/readme.md @@ -0,0 +1,18 @@ +# Android Asset Packaging Tool 2.0 (AAPT2) release notes + +## Version 2.0 +### `aapt2 compile ...` +- Pseudo-localization: generates pseudolocalized versions of default strings when the + `--pseudo-localize` option is specified. +- Legacy mode: treats some class of errors as warnings in order to be more compatible + with AAPT when `--legacy` is specified. +- Compile directory: treats the input file as a directory when `--dir` is + specified. This will emit a zip of compiled files, one for each file in the directory. + The directory must follow the Android resource directory structure + (res/values-[qualifiers]/file.ext). + +### `aapt2 link ...` +- Automatic attribute versioning: adds version qualifiers to resources that use attributes + introduced in a later SDK level. This can be disabled with `--no-auto-version`. +- Min SDK resource filtering: removes resources that can't possibly be selected at runtime due + to the application's minimum supported SDK level.