blob: cc6cb55d2577a529eae9a6ba7b39e11d2c4780e0 [file] [log] [blame]
Ying Zhenge854f9d2018-08-17 12:15:24 -07001# 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
18ifneq ($(TARGET_BUILD_PDK),true)
19
20LOCAL_PATH:= $(call my-dir)
21
22include $(CLEAR_VARS)
23
24car_user_lib_sources := $(call all-java-files-under, src)
25
26# API Check
27# ---------------------------------------------
Ying Zhenge3486ca2018-11-02 15:00:28 -070028car_user_module := android.car.userlib
Ying Zhenge854f9d2018-08-17 12:15:24 -070029car_user_module_src_files := $(car_user_lib_sources)
30car_user_module_api_dir := $(LOCAL_PATH)/api
31car_user_module_java_libraries := framework
32car_user_module_include_systemapi := true
Ying Zhenge3486ca2018-11-02 15:00:28 -070033car_user_module_java_packages := android.car.userlib*
Ying Zhenge854f9d2018-08-17 12:15:24 -070034include $(CAR_API_CHECK)
35
36# Build stubs jar for target android-support-car
37# ---------------------------------------------
38include $(CLEAR_VARS)
39
40LOCAL_SRC_FILES := $(call all-java-files-under, src)
41
Ying Zhenge3486ca2018-11-02 15:00:28 -070042LOCAL_JAVA_LIBRARIES := android.car.userlib
Ying Zhenge854f9d2018-08-17 12:15:24 -070043
Ying Zhenge3486ca2018-11-02 15:00:28 -070044LOCAL_ADDITIONAL_JAVA_DIR := $(call intermediates-dir-for,JAVA_LIBRARIES,android.car.userlib,,COMMON)/src
Ying Zhenge854f9d2018-08-17 12:15:24 -070045
Ying Zhenge3486ca2018-11-02 15:00:28 -070046android_car_userlib_stub_packages := \
47 android.car.userlib*
Ying Zhenge854f9d2018-08-17 12:15:24 -070048
Ying Zhenge3486ca2018-11-02 15:00:28 -070049android_car_userlib_api := \
50 $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android.car.userlib_api.txt
Ying Zhenge854f9d2018-08-17 12:15:24 -070051
Ying Zhenge3486ca2018-11-02 15:00:28 -070052# Note: The make target is android.car.userlib-stub-docs
53LOCAL_MODULE := android.car.userlib-stub
Ying Zhenge854f9d2018-08-17 12:15:24 -070054LOCAL_DROIDDOC_OPTIONS := \
Ying Zhenge3486ca2018-11-02 15:00:28 -070055 -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 Zhenge854f9d2018-08-17 12:15:24 -070058 -nodocs
59
60LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/java/
61LOCAL_DROIDDOC_HTML_DIR :=
62
63LOCAL_MODULE_CLASS := JAVA_LIBRARIES
64
65LOCAL_UNINSTALLABLE_MODULE := true
66
67include $(BUILD_DROIDDOC)
68
Ying Zhenge3486ca2018-11-02 15:00:28 -070069$(android_car_userlib_api): $(full_target)
Ying Zhenge854f9d2018-08-17 12:15:24 -070070
Ying Zhenge3486ca2018-11-02 15:00:28 -070071android.car.userlib-stubs_stamp := $(full_target)
Ying Zhenge854f9d2018-08-17 12:15:24 -070072
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
77include $(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 Zhenge3486ca2018-11-02 15:00:28 -070081LOCAL_MODULE := android.car.userlib-stubs
Ying Zhenge854f9d2018-08-17 12:15:24 -070082LOCAL_SOURCE_FILES_ALL_GENERATED := true
83
84# Make sure to run droiddoc first to generate the stub source files.
Ying Zhenge3486ca2018-11-02 15:00:28 -070085LOCAL_ADDITIONAL_DEPENDENCIES := $(android.car.userlib-stubs_stamp)
Ying Zhenge854f9d2018-08-17 12:15:24 -070086
87include $(BUILD_STATIC_JAVA_LIBRARY)
88
Ying Zhenge854f9d2018-08-17 12:15:24 -070089include $(call all-makefiles-under,$(LOCAL_PATH))
90
91endif #TARGET_BUILD_PDK