From d06c1afbb920111d6bb77381560faa1fac5f2d69 Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Mon, 14 Feb 2011 16:58:00 -0800 Subject: Add --non-constant-id to aapt. This option enbables creating resource constant in the R class that are not actual constant, but simply static fields. The goal is to build library projects with these types of IDs so that the constant does not get inlined in the library code, since the ID for the library resources only are not the final values. The final resource IDs, generated from the main project and its library(ies), will have proper constant with the final values. This allows us to generate binary library bundle (a jar file and associated resources) that can be distributed. Additionally, this will let us make the library project support in Eclipse much more robust and a better user experience overall. Change-Id: Ibe2f08d68493fde658fc3f7606abf7446f312ad2 --- tools/aapt/Main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/aapt/Main.cpp') diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp index 739b01f40d24..266a02f25a17 100644 --- a/tools/aapt/Main.cpp +++ b/tools/aapt/Main.cpp @@ -160,7 +160,11 @@ void usage(void) " product variants\n" " --utf16\n" " changes default encoding for resources to UTF-16. Only useful when API\n" - " level is set to 7 or higher where the default encoding is UTF-8.\n"); + " level is set to 7 or higher where the default encoding is UTF-8.\n" + " --non-constant-id\n" + " Make the resources ID non constant. This is required to make an R java class\n" + " that does not contain the final value but is used to make reusable compiled\n" + " libraries that need to access resources.\n"); } /* @@ -497,6 +501,8 @@ int main(int argc, char* const argv[]) goto bail; } bundle.setProduct(argv[0]); + } else if (strcmp(cp, "-non-constant-id") == 0) { + bundle.setNonConstantId(true); } else { fprintf(stderr, "ERROR: Unknown option '-%s'\n", cp); wantUsage = true; -- cgit v1.2.3-59-g8ed1b