1# Copyright (C) 2012 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
15LOCAL_PATH := $(call my-dir)
16
17
18# Build libphotoviewer linking non-statically against the libraries it needs.
19# This is to allow the library to be loaded dynamically in a context where
20# the required libraries already exist. You should only use this library
21# if you're certain that you need it; see go/extradex-design for more context.
22appcompat_res_dirs := appcompat/res res ../../../$(SUPPORT_LIBRARY_ROOT)/v7/appcompat/res ../../../$(SUPPORT_LIBRARY_ROOT)/compat/res
23
24include $(CLEAR_VARS)
25LOCAL_MODULE := libphotoviewer_appcompat_dynamic
26
27LOCAL_JAVA_LIBRARIES := android-support-v4 \
28    android-support-v7-appcompat
29
30LOCAL_SDK_VERSION := current
31LOCAL_SRC_FILES := \
32     $(call all-java-files-under, src) \
33     $(call all-java-files-under, appcompat/src) \
34     $(call all-logtags-files-under, src)
35
36LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(appcompat_res_dirs))
37LOCAL_AAPT_FLAGS := --auto-add-overlay
38LOCAL_AAPT_FLAGS += --extra-packages android.support.compat
39
40include $(BUILD_STATIC_JAVA_LIBRARY)
41
42# Dynamic version of non-appcompat library
43# You should only use this library if you're certain that you need it; see
44# go/extradex-design for more context.
45include $(CLEAR_VARS)
46
47activity_res_dirs := activity/res res ../../../$(SUPPORT_LIBRARY_ROOT)/compat/res
48LOCAL_MODULE := libphotoviewer_dynamic
49
50LOCAL_JAVA_LIBRARIES := android-support-v4
51
52LOCAL_SDK_VERSION := current
53LOCAL_SRC_FILES := \
54     $(call all-java-files-under, src) \
55     $(call all-java-files-under, activity/src) \
56     $(call all-logtags-files-under, src)
57
58LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(activity_res_dirs))
59LOCAL_AAPT_FLAGS := --auto-add-overlay
60LOCAL_AAPT_FLAGS += --extra-packages android.support.compat
61
62include $(BUILD_STATIC_JAVA_LIBRARY)
63
64
65# Build the regular static libraries based on the above.
66include $(CLEAR_VARS)
67
68activity_res_dirs := activity/res res
69LOCAL_MODULE := libphotoviewer_appcompat
70
71LOCAL_STATIC_JAVA_LIBRARIES := libphotoviewer_appcompat_dynamic \
72    android-support-v4 android-support-v7-appcompat
73
74LOCAL_SDK_VERSION := current
75LOCAL_SOURCE_FILES_ALL_GENERATED := true
76
77LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(appcompat_res_dirs))
78LOCAL_AAPT_FLAGS := --auto-add-overlay
79LOCAL_AAPT_FLAGS += --extra-packages android.support.compat
80
81include $(BUILD_STATIC_JAVA_LIBRARY)
82
83
84include $(CLEAR_VARS)
85
86activity_res_dirs := activity/res res ../../../$(SUPPORT_LIBRARY_ROOT)/compat/res
87LOCAL_MODULE := libphotoviewer
88
89LOCAL_STATIC_JAVA_LIBRARIES := libphotoviewer_dynamic android-support-v4
90
91LOCAL_SDK_VERSION := current
92LOCAL_SOURCE_FILES_ALL_GENERATED := true
93
94LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(activity_res_dirs))
95LOCAL_AAPT_FLAGS := --auto-add-overlay
96LOCAL_AAPT_FLAGS += --extra-packages android.support.compat
97
98include $(BUILD_STATIC_JAVA_LIBRARY)
99
100
101
102##################################################
103# Build all sub-directories
104
105include $(call all-makefiles-under,$(LOCAL_PATH))
106