Home | History | Annotate | Download | only in car-support-lib
      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, should add prebuilts/fullsdk to make this work
     18 ifneq ($(TARGET_BUILD_PDK),true)
     19 
     20 LOCAL_PATH:= $(call my-dir)
     21 
     22 # Build prebuilt android.support.car library
     23 # ---------------------------------------------
     24 include $(CLEAR_VARS)
     25 
     26 LOCAL_AAPT_FLAGS := --auto-add-overlay
     27 LOCAL_MODULE := android.support.car-prebuilt
     28 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
     29 
     30 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
     31 
     32 # Build against the current public APIs of the SDK
     33 LOCAL_SDK_VERSION := current
     34 
     35 LOCAL_MANIFEST_FILE := AndroidManifest.xml
     36 
     37 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src)
     38 LOCAL_JAVA_LIBRARIES += android.car\
     39                         android-support-annotations
     40 # Specify 1.7 for backwards compatibility.
     41 # Otherwise the lib won't be usable on pre-N devices
     42 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     43 
     44 LOCAL_PROGUARD_ENABLED := custom optimization obfuscation
     45 LOCAL_PROGUARD_FLAGS := -dontwarn
     46 LOCAL_PROGUARD_FLAG_FILES := proguard-release.flags proguard-extra-keeps.flags
     47 
     48 include $(BUILD_STATIC_JAVA_LIBRARY)
     49 
     50 ifeq ($(BOARD_IS_AUTOMOTIVE), true)
     51     $(call dist-for-goals, dist_files, $(built_aar):android.support.car.aar)
     52 endif
     53 
     54 # Same as above, except without proguard.
     55 # ---------------------------------------------
     56 include $(CLEAR_VARS)
     57 
     58 LOCAL_AAPT_FLAGS := --auto-add-overlay
     59 LOCAL_MODULE := android.support.car-1p-prebuilt
     60 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
     61 
     62 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
     63 
     64 # Build against the current public APIs of the SDK
     65 LOCAL_SDK_VERSION := current
     66 
     67 LOCAL_MANIFEST_FILE := AndroidManifest.xml
     68 
     69 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src)
     70 LOCAL_JAVA_LIBRARIES += android.car\
     71                         android-support-annotations
     72 # Specify 1.7 for backwards compatibility.
     73 # Otherwise the lib won't be usable on pre-N devices
     74 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     75 
     76 LOCAL_PROGUARD_ENABLED := disabled
     77 include $(BUILD_STATIC_JAVA_LIBRARY)
     78 
     79 ifeq ($(BOARD_IS_AUTOMOTIVE), true)
     80     $(call dist-for-goals, dist_files, $(built_aar):android.support.car-1p.aar)
     81 endif
     82 
     83 # Build support library.
     84 # ---------------------------------------------
     85 include $(CLEAR_VARS)
     86 
     87 LOCAL_MODULE := android.support.car
     88 LOCAL_SDK_VERSION := current
     89 
     90 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src)
     91 
     92 LOCAL_STATIC_JAVA_LIBRARIES += android-support-annotations
     93 
     94 LOCAL_JAVA_LIBRARIES += android.car
     95 
     96 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     97 include $(BUILD_STATIC_JAVA_LIBRARY)
     98 
     99 # API Check
    100 # ---------------------------------------------
    101 car_module := $(LOCAL_MODULE)
    102 car_module_src_files := $(LOCAL_SRC_FILES)
    103 car_module_proguard_file := $(LOCAL_PATH)/proguard-release.flags
    104 car_module_api_dir := $(LOCAL_PATH)/api
    105 car_module_java_libraries := $(LOCAL_JAVA_LIBRARIES) $(LOCAL_STATIC_JAVA_LIBRARIES) framework
    106 car_module_java_packages := android.support.car*
    107 car_module_include_proguard := true
    108 include $(CAR_API_CHECK)
    109 
    110 
    111 # Generate offline docs
    112 #---------------------------------------------
    113 include $(CLEAR_VARS)
    114 
    115 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src)
    116 
    117 LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src
    118 
    119 LOCAL_JAVA_LIBRARIES := \
    120     android.car \
    121     android-support-annotations
    122 
    123 LOCAL_MODULE := android.support.car
    124 LOCAL_MODULE_TAGS := optional
    125 
    126 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
    127 LOCAL_IS_HOST_MODULE := false
    128 
    129 LOCAL_ADDITIONAL_JAVA_DIR := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),android.support.car,,COMMON)
    130 
    131 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := external/doclava/res/assets/templates-sdk
    132 
    133 include $(BUILD_DROIDDOC)
    134 
    135 
    136 endif #TARGET_BUILD_PDK
    137