am 427964ed: Merge "Include build number in aapt version" into lmp-dev
* commit '427964ed3c2647dcd5669ce77ec387bf71ba13f0':
Include build number in aapt version
diff --git a/tools/aapt/Android.mk b/tools/aapt/Android.mk
index 700afa1..4ce5045 100644
--- a/tools/aapt/Android.mk
+++ b/tools/aapt/Android.mk
@@ -66,6 +66,8 @@
libexpat \
libziparchive-host
+aaptCFlags := -DAAPT_VERSION=\"$(BUILD_NUMBER)\"
+
ifeq ($(HOST_OS),linux)
aaptHostLdLibs += -lrt -ldl -lpthread
endif
@@ -91,6 +93,7 @@
LOCAL_CFLAGS += -Wno-format-y2k
LOCAL_CFLAGS += -DSTATIC_ANDROIDFW_FOR_TOOLS
+LOCAL_CFLAGS += $(aaptCFlags)
ifeq (darwin,$(HOST_OS))
LOCAL_CFLAGS += -D_DARWIN_UNLIMITED_STREAMS
endif
@@ -110,7 +113,9 @@
LOCAL_STATIC_LIBRARIES += \
libaapt \
$(aaptHostStaticLibs)
+
LOCAL_LDLIBS += $(aaptHostLdLibs)
+LOCAL_CFLAGS += $(aaptCFlags)
include $(BUILD_HOST_EXECUTABLE)
@@ -128,7 +133,9 @@
LOCAL_STATIC_LIBRARIES += \
libaapt \
$(aaptHostStaticLibs)
+
LOCAL_LDLIBS += $(aaptHostLdLibs)
+LOCAL_CFLAGS += $(aaptCFlags)
include $(BUILD_HOST_NATIVE_TEST)
@@ -159,6 +166,7 @@
libstlport_static \
libexpat_static
+LOCAL_CFLAGS += $(aaptCFlags)
LOCAL_CPPFLAGS += -Wno-non-virtual-dtor
include $(BUILD_EXECUTABLE)
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 5d146d6..bdbf47b 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -24,6 +24,10 @@
using namespace android;
+#ifndef AAPT_VERSION
+ #define AAPT_VERSION ""
+#endif
+
/*
* Show version info. All the cool kids do it.
*/
@@ -32,7 +36,7 @@
if (bundle->getFileSpecCount() != 0) {
printf("(ignoring extra arguments)\n");
}
- printf("Android Asset Packaging Tool, v0.2\n");
+ printf("Android Asset Packaging Tool, v0.2-" AAPT_VERSION "\n");
return 0;
}