blob: e0d53933b33bdedccf3e0fbb282d7d78da7d67b8 [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) \
Michael Wachenschwanz55182462017-08-14 23:10:13 -070022 $(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
27LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl
Neal Nguyen22e31e52010-01-07 10:14:05 -080028
Colin Crossbe2d3302016-12-21 16:48:32 -080029LOCAL_DX_FLAGS := --core-library
Paul Duffin5c318a02017-03-11 18:02:22 +000030LOCAL_JACK_FLAGS := --multi-dex native
Roozbeh Pournaderfb9236c2015-12-15 23:56:11 -080031LOCAL_AAPT_FLAGS = -0 dat -0 gld -c fa
Abodunrinwa Toki223c8392015-07-24 20:55:59 -070032LOCAL_STATIC_JAVA_LIBRARIES := \
Phil Weaverb9f06122017-11-30 10:48:17 -080033 frameworks-base-testutils \
Abodunrinwa Toki223c8392015-07-24 20:55:59 -070034 core-tests-support \
35 android-common \
36 frameworks-core-util-lib \
37 mockwebserver \
38 guava \
Abodunrinwa Toki223c8392015-07-24 20:55:59 -070039 android-support-test \
Guang Zhu01c560f2016-08-24 10:49:23 -070040 mockito-target-minus-junit4 \
Philip P. Moltmann76d7e3e2016-01-15 13:22:13 -080041 espresso-core \
Chet Haase9392d402016-06-08 15:40:46 -070042 ub-uiautomator \
Chris Craik3f06c6d2017-01-09 18:19:48 +000043 platform-test-annotations \
Daniel Nishibaa38112017-02-07 16:47:57 -080044 compatibility-device-util \
Philip P. Moltmann13fba9d2017-10-10 09:52:15 -070045 truth-prebuilt \
46 print-test-util-lib
Chris Craik3f06c6d2017-01-09 18:19:48 +000047
Paul Duffin2710ca12017-12-05 18:36:56 +000048LOCAL_JAVA_LIBRARIES := \
49 android.test.runner \
50 conscrypt \
51 telephony-common \
52 org.apache.http.legacy \
53 android.test.base \
54 android.test.mock \
Paul Duffin0692a562018-01-09 12:35:32 +000055 framework-oahl-backward-compatibility \
Paul Duffina3b69212018-01-25 09:58:32 +000056 framework-atb-backward-compatibility \
Paul Duffinbeee5dc2018-01-23 13:39:00 +000057
Neal Nguyen22e31e52010-01-07 10:14:05 -080058LOCAL_PACKAGE_NAME := FrameworksCoreTests
Anton Hanssonab6ec612018-02-23 12:57:51 +000059LOCAL_PRIVATE_PLATFORM_APIS := true
Simran Basi473a16e2017-03-15 14:43:58 -070060LOCAL_COMPATIBILITY_SUITE := device-tests
Neal Nguyen22e31e52010-01-07 10:14:05 -080061
Neal Nguyen1a44d5d2010-01-13 10:42:43 -080062LOCAL_CERTIFICATE := platform
63
Ying Wang24162fc2012-01-10 15:03:28 -080064# intermediate dir to include all the test apks as raw resource
65FrameworkCoreTests_intermediates := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/test_apks/res
66LOCAL_RESOURCE_DIR := $(FrameworkCoreTests_intermediates) $(LOCAL_PATH)/res
Neal Nguyen22e31e52010-01-07 10:14:05 -080067
Colin Crossb3c18142018-05-18 09:50:29 -070068# Disable AAPT2 because the hacks below depend on the AAPT rules implementation
Colin Cross940b98e2018-05-16 09:21:18 -070069LOCAL_USE_AAPT2 := false
Colin Crossb3c18142018-05-18 09:50:29 -070070# When AAPT2 is enabled it will need --warn-manifest-validation to fix:
71# frameworks/base/core/tests/coretests/AndroidManifest.xml:26: error: unknown element <meta-data> found.
72# TODO(b/79755007): Remove when AAPT2 recognizes the manifest elements.
73# LOCAL_AAPT_FLAGS += --warn-manifest-validation
Colin Cross940b98e2018-05-16 09:21:18 -070074
Ying Wang24162fc2012-01-10 15:03:28 -080075include $(BUILD_PACKAGE)
76# Rules to copy all the test apks to the intermediate raw resource directory
77FrameworkCoreTests_all_apks_res := $(addprefix $(FrameworkCoreTests_intermediates)/raw/, \
78 $(foreach a, $(FrameworkCoreTests_all_apks), $(patsubst FrameworkCoreTests_%,%,$(a))))
79
Dan Willemsen98ff0b72016-03-23 00:42:44 -070080$(FrameworkCoreTests_all_apks_res): $(FrameworkCoreTests_intermediates)/raw/%: $(call intermediates-dir-for,APPS,FrameworkCoreTests_%)/package.apk
Ying Wang24162fc2012-01-10 15:03:28 -080081 $(call copy-file-to-new-target)
82
83# Use R_file_stamp as dependency because we want the test apks in place before the R.java is generated.
84$(R_file_stamp) : $(FrameworkCoreTests_all_apks_res)
85
86FrameworkCoreTests_all_apks :=
87FrameworkCoreTests_intermediates :=
88FrameworkCoreTests_all_apks_res :=