1LOCAL_PATH:= $(call my-dir)
2
3# --------------------------------------------------------------
4# Use prebuilt aprotoc to compile .proto files
5
6ifeq ($(HOST_OS),darwin)
7PROTOC := $(TOPDIR)prebuilts/misc/darwin-x86/protobuf/aprotoc
8else
9PROTOC := $(TOPDIR)prebuilts/misc/linux-x86/protobuf/aprotoc
10endif
11
12# --------------------------------------------------------------
13# Build the apk. This generates an standalone apk for USB tuner
14# input service.
15include $(CLEAR_VARS)
16
17LOCAL_PACKAGE_NAME := UsbTunerTvInput
18LOCAL_MODULE_TAGS := optional
19# It's not required but keep it for a compatibility with the previous version.
20LOCAL_PRIVILEGED_MODULE := true
21LOCAL_SDK_VERSION := system_current
22LOCAL_MIN_SDK_VERSION := 23  # M
23
24LOCAL_STATIC_JAVA_LIBRARIES := \
25    lib-exoplayer \
26    usbtuner-tvinput
27
28LOCAL_RESOURCE_DIR := \
29    $(LOCAL_PATH)/res \
30    $(LOCAL_PATH)/../common/res \
31    $(TOP)/prebuilts/sdk/current/support/v7/recyclerview/res \
32    $(TOP)/prebuilts/sdk/current/support/v17/leanback/res
33
34LOCAL_AAPT_FLAGS := --auto-add-overlay \
35    --extra-packages android.support.v7.recyclerview \
36    --extra-packages android.support.v17.leanback \
37    --extra-packages com.android.tv.common
38
39LOCAL_JNI_SHARED_LIBRARIES := \
40    libusbtuner_jni
41
42LOCAL_PROGUARD_ENABLED := disabled
43
44include $(BUILD_PACKAGE)
45
46# --------------------------------------------------------------
47# The final static library that apps can link against.
48# The R class is automatically excluded from the generated library.
49# Applications that use this library must specify LOCAL_RESOURCE_DIR
50# in their makefiles to include the resources in their package.
51
52include $(CLEAR_VARS)
53
54LOCAL_MODULE := usbtuner-tvinput
55LOCAL_MODULE_TAGS := optional
56LOCAL_SRC_FILES := \
57    $(call all-java-files-under, src) \
58    $(call all-proto-files-under, proto)
59LOCAL_SDK_VERSION := system_current
60LOCAL_STATIC_JAVA_LIBRARIES := \
61    android-support-v4 \
62    android-support-v7-recyclerview \
63    android-support-v17-leanback \
64    icu4j-usbtuner \
65    lib-exoplayer \
66    libprotobuf-java-nano \
67    tv-common
68
69
70LOCAL_PROGUARD_ENABLED := disabled
71
72LOCAL_RESOURCE_DIR := \
73    $(LOCAL_PATH)/res \
74    $(LOCAL_PATH)/../common/res \
75    $(TOP)/prebuilts/sdk/current/support/v7/recyclerview/res \
76    $(TOP)/prebuilts/sdk/current/support/v17/leanback/res
77
78LOCAL_AAPT_FLAGS := --auto-add-overlay \
79    --extra-packages android.support.v17.leanback \
80    --extra-packages com.android.tv.common \
81
82LOCAL_PROTOC_OPTIMIZE_TYPE := nano
83LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/proto/
84
85include $(BUILD_STATIC_JAVA_LIBRARY)
86
87# --------------------------------------------------------------
88# Build a tiny icu4j library out of the classes necessary for the project.
89
90include $(CLEAR_VARS)
91
92LOCAL_MODULE := icu4j-usbtuner
93LOCAL_MODULE_TAGS := optional
94icu4j_path := icu/icu4j
95LOCAL_SRC_FILES := \
96    $(icu4j_path)/main/classes/core/src/com/ibm/icu/text/SCSU.java \
97    $(icu4j_path)/main/classes/core/src/com/ibm/icu/text/UnicodeDecompressor.java
98LOCAL_SDK_VERSION := system_current
99
100include $(BUILD_STATIC_JAVA_LIBRARY)
101#############################################################
102# Pre-built dependency jars
103#############################################################
104
105# --------------------------------------------------------------
106# ExoPlayer library version 1.5.6
107# https://github.com/google/ExoPlayer/archive/r1.5.6.zip
108# TODO: Add ExoPlayer source code to external/ android repository.
109
110include $(CLEAR_VARS)
111
112LOCAL_MODULE_TAGS := optional
113
114LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
115   lib-exoplayer:libs/exoplayer_1.5.6.jar
116
117include $(BUILD_MULTI_PREBUILT)
118
119include $(call all-makefiles-under, $(LOCAL_PATH))
120