Added new android.test.base targets
Renames ...-legacy-test-... targets related to stubs generation to
...-android-test-base-....
Bug: 30188076
Test: make checkbuild
Change-Id: I54204733612d6d3f14dd8023973e993a5ddab51d
diff --git a/test-base/Android.mk b/test-base/Android.mk
index f73eff7..9fc70f3 100644
--- a/test-base/Android.mk
+++ b/test-base/Android.mk
@@ -16,6 +16,21 @@
LOCAL_PATH:= $(call my-dir)
+# Build the android.test.base library
+# ===================================
+# This contains the junit.framework and android.test classes that were in
+# Android API level 25 excluding those from android.test.runner.
+# Also contains the com.android.internal.util.Predicate[s] classes.
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_MODULE := android.test.base
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
+
+include $(BUILD_JAVA_LIBRARY)
+
# Build the legacy-test library
# =============================
# This contains the junit.framework and android.test classes that were in
@@ -45,8 +60,22 @@
include $(BUILD_STATIC_JAVA_LIBRARY)
-# Generate the stub source files for legacy.test.stubs
-# ====================================================
+# Build the repackaged.android.test.base library
+# ==============================================
+# This contains repackaged versions of the classes from legacy-test.
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_MODULE := repackaged.android.test.base
+LOCAL_NO_STANDARD_LIBRARIES := true
+LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
+LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+# Generate the stub source files for android.test.base.stubs
+# ==========================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
@@ -60,81 +89,81 @@
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src
-LEGACY_TEST_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/legacy.test.stubs_intermediates/api.txt
-LEGACY_TEST_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/legacy.test.stubs_intermediates/removed.txt
+ANDROID_TEST_BASE_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/api.txt
+ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/removed.txt
-LEGACY_TEST_API_FILE := $(LOCAL_PATH)/api/android-test-base-current.txt
-LEGACY_TEST_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-base-removed.txt
+ANDROID_TEST_BASE_API_FILE := $(LOCAL_PATH)/api/android-test-base-current.txt
+ANDROID_TEST_BASE_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-base-removed.txt
LOCAL_DROIDDOC_OPTIONS:= \
-stubpackages android.test:android.test.suitebuilder.annotation:com.android.internal.util:junit.framework \
-stubsourceonly \
- -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/legacy.test.stubs_intermediates/src \
+ -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/src \
-nodocs \
- -api $(LEGACY_TEST_OUTPUT_API_FILE) \
- -removedApi $(LEGACY_TEST_OUTPUT_REMOVED_API_FILE) \
+ -api $(ANDROID_TEST_BASE_OUTPUT_API_FILE) \
+ -removedApi $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE) \
LOCAL_UNINSTALLABLE_MODULE := true
-LOCAL_MODULE := legacy-test-api-stubs-gen
+LOCAL_MODULE := android-test-base-api-stubs-gen
include $(BUILD_DROIDDOC)
# Remember the target that will trigger the code generation.
-legacy_test_api_gen_stamp := $(full_target)
+android_test_base_gen_stamp := $(full_target)
# Add some additional dependencies
-$(LEGACY_TEST_OUTPUT_API_FILE): $(full_target)
-$(LEGACY_TEST_OUTPUT_REMOVED_API_FILE): $(full_target)
+$(ANDROID_TEST_BASE_OUTPUT_API_FILE): $(full_target)
+$(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE): $(full_target)
-# Build the legacy.test.stubs library
-# ===================================
+# Build the android.test.base.stubs library
+# =========================================
include $(CLEAR_VARS)
-LOCAL_MODULE := legacy.test.stubs
+LOCAL_MODULE := android.test.base.stubs
LOCAL_SOURCE_FILES_ALL_GENERATED := true
LOCAL_SDK_VERSION := current
-LOCAL_ADDITIONAL_DEPENDENCIES := $(legacy_test_api_gen_stamp)
# Make sure to run droiddoc first to generate the stub source files.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(legacy_test_api_gen_stamp)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_base_gen_stamp)
+android_test_base_gen_stamp :=
include $(BUILD_STATIC_JAVA_LIBRARY)
# Archive a copy of the classes.jar in SDK build.
-$(call dist-for-goals,sdk win_sdk,$(full_classes_jar):legacy.test.stubs.jar)
+$(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.base.stubs.jar)
-# Check that the legacy.test.stubs library has not changed
-# ========================================================
+# Check that the android.test.base.stubs library has not changed
+# ==============================================================
# Check that the API we're building hasn't changed from the not-yet-released
# SDK version.
$(eval $(call check-api, \
- check-legacy-test-api-current, \
- $(LEGACY_TEST_API_FILE), \
- $(LEGACY_TEST_OUTPUT_API_FILE), \
- $(LEGACY_TEST_REMOVED_API_FILE), \
- $(LEGACY_TEST_OUTPUT_REMOVED_API_FILE), \
+ check-android-test-base-api-current, \
+ $(ANDROID_TEST_BASE_API_FILE), \
+ $(ANDROID_TEST_BASE_OUTPUT_API_FILE), \
+ $(ANDROID_TEST_BASE_REMOVED_API_FILE), \
+ $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE), \
-error 2 -error 3 -error 4 -error 5 -error 6 \
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
-error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \
-error 25 -error 26 -error 27, \
cat $(LOCAL_PATH)/api/apicheck_msg_android_test_base.txt, \
- check-legacy-test-api, \
- $(call doc-timestamp-for,legacy-test-api-stubs-gen) \
+ check-android-test-base-api, \
+ $(call doc-timestamp-for,android-test-base-api-stubs-gen) \
))
-.PHONY: check-legacy-test-api
-checkapi: check-legacy-test-api
+.PHONY: check-android-test-base-api
+checkapi: check-android-test-base-api
-.PHONY: update-legacy-test-api
-update-api: update-legacy-test-api
+.PHONY: update-android-test-base-api
+update-api: update-android-test-base-api
-update-legacy-test-api: $(LEGACY_TEST_OUTPUT_API_FILE) | $(ACP)
+update-android-test-base-api: $(ANDROID_TEST_BASE_OUTPUT_API_FILE) | $(ACP)
@echo Copying current.txt
- $(hide) $(ACP) $(LEGACY_TEST_OUTPUT_API_FILE) $(LEGACY_TEST_API_FILE)
+ $(hide) $(ACP) $(ANDROID_TEST_BASE_OUTPUT_API_FILE) $(ANDROID_TEST_BASE_API_FILE)
@echo Copying removed.txt
- $(hide) $(ACP) $(LEGACY_TEST_OUTPUT_REMOVED_API_FILE) $(LEGACY_TEST_REMOVED_API_FILE)
+ $(hide) $(ACP) $(ANDROID_TEST_BASE_OUTPUT_REMOVED_API_FILE) $(ANDROID_TEST_BASE_REMOVED_API_FILE)
# Build the legacy-android-test library
# =====================================
@@ -154,6 +183,17 @@
include $(BUILD_STATIC_JAVA_LIBRARY)
+# Build the legacy.test.stubs library
+# ===================================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := legacy.test.stubs
+LOCAL_SDK_VERSION := current
+
+LOCAL_STATIC_JAVA_LIBRARIES := android.test.base.stubs
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
ifeq ($(HOST_OS),linux)
# Build the legacy-performance-test-hostdex library
# =================================================
@@ -165,5 +205,3 @@
include $(BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY)
endif # HOST_OS == linux
-
-legacy_test_api_gen_stamp :=