1#
2# Copyright (C) 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH:= $(call my-dir)
18
19include $(CLEAR_VARS)
20
21
22LOCAL_MODULE_TAGS := optional
23
24include $(LOCAL_PATH)/version.mk
25
26LOCAL_SRC_FILES := $(call all-java-files-under, src)
27
28LOCAL_PACKAGE_NAME := LiveTv
29
30# It is required for com.android.providers.tv.permission.ALL_EPG_DATA
31LOCAL_PRIVILEGED_MODULE := true
32
33LOCAL_SDK_VERSION := system_current
34LOCAL_MIN_SDK_VERSION := 23  # M
35
36LOCAL_USE_AAPT2 := true
37
38LOCAL_RESOURCE_DIR := \
39    $(LOCAL_PATH)/res \
40
41LOCAL_STATIC_JAVA_LIBRARIES := \
42    android-support-annotations \
43    lib-exoplayer \
44    lib-exoplayer-v2-core \
45    jsr330 \
46
47LOCAL_STATIC_ANDROID_LIBRARIES := \
48    android-support-compat \
49    android-support-core-ui \
50    android-support-tv-provider \
51    android-support-v4 \
52    android-support-v7-appcompat \
53    android-support-v7-palette \
54    android-support-v7-preference \
55    android-support-v7-recyclerview \
56    android-support-v14-preference \
57    android-support-v17-leanback \
58    android-support-v17-preference-leanback \
59    live-channels-partner-support \
60    live-tv-tuner \
61    tv-common \
62
63
64LOCAL_JAVACFLAGS := -Xlint:deprecation -Xlint:unchecked
65
66LOCAL_AAPT_FLAGS += \
67    --version-name "$(version_name_package)" \
68    --version-code $(version_code_package) \
69
70LOCAL_JNI_SHARED_LIBRARIES := libtunertvinput_jni
71LOCAL_AAPT_FLAGS += --extra-packages com.android.tv.tuner
72
73include $(BUILD_PACKAGE)
74
75#############################################################
76# Pre-built dependency jars
77#############################################################
78prebuilts := \
79    lib-exoplayer:libs/exoplayer-r1.5.16.aar \
80    lib-exoplayer-v2-core:libs/exoplayer-core-2-SNAPHOT-20180114.aar \
81    auto-value-jar:../../../prebuilts/tools/common/m2/repository/com/google/auto/value/auto-value/1.5.2/auto-value-1.5.2.jar \
82    javax-annotations-jar:../../../prebuilts/tools/common/m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar \
83    truth-0-36-prebuilt-jar:../../../prebuilts/tools/common/m2/repository/com/google/truth/truth/0.36/truth-0.36.jar \
84
85define define-prebuilt
86  $(eval tw := $(subst :, ,$(strip $(1)))) \
87  $(eval include $(CLEAR_VARS)) \
88  $(eval LOCAL_MODULE := $(word 1,$(tw))) \
89  $(eval LOCAL_MODULE_TAGS := optional) \
90  $(eval LOCAL_MODULE_CLASS := JAVA_LIBRARIES) \
91  $(eval LOCAL_SRC_FILES := $(word 2,$(tw))) \
92  $(eval LOCAL_UNINSTALLABLE_MODULE := true) \
93  $(eval LOCAL_SDK_VERSION := current) \
94  $(eval include $(BUILD_PREBUILT))
95endef
96
97$(foreach p,$(prebuilts),\
98  $(call define-prebuilt,$(p)))
99
100prebuilts :=
101
102include $(call all-makefiles-under,$(LOCAL_PATH))
103