blob: eb055de01c63693985e3296a0e74b3d7fc98da4f [file] [log] [blame]
Ying Wang24162fc2012-01-10 15:03:28 -08001ACTUAL_LOCAL_PATH := $(call my-dir)
2
3# this var will hold all the test apk module names later.
4FrameworkCoreTests_all_apks :=
5
6# We have to include the subdir makefiles first
7# so that FrameworkCoreTests_all_apks will be populated correctly.
8include $(call all-makefiles-under,$(ACTUAL_LOCAL_PATH))
9
10LOCAL_PATH := $(ACTUAL_LOCAL_PATH)
11
Neal Nguyen22e31e52010-01-07 10:14:05 -080012include $(CLEAR_VARS)
13
14# We only want this apk build for tests.
15LOCAL_MODULE_TAGS := tests
16
17# Include all test java files.
Neal Nguyen1a44d5d2010-01-13 10:42:43 -080018LOCAL_SRC_FILES := \
19 $(call all-java-files-under, src) \
Dan Egnor43fe81b2010-05-07 09:32:54 -070020 $(call all-Iaidl-files-under, src) \
Brett Chabot0dc59e72010-04-01 18:21:38 -070021 $(call all-java-files-under, DisabledTestApp/src) \
Dan Egnor43fe81b2010-05-07 09:32:54 -070022 $(call all-java-files-under, EnabledTestApp/src)
Neal Nguyen22e31e52010-01-07 10:14:05 -080023
Brian Carlstrom3c7c3512010-08-04 15:44:39 -070024LOCAL_DX_FLAGS := --core-library
Roozbeh Pournaderfb9236c2015-12-15 23:56:11 -080025LOCAL_AAPT_FLAGS = -0 dat -0 gld -c fa
Abodunrinwa Toki223c8392015-07-24 20:55:59 -070026LOCAL_STATIC_JAVA_LIBRARIES := \
27 core-tests-support \
28 android-common \
29 frameworks-core-util-lib \
30 mockwebserver \
31 guava \
32 littlemock \
33 android-support-test \
34 mockito-target \
Philip P. Moltmann76d7e3e2016-01-15 13:22:13 -080035 espresso-core \
36 ub-uiautomator
Narayan Kamath3bdd3272014-11-27 18:17:35 +000037LOCAL_JAVA_LIBRARIES := android.test.runner conscrypt telephony-common org.apache.http.legacy
Neal Nguyen22e31e52010-01-07 10:14:05 -080038LOCAL_PACKAGE_NAME := FrameworksCoreTests
39
Neal Nguyen1a44d5d2010-01-13 10:42:43 -080040LOCAL_CERTIFICATE := platform
41
Ying Wang24162fc2012-01-10 15:03:28 -080042# intermediate dir to include all the test apks as raw resource
43FrameworkCoreTests_intermediates := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/test_apks/res
44LOCAL_RESOURCE_DIR := $(FrameworkCoreTests_intermediates) $(LOCAL_PATH)/res
Neal Nguyen22e31e52010-01-07 10:14:05 -080045
Ying Wang24162fc2012-01-10 15:03:28 -080046include $(BUILD_PACKAGE)
47# Rules to copy all the test apks to the intermediate raw resource directory
48FrameworkCoreTests_all_apks_res := $(addprefix $(FrameworkCoreTests_intermediates)/raw/, \
49 $(foreach a, $(FrameworkCoreTests_all_apks), $(patsubst FrameworkCoreTests_%,%,$(a))))
50
51$(FrameworkCoreTests_all_apks_res): $(FrameworkCoreTests_intermediates)/raw/%: $(call intermediates-dir-for,APPS,FrameworkCoreTests_%)/package.apk | $(ACP)
52 $(call copy-file-to-new-target)
53
54# Use R_file_stamp as dependency because we want the test apks in place before the R.java is generated.
55$(R_file_stamp) : $(FrameworkCoreTests_all_apks_res)
56
57FrameworkCoreTests_all_apks :=
58FrameworkCoreTests_intermediates :=
59FrameworkCoreTests_all_apks_res :=