1# Copyright (C) 2015 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 24LOCAL_MODULE := android.car 25LOCAL_MODULE_TAGS := optional 26 27ifneq ($(TARGET_USES_CAR_FUTURE_FEATURES),true) 28#TODO need a tool to generate proguard rule to drop all items under @FutureFeature 29#LOCAL_PROGUARD_ENABLED := custom 30#LOCAL_PROGUARD_FLAG_FILES := proguard_drop_future.flags 31endif 32 33car_lib_sources := $(call all-java-files-under, src) 34ifeq ($(TARGET_USES_CAR_FUTURE_FEATURES),true) 35car_lib_sources += $(call all-java-files-under, src_feature_future) 36else 37car_lib_sources += $(call all-java-files-under, src_feature_current) 38endif 39 40car_lib_sources += $(call all-Iaidl-files-under, src) 41 42# IoStats* are parcelable types (vs. interface types), but the build system uses an initial 43# I as a magic marker to mean "interface", and due to this ends up refusing to compile 44# these files as part of the build process. 45# A clean solution to this is actively being worked on by the build team, but is not yet 46# available, so for now we just filter the files out by hand. 47car_lib_sources := $(filter-out src/android/car/storagemonitoring/IoStats.aidl,$(car_lib_sources)) 48car_lib_sources := $(filter-out src/android/car/storagemonitoring/IoStatsEntry.aidl,$(car_lib_sources)) 49 50LOCAL_AIDL_INCLUDES += system/bt/binder 51 52LOCAL_SRC_FILES := $(car_lib_sources) 53 54ifeq ($(EMMA_INSTRUMENT_FRAMEWORK),true) 55LOCAL_EMMA_INSTRUMENT := true 56endif 57 58include $(BUILD_JAVA_LIBRARY) 59 60ifeq ($(BOARD_IS_AUTOMOTIVE), true) 61$(call dist-for-goals,dist_files,$(full_classes_jar):$(LOCAL_MODULE).jar) 62endif 63 64# API Check 65# --------------------------------------------- 66car_module := $(LOCAL_MODULE) 67car_module_src_files := $(LOCAL_SRC_FILES) 68car_module_api_dir := $(LOCAL_PATH)/api 69car_module_java_libraries := framework 70car_module_include_systemapi := true 71car_module_java_packages := android.car* 72include $(CAR_API_CHECK) 73 74# Build stubs jar for target android-support-car 75# --------------------------------------------- 76include $(CLEAR_VARS) 77 78LOCAL_SRC_FILES := $(call all-java-files-under, src) 79 80LOCAL_JAVA_LIBRARIES := android.car 81 82LOCAL_ADDITIONAL_JAVA_DIR := $(call intermediates-dir-for,JAVA_LIBRARIES,android.car,,COMMON)/src 83 84android_car_stub_packages := \ 85 android.car* 86 87android_car_api := \ 88 $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android.car_api.txt 89 90# Note: The make target is android.car-stub-docs 91LOCAL_MODULE := android.car-stub 92LOCAL_DROIDDOC_OPTIONS := \ 93 -stubs $(call intermediates-dir-for,JAVA_LIBRARIES,android.car-stubs,,COMMON)/src \ 94 -stubpackages $(subst $(space),:,$(android_car_stub_packages)) \ 95 -api $(android_car_api) \ 96 -nodocs 97 98LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/java/ 99LOCAL_DROIDDOC_HTML_DIR := 100 101LOCAL_MODULE_CLASS := JAVA_LIBRARIES 102 103LOCAL_UNINSTALLABLE_MODULE := true 104 105include $(BUILD_DROIDDOC) 106 107$(android_car_api): $(full_target) 108 109android.car-stubs_stamp := $(full_target) 110 111############################################### 112# Build the stubs java files into a jar. This build rule relies on the 113# stubs_stamp make variable being set from the droiddoc rule. 114 115include $(CLEAR_VARS) 116 117# CAR_API_CHECK uses the same name to generate a module, but BUILD_DROIDDOC 118# appends "-docs" to module name. 119LOCAL_MODULE := android.car-stubs 120LOCAL_SOURCE_FILES_ALL_GENERATED := true 121 122# Make sure to run droiddoc first to generate the stub source files. 123LOCAL_ADDITIONAL_DEPENDENCIES := $(android.car-stubs_stamp) 124 125include $(BUILD_STATIC_JAVA_LIBRARY) 126 127android.car-stubs_stamp := 128android_car_stub_packages := 129android_car_api := 130 131include $(call all-makefiles-under,$(LOCAL_PATH)) 132 133endif #TARGET_BUILD_PDK 134