summaryrefslogtreecommitdiff
path: root/tools/aapt/Resource.cpp
diff options
context:
space:
mode:
author Xavier Ducrohet <xav@android.com> 2011-07-19 10:03:16 -0700
committer Android Code Review <code-review@android.com> 2011-07-19 10:03:16 -0700
commitd40c93f61ca5b3f2351b8db716f67b58f1625e85 (patch)
tree49a75df29d44fe6f3d69635f40f91c7dacf54d38 /tools/aapt/Resource.cpp
parent42755155d6e8ddc3201b08def2bf262a64fa25f2 (diff)
parent9bf34ca6f85309c65b0ebdf614cb8266401b49ba (diff)
Merge "Add dependency generation to Aapt for R.java"
Diffstat (limited to 'tools/aapt/Resource.cpp')
-rw-r--r--tools/aapt/Resource.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 0a4f24f26df2..a603314709ab 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -51,6 +51,12 @@ ResourceTypeSet::ResourceTypeSet()
{
}
+FilePathStore::FilePathStore()
+ :RefBase(),
+ Vector<String8>()
+{
+}
+
class ResourceDirIterator
{
public:
@@ -1849,6 +1855,16 @@ status_t writeResourceSymbols(Bundle* bundle, const sp<AaptAssets>& assets,
return err;
}
fclose(fp);
+
+ if (bundle->getGenDependencies()) {
+ // Add this R.java to the dependency file
+ String8 dependencyFile(bundle->getRClassDir());
+ dependencyFile.appendPath("R.d");
+
+ fp = fopen(dependencyFile.string(), "a");
+ fprintf(fp,"%s \\\n", dest.string());
+ fclose(fp);
+ }
}
return NO_ERROR;
@@ -2170,3 +2186,16 @@ writeProguardFile(Bundle* bundle, const sp<AaptAssets>& assets)
return err;
}
+
+status_t
+writeDependencyPreReqs(Bundle* bundle, const sp<AaptAssets>& assets, 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