summaryrefslogtreecommitdiffstats
path: root/tools/aapt/Bundle.h
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-09-11 14:45:22 -0700
committerXavier Ducrohet <xav@android.com>2012-09-11 18:19:00 -0700
commitf5de650ff1e161ea135c828e43515895343d2c0f (patch)
tree4398a8d071f3322512e6c4d5f153fb9564865d6a /tools/aapt/Bundle.h
parent7714a2429b192c88e134ff67b969121bbaeb5457 (diff)
downloadframeworks_base-f5de650ff1e161ea135c828e43515895343d2c0f.zip
frameworks_base-f5de650ff1e161ea135c828e43515895343d2c0f.tar.gz
frameworks_base-f5de650ff1e161ea135c828e43515895343d2c0f.tar.bz2
Add --output-text-symbols option to aapt.
Library projects in the SDK are built using --non-constant-id to generate a temporary R.java class. When the library is packaged with the application to generate an apk, the R class is recreated with the proper IDs due to all the resources coming from the app and all the libraries. However for large apps with many libraries (each with their own R class in their package), this means a lot of unnecessary IDs: all R classes contains all the IDs including for resources from by projects they don't have access through the dependency graph. For really large apps (X,000 resources), with lots of libraries (10+), this can generate tens of thousands of resources, which can trigger dalvik's limit of 65K fields and methods per dex files. This changes lets aapt generate not only the R class but a simple text file containing the list of all those IDs so that it is easier to parse back. The SDK build system will not ask aapt to generate the R class of the libraries (through the --extra-packages option), instead it will then read this file to know what IDs are needed for each library and generate a much smaller R class for each library (using the same text file output from compiling all the resources to get the final integer value). Change-Id: I4db959fec372cf3ead9950e4b2b82fa1ae7eed2d
Diffstat (limited to 'tools/aapt/Bundle.h')
-rw-r--r--tools/aapt/Bundle.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index be08291..fde3bd6 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -61,7 +61,8 @@ public:
mMinSdkVersion(NULL), mTargetSdkVersion(NULL), mMaxSdkVersion(NULL),
mVersionCode(NULL), mVersionName(NULL), mCustomPackage(NULL), mExtraPackages(NULL),
mMaxResVersion(NULL), mDebugMode(false), mNonConstantId(false), mProduct(NULL),
- mUseCrunchCache(false), mErrorOnFailedInsert(false), mArgc(0), mArgv(NULL)
+ mUseCrunchCache(false), mErrorOnFailedInsert(false), mOutputTextSymbols(NULL),
+ mArgc(0), mArgv(NULL)
{}
~Bundle(void) {}
@@ -173,6 +174,8 @@ public:
void setProduct(const char * val) { mProduct = val; }
void setUseCrunchCache(bool val) { mUseCrunchCache = val; }
bool getUseCrunchCache() const { return mUseCrunchCache; }
+ const char* getOutputTextSymbols() const { return mOutputTextSymbols; }
+ void setOutputTextSymbols(const char* val) { mOutputTextSymbols = val; }
/*
* Set and get the file specification.
@@ -279,6 +282,7 @@ private:
const char* mProduct;
bool mUseCrunchCache;
bool mErrorOnFailedInsert;
+ const char* mOutputTextSymbols;
/* file specification */
int mArgc;