diff options
| -rw-r--r-- | tools/aapt2/Android.bp | 36 | ||||
| -rw-r--r-- | tools/aapt2/Android.mk | 20 |
2 files changed, 37 insertions, 19 deletions
diff --git a/tools/aapt2/Android.bp b/tools/aapt2/Android.bp index 40cba3ed316f..bca77978c502 100644 --- a/tools/aapt2/Android.bp +++ b/tools/aapt2/Android.bp @@ -236,3 +236,39 @@ genrule { ], }, } + +cc_genrule { + name: "aapt2_results", + srcs: [ + ":aapt2_tests", + "integration-tests/CompileTest/**/*", + "integration-tests/CommandTests/**/*", + "integration-tests/ConvertTest/**/*", + "integration-tests/DumpTest/**/*", + ], + host_supported: true, + device_supported: false, + target: { + windows: { + compile_multilib: "64", + }, + }, + out: ["result.xml"], + cmd: "mkdir -p $(genDir)/integration-tests/CompileTest/ && " + + "cp $(locations integration-tests/CompileTest/**/*) $(genDir)/integration-tests/CompileTest/ && " + + "mkdir -p $(genDir)/integration-tests/CommandTests/ && " + + "cp $(locations integration-tests/CommandTests/**/*) $(genDir)/integration-tests/CompileTest/ && " + + "mkdir -p $(genDir)/integration-tests/ConvertTest/ && " + + "cp $(locations integration-tests/ConvertTest/**/*) $(genDir)/integration-tests/ConvertTest/ && " + + "mkdir -p $(genDir)/integration-tests/DumpTest/ && " + + "cp $(locations integration-tests/DumpTest/**/*) $(genDir)/integration-tests/DumpTest/ && " + + "cp $(locations :aapt2_tests) $(genDir)/ && " + + "$(genDir)/aapt2_tests " + + "--gtest_output=xml:$(out) " + + ">/dev/null 2>&1 ; true", +} + +phony_rule { + name: "aapt2_run_host_unit_tests", + phony_deps: ["aapt2_results"], +} diff --git a/tools/aapt2/Android.mk b/tools/aapt2/Android.mk index 34a1b112d880..15ae2baa73df 100644 --- a/tools/aapt2/Android.mk +++ b/tools/aapt2/Android.mk @@ -1,22 +1,4 @@ -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: $(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 := ./out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2_results $(call declare-1p-target,$(aapt2_results)) - aapt2_results := - -include $(call all-makefiles-under,$(LOCAL_PATH)) |