diff options
-rw-r--r-- | tools/aapt2/Main.cpp | 16 | ||||
-rw-r--r-- | tools/aapt2/readme.md | 18 |
2 files changed, 33 insertions, 1 deletions
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp index 00d8aaeeda55..a74b5aa2478e 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<StringPiece>& args); extern int link(const std::vector<StringPiece>& args); extern int dump(const std::vector<StringPiece>& 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 000000000000..95c0173f921a --- /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. |