blob: 3cb7d82f9644920708384d5c16e7d9baf45cd158 [file] [log] [blame]
keunyoung1ab8e182015-09-24 09:25:22 -07001# 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
Keun-young Parkec7b18f2016-02-29 16:49:53 -080017#disble build in PDK, missing aidl import breaks build
18ifneq ($(TARGET_BUILD_PDK),true)
19
keunyoung1ab8e182015-09-24 09:25:22 -070020LOCAL_PATH:= $(call my-dir)
21
22include $(CLEAR_VARS)
23
Keun-young Parke54ac272016-02-16 19:02:18 -080024LOCAL_MODULE := android.car
keunyoung1ab8e182015-09-24 09:25:22 -070025LOCAL_MODULE_TAGS := optional
26
Keun-young Park161f69e2017-01-27 16:13:00 -080027ifneq ($(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
Antonio Cortesc52d5f92017-02-06 08:47:38 -080033car_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
Enrico Granatadbda56f2017-12-18 11:53:22 -080039
Antonio Cortesc52d5f92017-02-06 08:47:38 -080040car_lib_sources += $(call all-Iaidl-files-under, src)
Enrico Granatadbda56f2017-12-18 11:53:22 -080041
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
Jakub Pawlowskib4dc2152017-08-08 07:48:36 -070050LOCAL_AIDL_INCLUDES += system/bt/binder
Antonio Cortesc52d5f92017-02-06 08:47:38 -080051
52LOCAL_SRC_FILES := $(car_lib_sources)
keunyoung1ab8e182015-09-24 09:25:22 -070053
Allen Haire315d2e2016-09-13 14:18:23 -070054ifeq ($(EMMA_INSTRUMENT_FRAMEWORK),true)
55LOCAL_EMMA_INSTRUMENT := true
56endif
57
Keun-young Parke54ac272016-02-16 19:02:18 -080058include $(BUILD_JAVA_LIBRARY)
Keun-young Parkec7b18f2016-02-29 16:49:53 -080059
Vitalii Tomkiv9aef1ae2016-03-30 13:05:59 -070060ifeq ($(BOARD_IS_AUTOMOTIVE), true)
Dean Harding62950b12018-02-15 10:56:27 -080061$(call dist-for-goals,dist_files,$(full_classes_jar):$(LOCAL_MODULE).jar)
Vitalii Tomkiv9aef1ae2016-03-30 13:05:59 -070062endif
63
Vitalii Tomkiv280b5722016-03-17 16:17:21 -070064# 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
Yao, Yuxing5c71c0d2018-02-06 10:12:29 -080074# 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
Steve Paikb40de192018-03-01 18:07:38 -0800131include $(call all-makefiles-under,$(LOCAL_PATH))
132
Anthony Chen7bd39e92018-04-02 13:13:53 -0700133endif #TARGET_BUILD_PDK