summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNelson Li <nelsonli@google.com>2024-01-30 08:46:02 +0000
committerNelson Li <nelsonli@google.com>2024-01-30 09:06:36 +0000
commit08b87e4c0c69b7a08dfda266fa9a93cbd1a7a81e (patch)
tree258956692ea518d4a857c2188b02bba2487fa365 /tools
parentbf88ecf8794faf6022c6df82c015161811e8104c (diff)
downloadbase-08b87e4c0c69b7a08dfda266fa9a93cbd1a7a81e.tar.gz
Convert `aapt2_run_host_unit_tests` to Android.bp
The handling of `declare-1p-target` will be deferred for future processing. Bug: 322285259 Test: m aapt2_results Test: m aapt2_run_host_unit_tests Test: m -j out/host/linux-x86/gen/META/lic_intermediates/./out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2_results.meta_lic Change-Id: I65ff18c9f4b490726011a490ba9045bf2078068e
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt2/Android.bp36
-rw-r--r--tools/aapt2/Android.mk20
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))