diff options
author | 2011-06-27 16:26:02 -0700 | |
---|---|---|
committer | 2011-07-18 16:37:55 -0700 | |
commit | 03589cc65355220e0a4a0c816189a9fa25cc81fc (patch) | |
tree | ebe98e64c530708e8709025e8ad051c714eab9a3 /tools/aapt/Package.cpp | |
parent | 9bf34ca6f85309c65b0ebdf614cb8266401b49ba (diff) |
Add generation of dependency file for .ap_ package
Make Aapt generate a dependency file in the same directory as the
output ap_ file if the --generate-dependencies flag is set.
This dependency file can then be read by the ant exec loop task
to see whether to repackage resources.
Change-Id: I763679414daf76369700aa599c26dcf78d4de099
Diffstat (limited to 'tools/aapt/Package.cpp')
-rw-r--r-- | tools/aapt/Package.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/aapt/Package.cpp b/tools/aapt/Package.cpp index 999a5cf82222..6e2a25ce8c7e 100644 --- a/tools/aapt/Package.cpp +++ b/tools/aapt/Package.cpp @@ -172,6 +172,16 @@ status_t writeAPK(Bundle* bundle, const sp<AaptAssets>& assets, } } + if (bundle->getGenDependencies()) { + // Add this file to the dependency file + String8 dependencyFile = outputFile.getBasePath(); + dependencyFile.append(".d"); + + FILE* fp = fopen(dependencyFile.string(), "a"); + fprintf(fp, "%s \\\n", outputFile.string()); + fclose(fp); + } + assert(result == NO_ERROR); bail: |