summaryrefslogtreecommitdiff
path: root/tools/aapt/Command.cpp
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-12-21 09:54:02 -0800
committerXavier Ducrohet <xav@android.com>2013-01-02 15:41:52 -0800
commit22d7cf239d8a9b009ea7adf86d8826a8a8116d03 (patch)
tree80b4db57378fff41d163e2980dd9ff0a7b6e6840 /tools/aapt/Command.cpp
parent0dae634b06f5dc6039a5aaa9c0f00250e10c6547 (diff)
Add single crunch command to aapt. do not merge.
Previously the crunch command would work on a full res folder and output a full res folder (with only the drawables). This was only used in the SDK. The incremental logic is moved to the SDK build system so we change the crunch command (or rather add a new one) to only crunch a single file. (cherry picked from commit b1f6ad82dd8d1702617a757a88430604b3131fac) Change-Id: I3653f67ee321eac37cb8a6d228b1ef6d104ff0be
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r--tools/aapt/Command.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 0a5e5904a95a..b98925bd184c 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -7,6 +7,7 @@
#include "Bundle.h"
#include "ResourceFilter.h"
#include "ResourceTable.h"
+#include "Images.h"
#include "XMLNode.h"
#include <utils/Log.h>
@@ -1839,6 +1840,21 @@ int doCrunch(Bundle* bundle)
return NO_ERROR;
}
+/*
+ * Do PNG Crunching on a single flag
+ * -i points to a single png file
+ * -o points to a single png output file
+ */
+int doSingleCrunch(Bundle* bundle)
+{
+ fprintf(stdout, "Crunching single PNG file: %s\n", bundle->getSingleCrunchInputFile());
+ fprintf(stdout, "\tOutput file: %s\n", bundle->getSingleCrunchOutputFile());
+
+ String8 input(bundle->getSingleCrunchInputFile());
+ String8 output(bundle->getSingleCrunchOutputFile());
+ return preProcessImageToCache(bundle, input, output);
+}
+
char CONSOLE_DATA[2925] = {
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 95, 46, 32, 32, 32, 32, 32, 32, 32, 32, 32,