diff options
| author | 2011-07-20 16:31:25 -0700 | |
|---|---|---|
| committer | 2011-07-20 16:31:25 -0700 | |
| commit | a125c937de06b1cc43368743592f47513eb88b76 (patch) | |
| tree | 514f08565d17813860d4cc240162806f3fda9816 /tools/aapt/Command.cpp | |
| parent | 57aebc6109f2059ba335a02bf95928a494cff4ba (diff) | |
| parent | 2c311be720341e3249887e592bbc1881008b02bd (diff) | |
resolved conflicts for merge of 2c311be7 to honeycomb-plus-aosp
Change-Id: I806c7b4ae95f66df621587e52497dd8739a115fe
Diffstat (limited to 'tools/aapt/Command.cpp')
| -rw-r--r-- | tools/aapt/Command.cpp | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 903c62cef1fe..2f9e9bef8218 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -1545,10 +1545,13 @@ int doPackage(Bundle* bundle) // Load the assets. assets = new AaptAssets(); - // Set up the resource gathering in assets if we're trying to make R.java + // Set up the resource gathering in assets if we're going to generate + // dependency files if (bundle->getGenDependencies()) { - sp<FilePathStore> pathStore = new FilePathStore; - assets->setFullResPaths(pathStore); + sp<FilePathStore> resPathStore = new FilePathStore; + assets->setFullResPaths(resPathStore); + sp<FilePathStore> assetPathStore = new FilePathStore; + assets->setFullAssetPaths(assetPathStore); } err = assets->slurpFromArgs(bundle); @@ -1575,9 +1578,16 @@ int doPackage(Bundle* bundle) } if (bundle->getGenDependencies()) { - dependencyFile = String8(bundle->getRClassDir()); + if (outputAPKFile) { + dependencyFile = String8(outputAPKFile); + // Strip the extension and add new one + dependencyFile = dependencyFile.getBasePath(); + dependencyFile.append(".d"); + } else { + dependencyFile = String8(bundle->getRClassDir()); + dependencyFile.appendPath("R.d"); + } // Make sure we have a clean dependency file to start with - dependencyFile.appendPath("R.d"); fp = fopen(dependencyFile, "w"); fclose(fp); } @@ -1615,19 +1625,6 @@ int doPackage(Bundle* bundle) } } - if (bundle->getGenDependencies()) { - // Now that writeResourceSymbols has taken care of writing the - // dependency targets to the dependencyFile, we'll write the - // pre-requisites. - fp = fopen(dependencyFile, "a+"); - fprintf(fp, " : "); - err = writeDependencyPreReqs(bundle, assets, fp); - - // Also manually add the AndroidManifeset since it's a non-asset - fprintf(fp, "%s \\\n", bundle->getAndroidManifestFile()); - fclose(fp); - } - // Write out the ProGuard file err = writeProguardFile(bundle, assets); if (err < 0) { @@ -1643,6 +1640,18 @@ int doPackage(Bundle* bundle) } } + if (bundle->getGenDependencies()) { + // Now that writeResourceSymbols or writeAPK has taken care of writing + // the targets to our dependency file, we'll write the prereqs + fp = fopen(dependencyFile, "a+"); + fprintf(fp, " : "); + bool includeRaw = (outputAPKFile != NULL); + err = writeDependencyPreReqs(bundle, assets, fp, includeRaw); + // Also manually add the AndroidManifeset since it's a non-asset + fprintf(fp, "%s \\\n", bundle->getAndroidManifestFile()); + fclose(fp); + } + retVal = 0; bail: if (SourcePos::hasErrors()) { |