Home | History | Annotate | Download | only in leanback
      1 # Copyright (C) 2014 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 LOCAL_PATH:= $(call my-dir)
     16 
     17 # Build the resources using the current SDK version.
     18 # We do this here because the final static library must be compiled with an older
     19 # SDK version than the resources.  The resources library and the R class that it
     20 # contains will not be linked into the final static library.
     21 include $(CLEAR_VARS)
     22 LOCAL_MODULE := android-support-v17-leanback-res
     23 LOCAL_SDK_VERSION := current
     24 LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
     25 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
     26 LOCAL_AAPT_FLAGS := \
     27         --auto-add-overlay
     28 LOCAL_JAR_EXCLUDE_FILES := none
     29 include $(BUILD_STATIC_JAVA_LIBRARY)
     30 
     31 # -----------------------------------------------------------------------
     32 
     33 #  Base sub-library contains classes both needed by api-level specific libraries
     34 #  (e.g. KitKat) and final static library.
     35 include $(CLEAR_VARS)
     36 LOCAL_MODULE := android-support-v17-leanback-common
     37 LOCAL_SDK_VERSION := 17
     38 LOCAL_SRC_FILES := $(call all-java-files-under, common)
     39 include $(BUILD_STATIC_JAVA_LIBRARY)
     40 
     41 # -----------------------------------------------------------------------
     42 
     43 #  A helper sub-library that makes direct use of API 21.
     44 include $(CLEAR_VARS)
     45 LOCAL_MODULE := android-support-v17-leanback-api21
     46 LOCAL_SDK_VERSION := 21
     47 LOCAL_SRC_FILES := $(call all-java-files-under, api21)
     48 LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
     49 include $(BUILD_STATIC_JAVA_LIBRARY)
     50 
     51 # -----------------------------------------------------------------------
     52 
     53 #  A helper sub-library that makes direct use of KitKat APIs.
     54 include $(CLEAR_VARS)
     55 LOCAL_MODULE := android-support-v17-leanback-kitkat
     56 LOCAL_SDK_VERSION := 19
     57 LOCAL_SRC_FILES := $(call all-java-files-under, kitkat)
     58 LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
     59 include $(BUILD_STATIC_JAVA_LIBRARY)
     60 
     61 # -----------------------------------------------------------------------
     62 
     63 #  A helper sub-library that makes direct use of JBMR2 APIs.
     64 include $(CLEAR_VARS)
     65 LOCAL_MODULE := android-support-v17-leanback-jbmr2
     66 LOCAL_SDK_VERSION := 18
     67 LOCAL_SRC_FILES := $(call all-java-files-under, jbmr2)
     68 LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
     69 include $(BUILD_STATIC_JAVA_LIBRARY)
     70 
     71 # -----------------------------------------------------------------------
     72 
     73 # Here is the final static library that apps can link against.
     74 # The R class is automatically excluded from the generated library.
     75 # Applications that use this library must specify LOCAL_RESOURCE_DIR
     76 # in their makefiles to include the resources in their package.
     77 include $(CLEAR_VARS)
     78 LOCAL_MODULE := android-support-v17-leanback
     79 LOCAL_SDK_VERSION := 17
     80 LOCAL_SRC_FILES := $(call all-java-files-under, src)
     81 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v17-leanback-kitkat android-support-v17-leanback-jbmr2 \
     82         android-support-v17-leanback-api21 android-support-v17-leanback-common
     83 LOCAL_JAVA_LIBRARIES := \
     84         android-support-v4 \
     85         android-support-v7-recyclerview \
     86         android-support-v17-leanback-res
     87 include $(BUILD_STATIC_JAVA_LIBRARY)
     88 
     89 
     90 # ===========================================================
     91 # Common Droiddoc vars
     92 leanback.docs.src_files := \
     93     $(call all-java-files-under, src) \
     94     $(call all-html-files-under, src)
     95 leanback.docs.java_libraries := \
     96     framework \
     97     android-support-v4 \
     98     android-support-v7-recyclerview \
     99     android-support-v17-leanback-res \
    100     android-support-v17-leanback
    101 
    102 # Documentation
    103 # ===========================================================
    104 include $(CLEAR_VARS)
    105 
    106 LOCAL_MODULE := android-support-v17-leanback
    107 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
    108 LOCAL_MODULE_TAGS := optional
    109 
    110 intermediates.COMMON := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),android-support-v17-leanback,,COMMON)
    111 
    112 LOCAL_SRC_FILES := $(leanback.docs.src_files)
    113 LOCAL_ADDITONAL_JAVA_DIR := $(intermediates.COMMON)/src
    114 
    115 LOCAL_SDK_VERSION := 19
    116 LOCAL_IS_HOST_MODULE := false
    117 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-sdk
    118 
    119 LOCAL_JAVA_LIBRARIES := $(leanback.docs.java_libraries)
    120 
    121 LOCAL_DROIDDOC_OPTIONS := \
    122     -offlinemode \
    123     -hdf android.whichdoc offline \
    124     -federate Android http://developer.android.com \
    125     -federationapi Android prebuilts/sdk/api/17.txt \
    126     -hide 113
    127 
    128 include $(BUILD_DROIDDOC)
    129 
    130 # Stub source files
    131 # ===========================================================
    132 
    133 leanback_internal_api_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android-support-v17-leanback_api.txt
    134 leanback.docs.stubpackages := android.support.v17.leanback:android.support.v17.leanback.app:android.support.v17.leanback.database:android.support.v17.leanback.widget
    135 
    136 include $(CLEAR_VARS)
    137 
    138 LOCAL_MODULE := android-support-v17-leanback-stubs
    139 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
    140 LOCAL_MODULE_TAGS := optional
    141 
    142 LOCAL_SRC_FILES := $(leanback.docs.src_files)
    143 LOCAL_JAVA_LIBRARIES := $(leanback.docs.java_libraries)
    144 LOCAL_SDK_VERSION := current
    145 
    146 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-sdk
    147 LOCAL_UNINSTALLABLE_MODULE := true
    148 
    149 LOCAL_DROIDDOC_OPTIONS := \
    150     -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android-support-v17-leanback-stubs_intermediates/src \
    151     -stubpackages $(leanback.docs.stubpackages) \
    152     -api $(leanback_internal_api_file) \
    153     -hide 113 \
    154     -nodocs
    155 
    156 include $(BUILD_DROIDDOC)
    157 leanback_stubs_stamp := $(full_target)
    158 $(leanback_internal_api_file) : $(full_target)
    159 
    160 # Cleanup temp vars
    161 # ===========================================================
    162 leanback.docs.src_files :=
    163 leanback.docs.java_libraries :=
    164 intermediates.COMMON :=
    165 leanback_internal_api_file :=
    166 leanback_stubs_stamp :=
    167 leanback.docs.stubpackages :=
    168