1# Copyright 2008, 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# Build the Email application itself, along with its tests and tests for the emailcommon
18# static library.  All tests can be run via runtest email
19
20include $(CLEAR_VARS)
21
22# Include res dir from chips, unified, emailcommon, and photoviewer
23appcompat_dir := ../../../prebuilts/sdk/current/support/v7/appcompat/res
24chips_dir := ../../../frameworks/opt/chips/res
25unified_email_dir := ../UnifiedEmail
26photo_dir := ../../../frameworks/opt/photoviewer/res ../../../frameworks/opt/photoviewer/appcompat/res
27emailcommon_dir := emailcommon
28gridlayout_dir := ../../../prebuilts/sdk/current/support/v7/gridlayout/res
29bitmap_dir := ../../../frameworks/opt/bitmap/res
30datetimepicker_dir := ../../../frameworks/opt/datetimepicker/res
31res_dir := res $(unified_email_dir)/res $(chips_dir) $(photo_dir) $(emailcommon_dir)/res $(appcompat_dir) $(gridlayout_dir) $(bitmap_dir) $(datetimepicker_dir)
32
33LOCAL_MODULE_TAGS := optional
34
35LOCAL_SRC_FILES := $(call all-java-files-under, $(unified_email_dir)/src)
36LOCAL_SRC_FILES += $(call all-java-files-under, src/com/android)
37LOCAL_SRC_FILES += $(call all-java-files-under, provider_src/com/android)
38LOCAL_SRC_FILES += $(call all-java-files-under, src/com/beetstra)
39
40LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir))
41
42# Use assets dir from UnifiedEmail
43# (the default package target doesn't seem to deal with multiple asset dirs)
44LOCAL_ASSET_DIR := $(LOCAL_PATH)/$(unified_email_dir)/assets
45
46LOCAL_AAPT_FLAGS := --auto-add-overlay
47LOCAL_AAPT_FLAGS += --extra-packages com.android.ex.chips:com.android.mail:com.android.email:com.android.emailcommon:com.android.ex.photo:android.support.v7.appcompat:android.support.v7.gridlayout:com.android.bitmap:com.android.datetimepicker
48
49LOCAL_STATIC_JAVA_LIBRARIES := android-common com.android.emailcommon guava libchips
50LOCAL_STATIC_JAVA_LIBRARIES += libphotoviewer_appcompat
51LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
52LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
53LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-gridlayout
54LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13
55LOCAL_STATIC_JAVA_LIBRARIES += android-opt-bitmap
56LOCAL_STATIC_JAVA_LIBRARIES += android-opt-datetimepicker
57LOCAL_STATIC_JAVA_LIBRARIES += owasp-html-sanitizer
58
59LOCAL_PACKAGE_NAME := Email
60
61LOCAL_PROGUARD_FLAG_FILES := proguard.flags $(unified_email_dir)/proguard.flags
62ifeq (eng,$(TARGET_BUILD_VARIANT))
63  LOCAL_PROGUARD_FLAG_FILES += proguard-test.flags
64endif
65
66LOCAL_SDK_VERSION := current
67
68include $(BUILD_PACKAGE)
69
70# only include rules to build other stuff for the original package, not the derived package.
71ifeq ($(strip $(LOCAL_PACKAGE_OVERRIDES)),)
72# additionally, build unit tests in a separate .apk
73include $(call all-makefiles-under,$(LOCAL_PATH))
74endif
75