Ying Wang | 24162fc | 2012-01-10 15:03:28 -0800 | [diff] [blame] | 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 | |
Neal Nguyen | 22e31e5 | 2010-01-07 10:14:05 -0800 | [diff] [blame] | 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. |
Neal Nguyen | 1a44d5d | 2010-01-13 10:42:43 -0800 | [diff] [blame] | 18 | LOCAL_SRC_FILES := \ |
| 19 | $(call all-java-files-under, src) \ |
Dan Egnor | 43fe81b | 2010-05-07 09:32:54 -0700 | [diff] [blame] | 20 | $(call all-Iaidl-files-under, src) \ |
Brett Chabot | 0dc59e7 | 2010-04-01 18:21:38 -0700 | [diff] [blame] | 21 | $(call all-java-files-under, DisabledTestApp/src) \ |
Dan Egnor | 43fe81b | 2010-05-07 09:32:54 -0700 | [diff] [blame] | 22 | $(call all-java-files-under, EnabledTestApp/src) |
Neal Nguyen | 22e31e5 | 2010-01-07 10:14:05 -0800 | [diff] [blame] | 23 | |
Brian Carlstrom | 3c7c351 | 2010-08-04 15:44:39 -0700 | [diff] [blame] | 24 | LOCAL_DX_FLAGS := --core-library |
Svetoslav Ganov | b36a0ac | 2012-02-14 17:46:47 -0800 | [diff] [blame] | 25 | LOCAL_STATIC_JAVA_LIBRARIES := core-tests android-common frameworks-core-util-lib mockwebserver guava littlemock |
Kenny Root | 12e7522 | 2013-04-23 22:34:24 -0700 | [diff] [blame] | 26 | LOCAL_JAVA_LIBRARIES := android.test.runner conscrypt telephony-common |
Neal Nguyen | 22e31e5 | 2010-01-07 10:14:05 -0800 | [diff] [blame] | 27 | LOCAL_PACKAGE_NAME := FrameworksCoreTests |
| 28 | |
Neal Nguyen | 1a44d5d | 2010-01-13 10:42:43 -0800 | [diff] [blame] | 29 | LOCAL_CERTIFICATE := platform |
| 30 | |
Ying Wang | 24162fc | 2012-01-10 15:03:28 -0800 | [diff] [blame] | 31 | # intermediate dir to include all the test apks as raw resource |
| 32 | FrameworkCoreTests_intermediates := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/test_apks/res |
| 33 | LOCAL_RESOURCE_DIR := $(FrameworkCoreTests_intermediates) $(LOCAL_PATH)/res |
Neal Nguyen | 22e31e5 | 2010-01-07 10:14:05 -0800 | [diff] [blame] | 34 | |
Ying Wang | 24162fc | 2012-01-10 15:03:28 -0800 | [diff] [blame] | 35 | include $(BUILD_PACKAGE) |
| 36 | # Rules to copy all the test apks to the intermediate raw resource directory |
| 37 | FrameworkCoreTests_all_apks_res := $(addprefix $(FrameworkCoreTests_intermediates)/raw/, \ |
| 38 | $(foreach a, $(FrameworkCoreTests_all_apks), $(patsubst FrameworkCoreTests_%,%,$(a)))) |
| 39 | |
| 40 | $(FrameworkCoreTests_all_apks_res): $(FrameworkCoreTests_intermediates)/raw/%: $(call intermediates-dir-for,APPS,FrameworkCoreTests_%)/package.apk | $(ACP) |
| 41 | $(call copy-file-to-new-target) |
| 42 | |
| 43 | # Use R_file_stamp as dependency because we want the test apks in place before the R.java is generated. |
| 44 | $(R_file_stamp) : $(FrameworkCoreTests_all_apks_res) |
| 45 | |
| 46 | FrameworkCoreTests_all_apks := |
| 47 | FrameworkCoreTests_intermediates := |
| 48 | FrameworkCoreTests_all_apks_res := |