summaryrefslogtreecommitdiffstats
path: root/tools/aapt/Package.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt/Package.cpp')
-rw-r--r--tools/aapt/Package.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/aapt/Package.cpp b/tools/aapt/Package.cpp
index ab71f34..c9f6870 100644
--- a/tools/aapt/Package.cpp
+++ b/tools/aapt/Package.cpp
@@ -50,6 +50,11 @@ ssize_t processJarFiles(Bundle* bundle, ZipFile* zip);
status_t writeAPK(Bundle* bundle, const sp<AaptAssets>& assets,
const String8& outputFile)
{
+ #if BENCHMARK
+ fprintf(stdout, "BENCHMARK: Starting APK Bundling \n");
+ long startAPKTime = clock();
+ #endif /* BENCHMARK */
+
status_t result = NO_ERROR;
ZipFile* zip = NULL;
int count;
@@ -172,6 +177,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:
@@ -187,6 +202,10 @@ bail:
if (result == NO_ERROR && bundle->getVerbose())
printf("Done!\n");
+
+ #if BENCHMARK
+ fprintf(stdout, "BENCHMARK: End APK Bundling. Time Elapsed: %f ms \n",(clock() - startAPKTime)/1000.0);
+ #endif /* BENCHMARK */
return result;
}