summaryrefslogtreecommitdiff
path: root/tools/aapt/Command.cpp
diff options
context:
space:
mode:
author Josiah Gaskin <josiahgaskin@google.com> 2011-06-06 17:00:35 -0700
committer Josiah Gaskin <josiahgaskin@google.com> 2011-07-20 15:20:26 -0700
commit8a39da80b33691b0c82458c3b7727e13ff71277e (patch)
treeb6fa94370ecb2dba85d5fdb45c83729cef8708e1 /tools/aapt/Command.cpp
parent1e24ccbdd56a45c8bb5f2eba94af5aecd2d02554 (diff)
Added Caching for PreProcessed PNGs
Added a cache management system for pre-processed PNG files along with unit tests. The cache system will be used if the --no-crunch flag is passed to AAPT during the package phase. The cache can be updated by a call to 'aapt crunch' (see usage statement). Also put in benchmarking code. Change-Id: I58271fb2ee2f5f9075fd74d4ff6f15e7afabd05c
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r--tools/aapt/Command.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 8447d7436d5b..3bc5fa1c34c3 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -1504,3 +1504,25 @@ bail:
}
return retVal;
}
+
+/*
+ * Do PNG Crunching
+ * PRECONDITIONS
+ * -S flag points to a source directory containing drawable* folders
+ * -C flag points to destination directory. The folder structure in the
+ * source directory will be mirrored to the destination (cache) directory
+ *
+ * POSTCONDITIONS
+ * Destination directory will be updated to match the PNG files in
+ * the source directory.
+ */
+int doCrunch(Bundle* bundle)
+{
+ fprintf(stdout, "Crunching PNG Files in ");
+ fprintf(stdout, "source dir: %s\n", bundle->getResourceSourceDirs()[0]);
+ fprintf(stdout, "To destination dir: %s\n", bundle->getCrunchedOutputDir());
+
+ updatePreProcessedCache(bundle);
+
+ return NO_ERROR;
+}