Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7f17259 authored by wangzhou's avatar wangzhou Committed by Colin Cross
Browse files

Build NOTICE txt file into TestSuite zip package.

- the NOTICE file is only taken from out/host.
- currently only enabled from cts by setting flag "test_suite_notice"

Test: $ make cts && unzip -l \
        out/host/linux-x86/cts/android-cts.zip \
        | grep NOTICE
      $ make pts && \ unzip -l \
        out/host/linux-x86/cts/android-cts.zip \
        | grep NOTICE
Bug: b/141258651
Change-Id: I696b424e5f2b09d28d53ccbd9198e1f4f301ec01
Merged-In: I696b424e5f2b09d28d53ccbd9198e1f4f301ec01
(cherry picked from commit 93d2fbbc)
parent 6ad6d563
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ test_suite_name := cts
test_suite_tradefed := cts-tradefed
test_suite_dynamic_config := test/suite_harness/tools/cts-tradefed/DynamicConfig.xml
test_suite_readme := test/suite_harness/tools/cts-tradefed/README
test_suite_notice := $(tools_notice_file_txt)

include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk

+13 −2
Original line number Diff line number Diff line
@@ -47,20 +47,30 @@ test_tools += $(test_suite_tools)
# Include host shared libraries
host_shared_libs := $(call copy-many-files, $(COMPATIBILITY.$(test_suite_name).HOST_SHARED_LIBRARY.FILES))

compatibility_zip_deps := $(test_artifacts) $(test_tools) $(test_suite_prebuilt_tools) $(test_suite_dynamic_config) $(SOONG_ZIP) $(host_shared_libs)
compatibility_zip_resources := $(out_dir)/tools $(out_dir)/testcases
ifdef test_suite_notice
	compatibility_zip_deps += $(test_suite_notice)
	compatibility_zip_resources += $(out_dir)/$(notdir $(test_suite_notice))
endif

compatibility_zip := $(out_dir).zip
$(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name)
$(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir)
$(compatibility_zip): PRIVATE_TOOLS := $(test_tools) $(test_suite_prebuilt_tools)
$(compatibility_zip): PRIVATE_SUITE_NAME := $(test_suite_name)
$(compatibility_zip): PRIVATE_DYNAMIC_CONFIG := $(test_suite_dynamic_config)
$(compatibility_zip): $(test_artifacts) $(test_tools) $(test_suite_prebuilt_tools) $(test_suite_dynamic_config) $(SOONG_ZIP) $(host_shared_libs) | $(ADB) $(ACP)
$(compatibility_zip): PRIVATE_NOTICE := $(test_suite_notice)
$(compatibility_zip): PRIVATE_RESOURCES := $(compatibility_zip_resources)
$(compatibility_zip): $(compatibility_zip_deps) | $(ADB) $(ACP)
# Make dir structure
	$(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases
	$(hide) echo $(BUILD_NUMBER_FROM_FILE) > $(PRIVATE_OUT_DIR)/tools/version.txt
# Copy tools
	$(hide) cp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
	$(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) cp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
	$(hide) find $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases | sort >$@.list
	$(if $(PRIVATE_NOTICE),$(hide) cp $(PRIVATE_NOTICE) $(PRIVATE_OUT_DIR))
	$(hide) find $(PRIVATE_RESOURCES) | sort >$@.list
	$(hide) $(SOONG_ZIP) -d -o $@ -C $(dir $@) -l $@.list

# Reset all input variables
@@ -70,4 +80,5 @@ test_suite_dynamic_config :=
test_suite_readme :=
test_suite_prebuilt_tools :=
test_suite_tools :=
test_suite_notice :=
host_shared_libs :=