diff options
author | Josiah Gaskin <josiahgaskin@google.com> | 2011-06-08 19:31:40 -0700 |
---|---|---|
committer | Josiah Gaskin <josiahgaskin@google.com> | 2011-06-27 16:29:38 -0700 |
commit | ce89f1531ed8b96b8b790b3f8b18dd4cf483f7f0 (patch) | |
tree | 203ed8910afd70ee30fcece6c3c547383cf20b66 /tools/aapt/Command.cpp | |
parent | 4fea5373d350f5d855408ffaa41206b8fa743c55 (diff) |
Copy once-created R.java into library projects
This change adds functionality in Aapt to allow specification of
library projects to copy the generated R.java file into rather
than regenerating the file for each library project.
Change-Id: I05939d1dc875bd875be9298ca47cb639235070c6
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r-- | tools/aapt/Command.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 739763edca34..c7dfb8fdf362 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -1414,6 +1414,17 @@ int doPackage(Bundle* bundle) if (assets->getPackage() == assets->getSymbolsPrivatePackage()) { if (bundle->getCustomPackage() == NULL) { err = writeResourceSymbols(bundle, assets, assets->getPackage(), true); + // Copy R.java for libraries + if (bundle->getExtraPackages() != NULL) { + // Split on semicolon + String8 libs(bundle->getExtraPackages()); + char* packageString = strtok(libs.lockBuffer(libs.length()), ";"); + while (packageString != NULL) { + err = writeResourceSymbols(bundle, assets, String8(packageString), true); + packageString = strtok(NULL, ";"); + } + libs.unlockBuffer(); + } } else { const String8 customPkg(bundle->getCustomPackage()); err = writeResourceSymbols(bundle, assets, customPkg, true); |