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,okhttp-urlconnection/src/main/java)
20okhttp_common_src_files += $(call all-java-files-under,okhttp-android-support/src/main/java)
21okhttp_common_src_files += $(call all-java-files-under,okio/okio/src/main/java)
22okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files))
23okhttp_system_src_files += $(call all-java-files-under, android/main/java)
24
25okhttp_test_src_files := $(call all-java-files-under,android/test/java)
26okhttp_test_src_files += $(call all-java-files-under,okhttp-android-support/src/test/java)
27okhttp_test_src_files += $(call all-java-files-under,okhttp-testing-support/src/main/java)
28okhttp_test_src_files += $(call all-java-files-under,okhttp-tests/src/test/java)
29okhttp_test_src_files += $(call all-java-files-under,okhttp-urlconnection/src/test/java)
30okhttp_test_src_files += $(call all-java-files-under,okhttp-ws/src/main/java)
31okhttp_test_src_files += $(call all-java-files-under,okhttp-ws-tests/src/test/java)
32okhttp_test_src_files += $(call all-java-files-under,okio/okio/src/test/java)
33okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java)
34okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/test/java)
35
36# Exclude tests Android currently has problems with:
37# 1) Parameterized (requires JUnit 4.11).
38# 2) New dependencies like gson.
39okhttp_test_src_excludes := \
40    okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformUrlTest.java \
41    okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformTestRun.java
42
43okhttp_test_src_files := \
44    $(filter-out $(okhttp_test_src_excludes), $(okhttp_test_src_files))
45
46include $(CLEAR_VARS)
47LOCAL_MODULE := okhttp
48LOCAL_MODULE_TAGS := optional
49LOCAL_SRC_FILES := $(okhttp_system_src_files)
50LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
51LOCAL_JAVA_LIBRARIES := core-oj core-libart conscrypt
52LOCAL_NO_STANDARD_LIBRARIES := true
53LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
54LOCAL_JAVA_LANGUAGE_VERSION := 1.7
55include $(BUILD_JAVA_LIBRARY)
56
57# non-jarjar'd version of okhttp to compile the tests against
58include $(CLEAR_VARS)
59LOCAL_MODULE := okhttp-nojarjar
60LOCAL_MODULE_TAGS := optional
61LOCAL_SRC_FILES := $(okhttp_system_src_files)
62LOCAL_JAVA_LIBRARIES := core-oj core-libart conscrypt
63LOCAL_NO_STANDARD_LIBRARIES := true
64LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
65LOCAL_JAVA_LANGUAGE_VERSION := 1.7
66include $(BUILD_STATIC_JAVA_LIBRARY)
67
68include $(CLEAR_VARS)
69LOCAL_MODULE := okhttp-tests-nojarjar
70LOCAL_MODULE_TAGS := optional
71LOCAL_SRC_FILES := $(okhttp_test_src_files)
72LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp-nojarjar junit4-target bouncycastle-nojarjar conscrypt
73LOCAL_NO_STANDARD_LIBRARIES := true
74LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
75LOCAL_JAVA_LANGUAGE_VERSION := 1.7
76include $(BUILD_STATIC_JAVA_LIBRARY)
77
78ifeq ($(HOST_OS),linux)
79include $(CLEAR_VARS)
80LOCAL_MODULE := okhttp-hostdex
81LOCAL_MODULE_TAGS := optional
82LOCAL_SRC_FILES := $(okhttp_system_src_files)
83LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
84LOCAL_JAVA_LIBRARIES := conscrypt-hostdex
85LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
86LOCAL_JAVA_LANGUAGE_VERSION := 1.7
87include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
88endif  # ($(HOST_OS),linux)
89