X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/23d6df59974b116d961dc15d9aaae925c8e9189d..483bf9fcbadc82d390fe91ebf23cd9bf898940a5:/Package.cpp?ds=sidebyside diff --git a/Package.cpp b/Package.cpp index faae89b..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; } @@ -461,7 +480,7 @@ ssize_t processJarFiles(Bundle* bundle, ZipFile* zip) ZipFile jar; err = jar.open(jars[i], ZipFile::kOpenReadOnly); if (err != 0) { - fprintf(stderr, "ERROR: unable to open '%s' as a zip file: %zd\n", + fprintf(stderr, "ERROR: unable to open '%s' as a zip file: %d\n", jars[i], err); return err; }