Add a library so libphonenumber tests can be run easily on device
Change-Id: I34743fa1b1b596cd722397f48591cea28d31e74a
diff --git a/Android.mk b/Android.mk
index ee21650..3318211 100644
--- a/Android.mk
+++ b/Android.mk
@@ -35,6 +35,17 @@
$(libphonenumber_platform_resource_dirs) \
carrier/src
+libphonenumber_test_files := \
+ $(call all-java-files-under, carrier/test) \
+ $(call all-java-files-under, geocoder/test) \
+ $(call all-java-files-under, internal/prefixmapper/test) \
+ $(call all-java-files-under, libphonenumber/test)
+
+libphonenumber_test_resource_dirs := \
+ carrier/test \
+ geocoder/test \
+ libphonenumber/test
+
# For platform use, builds directly against core-libart to avoid circular
# dependencies. *NOT* for unbundled use.
include $(CLEAR_VARS)
@@ -57,3 +68,17 @@
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SDK_VERSION := 9
include $(BUILD_STATIC_JAVA_LIBRARY)
+
+# Tests for unbundled use.
+# vogar --timeout 0 --classpath out/target/common/obj/JAVA_LIBRARIES/libphonenumber_intermediates/classes.jar \
+# --classpath out/target/common/obj/JAVA_LIBRARIES/libphonenumber-test_intermediates/classes.jar \
+# com.google.i18n.phonenumbers
+include $(CLEAR_VARS)
+LOCAL_MODULE := libphonenumber-test
+LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := $(libphonenumber_test_files)
+LOCAL_JAVA_RESOURCE_DIRS := $(libphonenumber_test_resource_dirs)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_SDK_VERSION := current
+LOCAL_JAVA_LIBRARIES := libphonenumber
+include $(BUILD_STATIC_JAVA_LIBRARY)