summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dan Willemsen <dwillemsen@google.com> 2018-10-16 17:43:35 -0700
committer android-build-merger <android-build-merger@google.com> 2018-10-16 17:43:35 -0700
commit9b767e275e252cef0a8df2ecce68ea97cfed322b (patch)
treee6627c95883fb6f2df99eaccd46a01cdbb84bae6
parent646684732122d9dfe782a38145f7cf4c038247f3 (diff)
parenta8f2601d282018ff5e27a4f56f059701bc16afbe (diff)
Merge "Stop using DIST_DIR directly, use dist-for-goals instead"
am: a8f2601d28 Change-Id: Iabb2ddb086dda71887c3d50152db50f813c9556a
-rw-r--r--tools/aapt2/Android.mk15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/aapt2/Android.mk b/tools/aapt2/Android.mk
index c9987b86cc5c..b165c6bed220 100644
--- a/tools/aapt2/Android.mk
+++ b/tools/aapt2/Android.mk
@@ -2,10 +2,19 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
+aapt2_results := $(call intermediates-dir-for,PACKAGING,aapt2_run_host_unit_tests)/result.xml
+
# Target for running host unit tests on post/pre-submit.
.PHONY: aapt2_run_host_unit_tests
-aapt2_run_host_unit_tests: PRIVATE_GTEST_OPTIONS := --gtest_output=xml:$(DIST_DIR)/gtest/aapt2_host_unit_tests_result.xml
-aapt2_run_host_unit_tests: $(HOST_OUT_NATIVE_TESTS)/aapt2_tests/aapt2_tests
- -$(HOST_OUT_NATIVE_TESTS)/aapt2_tests/aapt2_tests $(PRIVATE_GTEST_OPTIONS) > /dev/null 2>&1
+aapt2_run_host_unit_tests: $(aapt2_results)
+
+$(call dist-for-goals,aapt2_run_host_unit_tests,$(aapt2_results):gtest/aapt2_host_unit_tests_result.xml)
+
+# Always run the tests again, even if they haven't changed
+$(aapt2_results): .KATI_IMPLICIT_OUTPUTS := $(aapt2_results)-nocache
+$(aapt2_results): $(HOST_OUT_NATIVE_TESTS)/aapt2_tests/aapt2_tests
+ -$(HOST_OUT_NATIVE_TESTS)/aapt2_tests/aapt2_tests --gtest_output=xml:$@ > /dev/null 2>&1
+
+aapt2_results :=
include $(call all-makefiles-under,$(LOCAL_PATH))