diff options
Diffstat (limited to 'tools/aapt/Resource.cpp')
-rw-r--r-- | tools/aapt/Resource.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index a603314709ab..6e86112a3756 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -2187,15 +2187,26 @@ writeProguardFile(Bundle* bundle, const sp<AaptAssets>& assets) return err; } -status_t -writeDependencyPreReqs(Bundle* bundle, const sp<AaptAssets>& assets, FILE* fp) +// Loops through the string paths and writes them to the file pointer +// Each file path is written on its own line with a terminating backslash. +status_t writePathsToFile(const sp<FilePathStore>& files, FILE* fp) { status_t deps = -1; - sp<FilePathStore> files = assets->getFullResPaths(); for (size_t file_i = 0; file_i < files->size(); ++file_i) { // Add the full file path to the dependency file fprintf(fp, "%s \\\n", files->itemAt(file_i).string()); deps++; } return deps; -}
\ No newline at end of file +} + +status_t +writeDependencyPreReqs(Bundle* bundle, const sp<AaptAssets>& assets, FILE* fp, bool includeRaw) +{ + status_t deps = -1; + deps += writePathsToFile(assets->getFullResPaths(), fp); + if (includeRaw) { + deps += writePathsToFile(assets->getFullAssetPaths(), fp); + } + return deps; +} |