blob: 2312391a0c7e28d193e22c3944d3cb01281c477e [file] [log] [blame]
Tobias Thierer5be18512016-06-24 19:23:19 +01001#
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)
22
23okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files))
24okhttp_system_src_files += $(call all-java-files-under, android/main/java)
25
26okhttp_test_src_files := $(call all-java-files-under,android/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,okhttp-testing-support/src/main/java)
29okhttp_test_src_files += $(call all-java-files-under,okhttp-tests/src/test/java)
30okhttp_test_src_files += $(call all-java-files-under,okhttp-urlconnection/src/test/java)
31okhttp_test_src_files += $(call all-java-files-under,okhttp-ws/src/main/java)
32okhttp_test_src_files += $(call all-java-files-under,okhttp-ws-tests/src/test/java)
33okhttp_test_src_files += $(call all-java-files-under,okio/okio/src/test/java)
34okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java)
35okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/test/java)
36
37# Exclude test Android currently has problems with due to @Parameterized (requires JUnit 4.11).
38okhttp_test_src_excludes := \
39 okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformUrlTest.java
40
41okhttp_test_src_files := \
42 $(filter-out $(okhttp_test_src_excludes), $(okhttp_test_src_files))
43
44include $(CLEAR_VARS)
45LOCAL_MODULE := okhttp
46LOCAL_MODULE_TAGS := optional
47LOCAL_SRC_FILES := $(okhttp_system_src_files)
48LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Tobias Thierer740ddbb2016-07-01 16:03:46 +010049LOCAL_JAVA_LIBRARIES := core-oj core-libart
Tobias Thierer5be18512016-06-24 19:23:19 +010050LOCAL_NO_STANDARD_LIBRARIES := true
51LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
52LOCAL_JAVA_LANGUAGE_VERSION := 1.7
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)
Tobias Thierer740ddbb2016-07-01 16:03:46 +010060LOCAL_JAVA_LIBRARIES := core-oj core-libart
Tobias Thierer5be18512016-06-24 19:23:19 +010061LOCAL_NO_STANDARD_LIBRARIES := true
62LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
63LOCAL_JAVA_LANGUAGE_VERSION := 1.7
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)
Paul Duffin6525d582016-12-01 13:38:08 +000070LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp-nojarjar junit bouncycastle-nojarjar conscrypt
Tobias Thierer5be18512016-06-24 19:23:19 +010071LOCAL_NO_STANDARD_LIBRARIES := true
72LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
73LOCAL_JAVA_LANGUAGE_VERSION := 1.7
74include $(BUILD_STATIC_JAVA_LIBRARY)
75
76ifeq ($(HOST_OS),linux)
77include $(CLEAR_VARS)
78LOCAL_MODULE := okhttp-hostdex
79LOCAL_MODULE_TAGS := optional
80LOCAL_SRC_FILES := $(okhttp_system_src_files)
81LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
82LOCAL_JAVA_LIBRARIES := conscrypt-hostdex
83LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
84LOCAL_JAVA_LANGUAGE_VERSION := 1.7
85include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
86endif # ($(HOST_OS),linux)