X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/4bb85b9ff958cc4bcd44f1a0c15cfda652109b80..e0b7b47c23c876d1c27b30bc4e5742e7afb81807:/Package.cpp diff --git a/Package.cpp b/Package.cpp index ab71f34..3930117 100644 --- a/Package.cpp +++ b/Package.cpp @@ -6,6 +6,7 @@ #include "Main.h" #include "AaptAssets.h" #include "ResourceTable.h" +#include "ResourceFilter.h" #include #include @@ -50,6 +51,11 @@ ssize_t processJarFiles(Bundle* bundle, ZipFile* zip); status_t writeAPK(Bundle* bundle, const sp& 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 +178,21 @@ status_t writeAPK(Bundle* bundle, const sp& assets, } } + // If we've been asked to generate a dependency file for the .ap_ package, + // do so here + if (bundle->getGenDependencies()) { + // The dependency file gets output to the same directory + // as the specified output file with an additional .d extension. + // e.g. bin/resources.ap_.d + String8 dependencyFile = outputFile; + dependencyFile.append(".d"); + + FILE* fp = fopen(dependencyFile.string(), "a"); + // Add this file to the dependency file + fprintf(fp, "%s \\\n", outputFile.string()); + fclose(fp); + } + assert(result == NO_ERROR); bail: @@ -187,6 +208,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; }