blob: 245f4171ae1cbfecb727fe0369fb730d30acc40e [file] [log] [blame]
Narayan Kamath153d0952012-08-09 13:14:26 +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
Narayan Kamath166772b2013-11-04 16:04:55 +000018okhttp_common_src_files := $(call all-java-files-under,okhttp/src/main/java)
Neil Fullere78f1172015-01-20 09:39:41 +000019okhttp_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)
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010022okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files))
23okhttp_system_src_files += $(call all-java-files-under, android/main/java)
jwilson2231db32012-12-26 11:37:43 -070024
Neil Fuller3c938a32014-02-19 09:40:26 +000025okhttp_test_src_files := $(call all-java-files-under,okhttp-tests/src/test/java)
Neil Fullere78f1172015-01-20 09:39:41 +000026okhttp_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)
Narayan Kamath166772b2013-11-04 16:04:55 +000029okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java)
Neil Fullere78f1172015-01-20 09:39:41 +000030okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/test/java)
Neil Fuller9196e812014-09-11 10:45:54 +010031okhttp_test_src_files += $(call all-java-files-under,android/test/java)
Neil Fullera2cab722015-04-13 13:06:22 +010032okhttp_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)
Brian Carlstromd935f312013-04-03 10:06:56 -070034
Neil Fuller781c9c22015-05-07 13:14:41 +010035# 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
Narayan Kamath153d0952012-08-09 13:14:26 +010045include $(CLEAR_VARS)
46LOCAL_MODULE := okhttp
47LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010048LOCAL_SRC_FILES := $(okhttp_system_src_files)
jwilson2231db32012-12-26 11:37:43 -070049LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Susheel Yadagiri1b1e6e32014-10-06 10:47:16 -070050LOCAL_JAVA_LIBRARIES := core-libart conscrypt tcmiface
Brian Carlstromcd5fb672013-04-02 13:21:23 -070051LOCAL_NO_STANDARD_LIBRARIES := true
52LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Narayan Kamath153d0952012-08-09 13:14:26 +010053include $(BUILD_JAVA_LIBRARY)
jwilson2231db32012-12-26 11:37:43 -070054
Brian Carlstromd935f312013-04-03 10:06:56 -070055# non-jarjar'd version of okhttp to compile the tests against
56include $(CLEAR_VARS)
57LOCAL_MODULE := okhttp-nojarjar
58LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010059LOCAL_SRC_FILES := $(okhttp_system_src_files)
Susheel Yadagiri1b1e6e32014-10-06 10:47:16 -070060LOCAL_JAVA_LIBRARIES := core-libart conscrypt tcmiface
Brian Carlstromd935f312013-04-03 10:06:56 -070061LOCAL_NO_STANDARD_LIBRARIES := true
62LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Brian Carlstrom38381e42013-04-03 18:01:19 -070063include $(BUILD_STATIC_JAVA_LIBRARY)
Brian Carlstromd935f312013-04-03 10:06:56 -070064
65include $(CLEAR_VARS)
Neil Fuller98d2d602014-05-29 11:58:32 +010066LOCAL_MODULE := okhttp-tests-nojarjar
Brian Carlstromd935f312013-04-03 10:06:56 -070067LOCAL_MODULE_TAGS := optional
68LOCAL_SRC_FILES := $(okhttp_test_src_files)
Susheel Yadagiri1b1e6e32014-10-06 10:47:16 -070069LOCAL_JAVA_LIBRARIES := core-libart okhttp-nojarjar junit4-target bouncycastle-nojarjar conscrypt tcmiface
Brian Carlstromd935f312013-04-03 10:06:56 -070070LOCAL_NO_STANDARD_LIBRARIES := true
71LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
72include $(BUILD_STATIC_JAVA_LIBRARY)
73
Narayan Kamath495552c2015-01-06 17:46:55 +000074ifeq ($(HOST_OS),linux)
Ian Rogers112fb082014-05-23 12:09:52 -070075include $(CLEAR_VARS)
76LOCAL_MODULE := okhttp-hostdex
77LOCAL_MODULE_TAGS := optional
78LOCAL_SRC_FILES := $(okhttp_system_src_files)
Ian Rogers112fb082014-05-23 12:09:52 -070079LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Susheel Yadagiri1b1e6e32014-10-06 10:47:16 -070080LOCAL_JAVA_LIBRARIES := conscrypt-hostdex tcmiface-hostdex
Ian Rogers112fb082014-05-23 12:09:52 -070081LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
82include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
Narayan Kamath495552c2015-01-06 17:46:55 +000083endif # ($(HOST_OS),linux)