diff options
author | Sundong Ahn <sundongahn@google.com> | 2018-07-31 16:54:41 +0900 |
---|---|---|
committer | Sundong Ahn <sundongahn@google.com> | 2018-08-29 12:22:59 +0900 |
commit | e933cedf837d39a713ef44cadfb07f2c1d863652 (patch) | |
tree | 9b32fba18cacc61fb6d7b6145a73183a9e50f2ba /test-base | |
parent | c96760f4f30279bdddcbdc83398bc069740970f1 (diff) | |
download | base-e933cedf837d39a713ef44cadfb07f2c1d863652.tar.gz |
Build android.test.* with java_sdk_library
android.test.* are built with java_sdk_library and api files are added
by running "make update-api".
android.test.base_static is created for allowing to use
android.test.base as a static library.
Bug:77577799
Test: make -j
Test: make checkapi
Test: make checkapi fails with a random change in the txt file
Test: adb shell cmd package list libraries |\
grep android.test.*
And check the android.test.* libraries
Merged-In: Ia27612657532e50b077a9c55dbef59ee3ec04b8a
Change-Id: Ia27612657532e50b077a9c55dbef59ee3ec04b8a
Diffstat (limited to 'test-base')
-rw-r--r-- | test-base/Android.bp | 71 | ||||
-rw-r--r-- | test-base/Android.mk | 44 | ||||
-rw-r--r-- | test-base/api/apicheck_msg_android_test_base.txt | 17 | ||||
-rw-r--r-- | test-base/api/current.txt (renamed from test-base/api/android-test-base-current.txt) | 0 | ||||
-rw-r--r-- | test-base/api/removed.txt (renamed from test-base/api/android-test-base-removed.txt) | 0 | ||||
-rw-r--r-- | test-base/api/system-current.txt | 0 | ||||
-rw-r--r-- | test-base/api/system-removed.txt | 0 | ||||
-rw-r--r-- | test-base/api/test-current.txt | 0 | ||||
-rw-r--r-- | test-base/api/test-removed.txt | 0 |
9 files changed, 31 insertions, 101 deletions
diff --git a/test-base/Android.bp b/test-base/Android.bp index d25b47727c0b..0b8a02a815d9 100644 --- a/test-base/Android.bp +++ b/test-base/Android.bp @@ -19,9 +19,8 @@ // 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. -java_library { +java_sdk_library { name: "android.test.base", - installable: true, srcs: ["src/**/*.java"], @@ -29,11 +28,38 @@ java_library { javacflags: ["-Xep:DepAnn:ERROR"], }, + hostdex: true, + + api_packages: [ + "android.test", + "android.test.suitebuilder.annotation", + "com.android.internal.util", + "junit.framework", + ], + + droiddoc_options: ["stubsourceonly"], + compile_dex: true, +} + +// Build the android.test.base_static library +// ========================================== +// This is only intended for inclusion in the android.test.runner-minus-junit, +// robolectric_android-all-stub and repackaged.android.test.* libraries. +// Must not be used elewhere. +java_library_static { + name: "android.test.base_static", + installable: false, + + srcs: ["src/**/*.java"], + + errorprone: { + javacflags: ["-Xep:DepAnn:ERROR"], + }, + // Needs to be consistent with the repackaged version of this make target. java_version: "1.8", sdk_version: "current", - hostdex: true, } // Build the legacy-test library @@ -46,7 +72,7 @@ java_library { installable: true, sdk_version: "current", - static_libs: ["android.test.base"], + static_libs: ["android.test.base_static"], } // Build the repackaged.android.test.base library @@ -57,7 +83,7 @@ java_library_static { name: "repackaged.android.test.base", sdk_version: "current", - static_libs: ["android.test.base"], + static_libs: ["android.test.base_static"], jarjar_rules: "jarjar-rules.txt", // Pin java_version until jarjar is certified to support later versions. http://b/72703434 @@ -84,38 +110,3 @@ java_library_static { ], } -droiddoc { - name: "android-test-base-api-stubs-gen-docs", - srcs: [ - "src/**/*.java", - ], - custom_template: "droiddoc-templates-sdk", - installable: false, - args: "-stubpackages android.test:" + - "android.test.suitebuilder.annotation:" + - "com.android.internal.util:" + - "junit.framework -stubsourceonly -nodocs", - sdk_version: "current", - api_tag_name: "ANDROID_TEST_BASE", - api_filename: "android-test-base-api.txt", - removed_api_filename: "android-test-base-removed.txt", -} - -// Build the android.test.base.stubs library -// ========================================= -java_library_static { - name: "android.test.base.stubs", - srcs: [ - ":android-test-base-api-stubs-gen-docs", - ], - product_variables: { - pdk: { - enabled: false, - }, - unbundled_build: { - enabled: false, - }, - }, - sdk_version: "current", - compile_dex: true, -} diff --git a/test-base/Android.mk b/test-base/Android.mk index baf5726ff8bd..a9d30cf3131a 100644 --- a/test-base/Android.mk +++ b/test-base/Android.mk @@ -16,50 +16,6 @@ LOCAL_PATH:= $(call my-dir) -# For unbundled build we'll use the prebuilt jar from prebuilts/sdk. -ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) - -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 - -full_classes_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,android.test.base.stubs,,COMMON)/classes.jar -# Archive a copy of the classes.jar in SDK build. -$(call dist-for-goals,sdk win_sdk,$(full_classes_jar):android.test.base.stubs.jar) - -# 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-android-test-base-api-current, \ - $(ANDROID_TEST_BASE_API_FILE), \ - $(INTERNAL_PLATFORM_ANDROID_TEST_BASE_API_FILE), \ - $(ANDROID_TEST_BASE_REMOVED_API_FILE), \ - $(INTERNAL_PLATFORM_ANDROID_TEST_BASE_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-android-test-base-api, \ - $(OUT_DOCS)/android-test-base-api-stubs-gen-docs-stubs.srcjar \ - )) - -.PHONY: check-android-test-base-api -checkapi: check-android-test-base-api - -.PHONY: update-android-test-base-api -update-api: update-android-test-base-api - -update-android-test-base-api: $(INTERNAL_PLATFORM_ANDROID_TEST_BASE_API_FILE) | $(ACP) - @echo Copying current.txt - $(hide) $(ACP) $(INTERNAL_PLATFORM_ANDROID_TEST_BASE_API_FILE) $(ANDROID_TEST_BASE_API_FILE) - @echo Copying removed.txt - $(hide) $(ACP) $(INTERNAL_PLATFORM_ANDROID_TEST_BASE_REMOVED_API_FILE) $(ANDROID_TEST_BASE_REMOVED_API_FILE) - -endif # not TARGET_BUILD_APPS not TARGET_BUILD_PDK=true - ifeq ($(HOST_OS),linux) # Build the legacy-performance-test-hostdex library # ================================================= diff --git a/test-base/api/apicheck_msg_android_test_base.txt b/test-base/api/apicheck_msg_android_test_base.txt deleted file mode 100644 index 144aecc21bce..000000000000 --- a/test-base/api/apicheck_msg_android_test_base.txt +++ /dev/null @@ -1,17 +0,0 @@ - -****************************** -You have tried to change the API from what has been previously approved. - -To make these errors go away, you have two choices: - 1) You can add "@hide" javadoc comments to the methods, etc. listed in the - errors above. - - 2) You can update android-test-base-current.txt by executing the following command: - make update-android-test-base-api - - To submit the revised android-test-base-current.txt to the main Android repository, - you will need approval. -****************************** - - - diff --git a/test-base/api/android-test-base-current.txt b/test-base/api/current.txt index 7ebd6aa8a4a2..7ebd6aa8a4a2 100644 --- a/test-base/api/android-test-base-current.txt +++ b/test-base/api/current.txt diff --git a/test-base/api/android-test-base-removed.txt b/test-base/api/removed.txt index e69de29bb2d1..e69de29bb2d1 100644 --- a/test-base/api/android-test-base-removed.txt +++ b/test-base/api/removed.txt diff --git a/test-base/api/system-current.txt b/test-base/api/system-current.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test-base/api/system-current.txt diff --git a/test-base/api/system-removed.txt b/test-base/api/system-removed.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test-base/api/system-removed.txt diff --git a/test-base/api/test-current.txt b/test-base/api/test-current.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test-base/api/test-current.txt diff --git a/test-base/api/test-removed.txt b/test-base/api/test-removed.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/test-base/api/test-removed.txt |