Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 1 | # Copyright (C) 2018 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # |
| 15 | # |
| 16 | |
| 17 | #disble build in PDK, missing aidl import breaks build |
| 18 | ifneq ($(TARGET_BUILD_PDK),true) |
| 19 | |
| 20 | LOCAL_PATH:= $(call my-dir) |
| 21 | |
| 22 | include $(CLEAR_VARS) |
| 23 | |
| 24 | car_user_lib_sources := $(call all-java-files-under, src) |
| 25 | |
| 26 | # API Check |
| 27 | # --------------------------------------------- |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 28 | car_user_module := android.car.userlib |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 29 | car_user_module_src_files := $(car_user_lib_sources) |
| 30 | car_user_module_api_dir := $(LOCAL_PATH)/api |
| 31 | car_user_module_java_libraries := framework |
| 32 | car_user_module_include_systemapi := true |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 33 | car_user_module_java_packages := android.car.userlib* |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 34 | include $(CAR_API_CHECK) |
| 35 | |
| 36 | # Build stubs jar for target android-support-car |
| 37 | # --------------------------------------------- |
| 38 | include $(CLEAR_VARS) |
| 39 | |
| 40 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
| 41 | |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 42 | LOCAL_JAVA_LIBRARIES := android.car.userlib |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 43 | |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 44 | LOCAL_ADDITIONAL_JAVA_DIR := $(call intermediates-dir-for,JAVA_LIBRARIES,android.car.userlib,,COMMON)/src |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 45 | |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 46 | android_car_userlib_stub_packages := \ |
| 47 | android.car.userlib* |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 48 | |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 49 | android_car_userlib_api := \ |
| 50 | $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android.car.userlib_api.txt |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 51 | |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 52 | # Note: The make target is android.car.userlib-stub-docs |
| 53 | LOCAL_MODULE := android.car.userlib-stub |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 54 | LOCAL_DROIDDOC_OPTIONS := \ |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 55 | -stubs $(call intermediates-dir-for,JAVA_LIBRARIES,android.car.userlib-stubs,,COMMON)/src \ |
| 56 | -stubpackages $(subst $(space),:,$(android_car_userlib_stub_packages)) \ |
| 57 | -api $(android_car_userlib_api) \ |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 58 | -nodocs |
| 59 | |
| 60 | LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/java/ |
| 61 | LOCAL_DROIDDOC_HTML_DIR := |
| 62 | |
| 63 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 64 | |
| 65 | LOCAL_UNINSTALLABLE_MODULE := true |
| 66 | |
| 67 | include $(BUILD_DROIDDOC) |
| 68 | |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 69 | $(android_car_userlib_api): $(full_target) |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 70 | |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 71 | android.car.userlib-stubs_stamp := $(full_target) |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 72 | |
| 73 | ############################################### |
| 74 | # Build the stubs java files into a jar. This build rule relies on the |
| 75 | # stubs_stamp make variable being set from the droiddoc rule. |
| 76 | |
| 77 | include $(CLEAR_VARS) |
| 78 | |
| 79 | # CAR_API_CHECK uses the same name to generate a module, but BUILD_DROIDDOC |
| 80 | # appends "-docs" to module name. |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 81 | LOCAL_MODULE := android.car.userlib-stubs |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 82 | LOCAL_SOURCE_FILES_ALL_GENERATED := true |
| 83 | |
| 84 | # Make sure to run droiddoc first to generate the stub source files. |
Ying Zheng | e3486ca | 2018-11-02 15:00:28 -0700 | [diff] [blame] | 85 | LOCAL_ADDITIONAL_DEPENDENCIES := $(android.car.userlib-stubs_stamp) |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 86 | |
| 87 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 88 | |
Ying Zheng | e854f9d | 2018-08-17 12:15:24 -0700 | [diff] [blame] | 89 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
| 90 | |
| 91 | endif #TARGET_BUILD_PDK |