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 18 ifneq ($(TARGET_BUILD_PDK),true) 19 20 LOCAL_PATH:= $(call my-dir) 21 22 include $(CLEAR_VARS) 23 24 LOCAL_MODULE := android.car 25 LOCAL_MODULE_TAGS := optional 26 27 ifneq ($(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 31 endif 32 33 car_lib_sources := $(call all-java-files-under, src) 34 ifeq ($(TARGET_USES_CAR_FUTURE_FEATURES),true) 35 car_lib_sources += $(call all-java-files-under, src_feature_future) 36 else 37 car_lib_sources += $(call all-java-files-under, src_feature_current) 38 endif 39 40 car_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. 47 car_lib_sources := $(filter-out src/android/car/storagemonitoring/IoStats.aidl,$(car_lib_sources)) 48 car_lib_sources := $(filter-out src/android/car/storagemonitoring/IoStatsEntry.aidl,$(car_lib_sources)) 49 50 LOCAL_AIDL_INCLUDES += system/bt/binder 51 52 LOCAL_SRC_FILES := $(car_lib_sources) 53 54 ifeq ($(EMMA_INSTRUMENT_FRAMEWORK),true) 55 LOCAL_EMMA_INSTRUMENT := true 56 endif 57 58 include $(BUILD_JAVA_LIBRARY) 59 60 ifeq ($(BOARD_IS_AUTOMOTIVE), true) 61 $(call dist-for-goals,dist_files,$(full_classes_jar):$(LOCAL_MODULE).jar) 62 endif 63 64 # API Check 65 # --------------------------------------------- 66 car_module := $(LOCAL_MODULE) 67 car_module_src_files := $(LOCAL_SRC_FILES) 68 car_module_api_dir := $(LOCAL_PATH)/api 69 car_module_java_libraries := framework 70 car_module_include_systemapi := true 71 car_module_java_packages := android.car* 72 include $(CAR_API_CHECK) 73 74 # Build stubs jar for target android-support-car 75 # --------------------------------------------- 76 include $(CLEAR_VARS) 77 78 LOCAL_SRC_FILES := $(call all-java-files-under, src) 79 80 LOCAL_JAVA_LIBRARIES := android.car 81 82 LOCAL_ADDITIONAL_JAVA_DIR := $(call intermediates-dir-for,JAVA_LIBRARIES,android.car,,COMMON)/src 83 84 android_car_stub_packages := \ 85 android.car* 86 87 android_car_api := \ 88 $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android.car_api.txt 89 90 # Note: The make target is android.car-stub-docs 91 LOCAL_MODULE := android.car-stub 92 LOCAL_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 98 LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/java/ 99 LOCAL_DROIDDOC_HTML_DIR := 100 101 LOCAL_MODULE_CLASS := JAVA_LIBRARIES 102 103 LOCAL_UNINSTALLABLE_MODULE := true 104 105 include $(BUILD_DROIDDOC) 106 107 $(android_car_api): $(full_target) 108 109 android.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 115 include $(CLEAR_VARS) 116 117 # CAR_API_CHECK uses the same name to generate a module, but BUILD_DROIDDOC 118 # appends "-docs" to module name. 119 LOCAL_MODULE := android.car-stubs 120 LOCAL_SOURCE_FILES_ALL_GENERATED := true 121 122 # Make sure to run droiddoc first to generate the stub source files. 123 LOCAL_ADDITIONAL_DEPENDENCIES := $(android.car-stubs_stamp) 124 125 include $(BUILD_STATIC_JAVA_LIBRARY) 126 127 android.car-stubs_stamp := 128 android_car_stub_packages := 129 android_car_api := 130 131 include $(call all-makefiles-under,$(LOCAL_PATH)) 132 133 endif #TARGET_BUILD_PDK 134