blob: cea6eb58de789f43331ab8f98f17cc20b327c436 [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
Nicolas Geoffrayaf87c612017-03-01 10:04:07 +000055# A guaranteed unstripped version of okhttp.
56# The build system may or may not strip the okhttp jar, but this one will
57# not be stripped. See b/24535627.
58include $(CLEAR_VARS)
59LOCAL_MODULE := okhttp-testdex
60LOCAL_MODULE_TAGS := optional
61LOCAL_SRC_FILES := $(okhttp_system_src_files)
62LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
63LOCAL_JAVA_LIBRARIES := core-oj core-libart
64LOCAL_NO_STANDARD_LIBRARIES := true
65LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
66LOCAL_JAVA_LANGUAGE_VERSION := 1.7
67include $(BUILD_JAVA_LIBRARY)
68
Tobias Thierer5be18512016-06-24 19:23:19 +010069# non-jarjar'd version of okhttp to compile the tests against
70include $(CLEAR_VARS)
71LOCAL_MODULE := okhttp-nojarjar
72LOCAL_MODULE_TAGS := optional
73LOCAL_SRC_FILES := $(okhttp_system_src_files)
Tobias Thierer740ddbb2016-07-01 16:03:46 +010074LOCAL_JAVA_LIBRARIES := core-oj core-libart
Tobias Thierer5be18512016-06-24 19:23:19 +010075LOCAL_NO_STANDARD_LIBRARIES := true
76LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
77LOCAL_JAVA_LANGUAGE_VERSION := 1.7
78include $(BUILD_STATIC_JAVA_LIBRARY)
79
80include $(CLEAR_VARS)
81LOCAL_MODULE := okhttp-tests-nojarjar
82LOCAL_MODULE_TAGS := optional
83LOCAL_SRC_FILES := $(okhttp_test_src_files)
Paul Duffin6525d582016-12-01 13:38:08 +000084LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp-nojarjar junit bouncycastle-nojarjar conscrypt
Tobias Thierer5be18512016-06-24 19:23:19 +010085LOCAL_NO_STANDARD_LIBRARIES := true
86LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
87LOCAL_JAVA_LANGUAGE_VERSION := 1.7
88include $(BUILD_STATIC_JAVA_LIBRARY)
89
90ifeq ($(HOST_OS),linux)
91include $(CLEAR_VARS)
92LOCAL_MODULE := okhttp-hostdex
93LOCAL_MODULE_TAGS := optional
94LOCAL_SRC_FILES := $(okhttp_system_src_files)
95LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
96LOCAL_JAVA_LIBRARIES := conscrypt-hostdex
97LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
98LOCAL_JAVA_LANGUAGE_VERSION := 1.7
99include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
100endif # ($(HOST_OS),linux)