1#
2# Copyright (C) 2012 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#
16LOCAL_PATH := $(call my-dir)
17
18okhttp_common_src_files := $(call all-java-files-under,okhttp/src/main/java)
19okhttp_common_src_files += $(call all-java-files-under,okio/src/main/java)
20okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files))
21okhttp_system_src_files += $(call all-java-files-under, android/main/java)
22
23okhttp_test_src_files := $(call all-java-files-under,okhttp-tests/src/test/java)
24okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java)
25okhttp_test_src_files += $(call all-java-files-under,android/test/java)
26okhttp_test_src_files := $(filter-out mockwebserver/src/main/java/com/squareup/okhttp/internal/spdy/SpdyServer.java, $(okhttp_test_src_files))
27
28include $(CLEAR_VARS)
29LOCAL_MODULE := okhttp
30LOCAL_MODULE_TAGS := optional
31LOCAL_SRC_FILES := $(okhttp_system_src_files)
32LOCAL_JAVACFLAGS := -encoding UTF-8
33LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
34LOCAL_JAVA_LIBRARIES := core-libart conscrypt
35LOCAL_NO_STANDARD_LIBRARIES := true
36LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
37include $(BUILD_JAVA_LIBRARY)
38
39# static version of okhttp for inclusion in apps targeting older releases
40include $(CLEAR_VARS)
41LOCAL_MODULE := okhttp-static
42LOCAL_MODULE_TAGS := optional
43LOCAL_SRC_FILES := $(okhttp_common_src_files)
44LOCAL_JAVACFLAGS := -encoding UTF-8
45# This is set when building apps - exclude platform targets.
46ifneq ($(TARGET_BUILD_APPS),)
47    LOCAL_SDK_VERSION := 11
48else
49    LOCAL_JAVA_LIBRARIES := core-libart
50    LOCAL_NO_STANDARD_LIBRARIES := true
51endif
52LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
53include $(BUILD_STATIC_JAVA_LIBRARY)
54
55# non-jarjar'd version of okhttp to compile the tests against
56include $(CLEAR_VARS)
57LOCAL_MODULE := okhttp-nojarjar
58LOCAL_MODULE_TAGS := optional
59LOCAL_SRC_FILES := $(okhttp_system_src_files)
60LOCAL_JAVACFLAGS := -encoding UTF-8
61LOCAL_JAVA_LIBRARIES := core-libart conscrypt
62LOCAL_NO_STANDARD_LIBRARIES := true
63LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
64include $(BUILD_STATIC_JAVA_LIBRARY)
65
66include $(CLEAR_VARS)
67LOCAL_MODULE := okhttp-tests-nojarjar
68LOCAL_MODULE_TAGS := optional
69LOCAL_SRC_FILES := $(okhttp_test_src_files)
70LOCAL_JAVACFLAGS := -encoding UTF-8
71LOCAL_JAVA_LIBRARIES := core-libart okhttp-nojarjar junit4-target bouncycastle-nojarjar conscrypt
72LOCAL_NO_STANDARD_LIBRARIES := true
73LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
74include $(BUILD_STATIC_JAVA_LIBRARY)
75
76include $(CLEAR_VARS)
77LOCAL_MODULE := okhttp-hostdex
78LOCAL_MODULE_TAGS := optional
79LOCAL_SRC_FILES := $(okhttp_system_src_files)
80LOCAL_JAVACFLAGS := -encoding UTF-8
81LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
82LOCAL_JAVA_LIBRARIES := conscrypt-hostdex
83LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
84include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
85