summaryrefslogtreecommitdiff
path: root/nfc-extras
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2018-02-22 16:04:02 +0900
committerJiyong Park <jiyong@google.com>2018-04-27 12:39:45 +0900
commit863f353865d610df25b38a9073fa9eb348b8490e (patch)
tree7dd61cba852d502ee5c0057e36ab98ca08ec0e77 /nfc-extras
parent8e386b7132895cb286a1d9548c630f86189197b8 (diff)
Fix link-type check warning on com.android.nfc_extras
The library has been built without SDK, and is used by an app NfcExtrasTests that is built with SDK. Such this SDK -> non-SDK dependency has been causing link-type check warnings, which will turn into errors soon. This change fixes the warning by making a stub library com.android.nfc_extras.stubs from the runtime library and let the app to link against the stub library. Since the stubs library does not use any private APIs, it is built with SDK. Bug: 69899800 Test: m -j NfcExtrasTests is successful and does not show any link-type check warning. Merged-In: I57980ccbc9036d7cc6df114a975a384d10a2962b Change-Id: I57980ccbc9036d7cc6df114a975a384d10a2962b (cherry picked from commit ded4fd729b50d5298e77199194996d22d3b573cf)
Diffstat (limited to 'nfc-extras')
-rw-r--r--nfc-extras/Android.mk30
-rw-r--r--nfc-extras/tests/Android.mk7
2 files changed, 29 insertions, 8 deletions
diff --git a/nfc-extras/Android.mk b/nfc-extras/Android.mk
index dc45a50968f6..03de00cc5d41 100644
--- a/nfc-extras/Android.mk
+++ b/nfc-extras/Android.mk
@@ -1,13 +1,33 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-
+LOCAL_MODULE := com.android.nfc_extras
LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := $(call all-java-files-under,java)
+include $(BUILD_JAVA_LIBRARY)
-LOCAL_SRC_FILES := $(call all-java-files-under, java)
-
-LOCAL_MODULE:= com.android.nfc_extras
+include $(CLEAR_VARS)
+LOCAL_MODULE := com.android.nfc_extras-stubs-gen
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+LOCAL_SRC_FILES := $(call all-java-files-under,java)
+# This is to reference SdkConstant annotation; not part of this lib.
+LOCAL_DROIDDOC_SOURCE_PATH := frameworks/base/core/java/android/annotation
+LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/com.android.nfc_extras.stubs_intermediates/src
+LOCAL_DROIDDOC_OPTIONS:= \
+ -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
+ -stubpackages com.android.nfc_extras \
+ -nodocs
+LOCAL_UNINSTALLABLE_MODULE := true
+include $(BUILD_DROIDDOC)
+com_android_nfc_extras_gen_stamp := $(full_target)
-include $(BUILD_JAVA_LIBRARY)
+include $(CLEAR_VARS)
+LOCAL_MODULE := com.android.nfc_extras.stubs
+# This is to reference SdkConstant annotation; not part of this lib.
+LOCAL_SRC_FILES := ../core/java/android/annotation/SdkConstant.java
+LOCAL_SDK_VERSION := current
+LOCAL_ADDITIONAL_DEPENDENCIES := $(com_android_nfc_extras_gen_stamp)
+com_android_nfc_extras_gen_stamp :=
+include $(BUILD_STATIC_JAVA_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/nfc-extras/tests/Android.mk b/nfc-extras/tests/Android.mk
index d8fe5a6cca30..8bba3ba99974 100644
--- a/nfc-extras/tests/Android.mk
+++ b/nfc-extras/tests/Android.mk
@@ -19,10 +19,11 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_JAVA_LIBRARIES := \
- android.test.runner \
- com.android.nfc_extras
+ android.test.runner.stubs \
+ com.android.nfc_extras.stubs \
+ android.test.base.stubs
-LOCAL_STATIC_JAVA_LIBRARIES := junit legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := junit
# Include all test java files.
LOCAL_SRC_FILES := $(call all-java-files-under, src)