Remove build variant "tests"
Bug: 5368571 Now we have a phony target "tests" instead. The target can be built in any other build variant (eg userdebug). For example, "make PRODUCT-full-userdebug tests dist" will build and put the *-test-* zip file in the dist dir. The "tests" target will include all modules tagged as "tests" in addition to other modules in specific target out directories. Change-Id: I8383097380d8e6846c3e2107d6dd5f68788cfc39
This commit is contained in:
parent
72ce769bea
commit
d0244b395a
|
@ -1214,6 +1214,7 @@ endif # TARGET_NO_KERNEL != true
|
|||
endif # TARGET_DEVICE != generic*
|
||||
endif # TARGET_PRODUCT != sdk
|
||||
|
||||
ifdef is_tests_build
|
||||
# -----------------------------------------------------------------
|
||||
# A zip of the tests that are built when running "make tests".
|
||||
# This is very similar to BUILT_TARGET_FILES_PACKAGE, but we
|
||||
|
@ -1244,23 +1245,13 @@ $(BUILT_TESTS_ZIP_PACKAGE): \
|
|||
$(TARGET_OUT_DATA),$(zip_root)/DATA)
|
||||
$(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .)
|
||||
|
||||
.PHONY: tests-zip-package
|
||||
tests-zip-package: $(BUILT_TESTS_ZIP_PACKAGE)
|
||||
|
||||
# Target needed by tests build
|
||||
.PHONY: tests-build-target
|
||||
tests-build-target: $(BUILT_TESTS_ZIP_PACKAGE)
|
||||
|
||||
ifneq (,$(filter $(MAKECMDGOALS),tests-build-target))
|
||||
$(call dist-for-goals, tests-build-target, \
|
||||
$(BUILT_TESTS_ZIP_PACKAGE))
|
||||
endif
|
||||
|
||||
.PHONY: tests
|
||||
tests: $(BUILT_TESTS_ZIP_PACKAGE)
|
||||
|
||||
ifneq (,$(filter tests, $(MAKECMDGOALS)))
|
||||
$(call dist-for-goals, tests, $(BUILT_TESTS_ZIP_PACKAGE))
|
||||
$(call dist-for-goals, tests, $(BUILT_TESTS_ZIP_PACKAGE))
|
||||
endif
|
||||
endif # is_tests_build
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# A zip of the symbols directory. Keep the full paths to make it
|
||||
|
|
|
@ -114,10 +114,10 @@ TARGET_COPY_OUT_RECOVERY := recovery
|
|||
# variables that we need in order to locate the output files.
|
||||
include $(BUILD_SYSTEM)/product_config.mk
|
||||
|
||||
build_variant := $(filter-out user userdebug eng tests,$(TARGET_BUILD_VARIANT))
|
||||
build_variant := $(filter-out eng user userdebug,$(TARGET_BUILD_VARIANT))
|
||||
ifneq ($(build_variant)-$(words $(TARGET_BUILD_VARIANT)),-1)
|
||||
$(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT))
|
||||
$(error must be empty or one of: user userdebug eng tests)
|
||||
$(error must be empty or one of: eng user userdebug)
|
||||
endif
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
|
|
10
core/main.mk
10
core/main.mk
|
@ -232,8 +232,8 @@ include $(BUILD_SYSTEM)/dex_preopt.mk
|
|||
ifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),)
|
||||
$(info ***************************************************************)
|
||||
$(info ***************************************************************)
|
||||
$(info Do not pass '$(filter user userdebug eng tests,$(MAKECMDGOALS))' on \
|
||||
the make command line.)
|
||||
$(info Do not pass '$(filter user userdebug eng,$(MAKECMDGOALS))' on \
|
||||
the make command line.)
|
||||
$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or)
|
||||
$(info choosecombo.)
|
||||
$(info ***************************************************************)
|
||||
|
@ -345,12 +345,6 @@ ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL
|
|||
endif
|
||||
endif
|
||||
|
||||
## tests ##
|
||||
|
||||
ifeq ($(TARGET_BUILD_VARIANT),tests)
|
||||
tags_to_install := debug eng tests
|
||||
endif
|
||||
|
||||
## sdk ##
|
||||
|
||||
ifdef is_sdk_build
|
||||
|
|
|
@ -82,7 +82,7 @@ endef
|
|||
# These are the valid values of TARGET_BUILD_VARIANT. Also, if anything else is passed
|
||||
# as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form,
|
||||
# it will be treated as a goal, and the eng variant will be used.
|
||||
INTERNAL_VALID_VARIANTS := user userdebug eng tests
|
||||
INTERNAL_VALID_VARIANTS := user userdebug eng
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build
|
||||
|
@ -109,6 +109,10 @@ ifdef product_goals
|
|||
# The variant they want
|
||||
TARGET_BUILD_VARIANT := $(word 2,$(product_goals))
|
||||
|
||||
ifeq ($(TARGET_BUILD_VARIANT),tests)
|
||||
$(error "tests" has been deprecated as a build variant. Use it as a build goal instead.)
|
||||
endif
|
||||
|
||||
# The build server wants to do make PRODUCT-dream-installclean
|
||||
# which really means TARGET_PRODUCT=dream make installclean.
|
||||
ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
|
||||
|
@ -119,11 +123,6 @@ ifdef product_goals
|
|||
default_goal_substitution := $(DEFAULT_GOAL)
|
||||
endif
|
||||
|
||||
# For tests build, only build tests-build-target
|
||||
ifeq (tests,$(TARGET_BUILD_VARIANT))
|
||||
default_goal_substitution := tests-build-target
|
||||
endif
|
||||
|
||||
# Replace the PRODUCT-* goal with the build goal that it refers to.
|
||||
# Note that this will ensure that it appears in the same relative
|
||||
# position, in case it matters.
|
||||
|
|
Loading…
Reference in New Issue