X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/e3b183068f71829363c2b613f3a6f1c714c3a5cb..483bf9fcbadc82d390fe91ebf23cd9bf898940a5:/Package.cpp diff --git a/Package.cpp b/Package.cpp index ab71f34..c9f6870 100644 --- a/Package.cpp +++ b/Package.cpp @@ -50,6 +50,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 +177,16 @@ status_t writeAPK(Bundle* bundle, const sp& 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; }