Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 919ff226 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I8e432950,Id325b8cf

* changes:
  Build android.test.base/legacy against SDK
  Fix visibility issues with android.test.mock.stubs
parents 9a50d757 4cdec674
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -31,12 +31,8 @@ java_library {
    // Needs to be consistent with the repackaged version of this make target.
    java_version: "1.8",

    no_framework_libs: true,
    sdk_version: "current",
    hostdex: true,
    libs: [
        "framework",
    ],

}

// Build the legacy-test library
@@ -46,12 +42,9 @@ java_library {
// Also contains the com.android.internal.util.Predicate[s] classes.
java_library {
    name: "legacy-test",
    static_libs: ["android.test.base"],

    no_framework_libs: true,
    libs: [
        "framework",
    ],
    sdk_version: "current",
    static_libs: ["android.test.base"],
}

// Build the repackaged.android.test.base library
@@ -61,11 +54,8 @@ java_library {
java_library_static {
    name: "repackaged.android.test.base",

    sdk_version: "current",
    static_libs: ["android.test.base"],
    no_framework_libs: true,
    libs: [
        "framework",
    ],

    jarjar_rules: "jarjar-rules.txt",
    // Pin java_version until jarjar is certified to support later versions. http://b/72703434
+1 −4
Original line number Diff line number Diff line
@@ -26,10 +26,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
    $(call all-java-files-under, src)

LOCAL_JAVA_LIBRARIES := \
    core-oj \
    core-libart \
    framework \
LOCAL_SDK_VERSION := current

LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src
+26 −4
Original line number Diff line number Diff line
@@ -21,16 +21,38 @@ ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)))

# Build the android.test.legacy library
# =====================================
# Built against the SDK so that it can be statically included in APKs
# without breaking link type checks.
#
# This builds directly from the source rather than simply statically
# including the android.test.base-minus-junit and
# android.test.runner-minus-junit libraries because the latter library
# cannot itself be built against the SDK. That is because it uses on
# an internal method (setTestContext) on the AndroidTestCase class.
# That class is provided by both the android.test.base-minus-junit and
# the current SDK and as the latter is first on the classpath its
# version is used. Unfortunately, it does not provide the internal
# method and so compilation fails.
#
# Building from source avoids that because the compiler will use the
# source version of AndroidTestCase instead of the one from the current
# SDK.
#
# The use of the internal method does not prevent this from being
# statically included because the class that provides the method is
# also included in this library.
include $(CLEAR_VARS)

LOCAL_MODULE := android.test.legacy

LOCAL_SRC_FILES := \
    $(call all-java-files-under, ../test-base/src/android) \
    $(call all-java-files-under, ../test-base/src/com) \
    $(call all-java-files-under, ../test-runner/src/android) \

LOCAL_SDK_VERSION := current

LOCAL_JAVA_LIBRARIES := junit
LOCAL_STATIC_JAVA_LIBRARIES := \
    android.test.base-minus-junit \
    android.test.runner-minus-junit \
LOCAL_JAVA_LIBRARIES := junit android.test.mock.stubs

include $(BUILD_STATIC_JAVA_LIBRARY)

+11 −2
Original line number Diff line number Diff line
@@ -16,14 +16,19 @@

LOCAL_PATH:= $(call my-dir)

android_test_mock_source_files := $(call all-java-files-under, src/android/test/mock)
# Includes the main framework source to ensure that doclava has access to the
# visibility information for the base classes of the mock classes. Without it
# otherwise hidden methods could be visible.
android_test_mock_source_files := \
    $(call all-java-files-under, src/android/test/mock) \
    $(call all-java-files-under, ../core/java/android)

# Generate the stub source files for android.test.mock.stubs
# ==========================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(android_test_mock_source_files)

LOCAL_JAVA_LIBRARIES := core-oj core-libart framework
LOCAL_JAVA_LIBRARIES := core-oj core-libart framework conscrypt okhttp bouncycastle
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src/android/test/mock

@@ -34,6 +39,7 @@ ANDROID_TEST_MOCK_API_FILE := $(LOCAL_PATH)/api/android-test-mock-current.txt
ANDROID_TEST_MOCK_REMOVED_API_FILE := $(LOCAL_PATH)/api/android-test-mock-removed.txt

LOCAL_DROIDDOC_OPTIONS:= \
    -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
    -stubpackages android.test.mock \
    -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/src \
    -nodocs \
@@ -62,6 +68,9 @@ LOCAL_SOURCE_FILES_ALL_GENERATED := true

# Make sure to run droiddoc first to generate the stub source files.
LOCAL_ADDITIONAL_DEPENDENCIES := $(android_test_mock_gen_stamp)
android_test_mock_gen_stamp :=

LOCAL_SDK_VERSION := current

include $(BUILD_STATIC_JAVA_LIBRARY)

+0 −122

File changed.

Preview size limit exceeded, changes collapsed.

Loading