+ // 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);
+ }
+