Home | History | Annotate | Download | only in coretests
      1 ACTUAL_LOCAL_PATH := $(call my-dir)
      2 
      3 # this var will hold all the test apk module names later.
      4 FrameworkCoreTests_all_apks :=
      5 
      6 # We have to include the subdir makefiles first
      7 # so that FrameworkCoreTests_all_apks will be populated correctly.
      8 include $(call all-makefiles-under,$(ACTUAL_LOCAL_PATH))
      9 
     10 LOCAL_PATH := $(ACTUAL_LOCAL_PATH)
     11 
     12 include $(CLEAR_VARS)
     13 
     14 # We only want this apk build for tests.
     15 LOCAL_MODULE_TAGS := tests
     16 
     17 # Include all test java files.
     18 LOCAL_SRC_FILES := \
     19 	$(call all-java-files-under, src) \
     20 	$(call all-Iaidl-files-under, src) \
     21 	$(call all-java-files-under, DisabledTestApp/src) \
     22 	$(call all-java-files-under, EnabledTestApp/src) \
     23 	$(call all-java-files-under, BinderProxyCountingTestApp/src) \
     24 	$(call all-java-files-under, BinderProxyCountingTestService/src) \
     25 	$(call all-Iaidl-files-under, aidl)
     26 
     27 LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl
     28 
     29 LOCAL_DX_FLAGS := --core-library
     30 LOCAL_JACK_FLAGS := --multi-dex native
     31 LOCAL_AAPT_FLAGS = -0 dat -0 gld -c fa
     32 LOCAL_STATIC_JAVA_LIBRARIES := \
     33     frameworks-base-testutils \
     34     core-tests-support \
     35     android-common \
     36     frameworks-core-util-lib \
     37     mockwebserver \
     38     guava \
     39     android-support-test \
     40     mockito-target-minus-junit4 \
     41     espresso-core \
     42     ub-uiautomator \
     43     platform-test-annotations \
     44     compatibility-device-util \
     45     truth-prebuilt \
     46     print-test-util-lib
     47 
     48 LOCAL_JAVA_LIBRARIES := \
     49     android.test.runner \
     50     conscrypt \
     51     telephony-common \
     52     org.apache.http.legacy \
     53     android.test.base \
     54     android.test.mock \
     55     framework-oahl-backward-compatibility \
     56     framework-atb-backward-compatibility \
     57 
     58 LOCAL_PACKAGE_NAME := FrameworksCoreTests
     59 LOCAL_PRIVATE_PLATFORM_APIS := true
     60 LOCAL_COMPATIBILITY_SUITE := device-tests
     61 
     62 LOCAL_CERTIFICATE := platform
     63 
     64 # intermediate dir to include all the test apks as raw resource
     65 FrameworkCoreTests_intermediates := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/test_apks/res
     66 LOCAL_RESOURCE_DIR := $(FrameworkCoreTests_intermediates) $(LOCAL_PATH)/res
     67 
     68 include $(BUILD_PACKAGE)
     69 # Rules to copy all the test apks to the intermediate raw resource directory
     70 FrameworkCoreTests_all_apks_res := $(addprefix $(FrameworkCoreTests_intermediates)/raw/, \
     71     $(foreach a, $(FrameworkCoreTests_all_apks), $(patsubst FrameworkCoreTests_%,%,$(a))))
     72 
     73 $(FrameworkCoreTests_all_apks_res): $(FrameworkCoreTests_intermediates)/raw/%: $(call intermediates-dir-for,APPS,FrameworkCoreTests_%)/package.apk
     74 	$(call copy-file-to-new-target)
     75 
     76 # Use R_file_stamp as dependency because we want the test apks in place before the R.java is generated.
     77 $(R_file_stamp) : $(FrameworkCoreTests_all_apks_res)
     78 
     79 FrameworkCoreTests_all_apks :=
     80 FrameworkCoreTests_intermediates :=
     81 FrameworkCoreTests_all_apks_res :=
     82