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,okhttp-tests/src/test/java)
26okhttp_test_src_files += $(call all-java-files-under,okhttp-urlconnection/src/test/java)
27okhttp_test_src_files += $(call all-java-files-under,okhttp-android-support/src/test/java)
28okhttp_test_src_files += $(call all-java-files-under,okio/okio/src/test/java)
29okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java)
30okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/test/java)
31okhttp_test_src_files += $(call all-java-files-under,android/test/java)
32okhttp_test_src_files += $(call all-java-files-under,okhttp-ws/src/main/java)
33okhttp_test_src_files += $(call all-java-files-under,okhttp-ws-tests/src/test/java)
34
35# Exclude tests Android currently has problems with:
36# 1) Parameterized (requires JUnit 4.11).
37# 2) New dependencies like gson.
38okhttp_test_src_excludes := \
39    okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformUrlTest.java \
40    okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformTestRun.java
41
42okhttp_test_src_files := \
43    $(filter-out $(okhttp_test_src_excludes), $(okhttp_test_src_files))
44
45include $(CLEAR_VARS)
46LOCAL_MODULE := okhttp
47LOCAL_MODULE_TAGS := optional
48LOCAL_SRC_FILES := $(okhttp_system_src_files)
49LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
50LOCAL_JAVA_LIBRARIES := core-libart conscrypt
51LOCAL_NO_STANDARD_LIBRARIES := true
52LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
53include $(BUILD_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_JAVA_LIBRARIES := core-libart conscrypt
61LOCAL_NO_STANDARD_LIBRARIES := true
62LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
63include $(BUILD_STATIC_JAVA_LIBRARY)
64
65include $(CLEAR_VARS)
66LOCAL_MODULE := okhttp-tests-nojarjar
67LOCAL_MODULE_TAGS := optional
68LOCAL_SRC_FILES := $(okhttp_test_src_files)
69LOCAL_JAVA_LIBRARIES := core-libart okhttp-nojarjar junit4-target bouncycastle-nojarjar conscrypt
70LOCAL_NO_STANDARD_LIBRARIES := true
71LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
72include $(BUILD_STATIC_JAVA_LIBRARY)
73
74ifeq ($(HOST_OS),linux)
75include $(CLEAR_VARS)
76LOCAL_MODULE := okhttp-hostdex
77LOCAL_MODULE_TAGS := optional
78LOCAL_SRC_FILES := $(okhttp_system_src_files)
79LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
80LOCAL_JAVA_LIBRARIES := conscrypt-hostdex
81LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
82include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
83endif  # ($(HOST_OS),linux)
84