Narayan Kamath | 153d095 | 2012-08-09 13:14:26 +0100 | [diff] [blame] | 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 | # |
| 16 | LOCAL_PATH := $(call my-dir) |
| 17 | |
Narayan Kamath | 166772b | 2013-11-04 16:04:55 +0000 | [diff] [blame] | 18 | okhttp_common_src_files := $(call all-java-files-under,okhttp/src/main/java) |
Neil Fuller | e78f117 | 2015-01-20 09:39:41 +0000 | [diff] [blame] | 19 | okhttp_common_src_files += $(call all-java-files-under,okhttp-urlconnection/src/main/java) |
| 20 | okhttp_common_src_files += $(call all-java-files-under,okhttp-android-support/src/main/java) |
| 21 | okhttp_common_src_files += $(call all-java-files-under,okio/okio/src/main/java) |
Allan Wojciechowski | e7f0391 | 2013-05-28 18:16:54 +0100 | [diff] [blame] | 22 | okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files)) |
| 23 | okhttp_system_src_files += $(call all-java-files-under, android/main/java) |
jwilson | 2231db3 | 2012-12-26 11:37:43 -0700 | [diff] [blame] | 24 | |
Neil Fuller | 3c938a3 | 2014-02-19 09:40:26 +0000 | [diff] [blame] | 25 | okhttp_test_src_files := $(call all-java-files-under,okhttp-tests/src/test/java) |
Neil Fuller | e78f117 | 2015-01-20 09:39:41 +0000 | [diff] [blame] | 26 | okhttp_test_src_files += $(call all-java-files-under,okhttp-urlconnection/src/test/java) |
| 27 | okhttp_test_src_files += $(call all-java-files-under,okhttp-android-support/src/test/java) |
| 28 | okhttp_test_src_files += $(call all-java-files-under,okio/okio/src/test/java) |
Narayan Kamath | 166772b | 2013-11-04 16:04:55 +0000 | [diff] [blame] | 29 | okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java) |
Neil Fuller | e78f117 | 2015-01-20 09:39:41 +0000 | [diff] [blame] | 30 | okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/test/java) |
Neil Fuller | 9196e81 | 2014-09-11 10:45:54 +0100 | [diff] [blame] | 31 | okhttp_test_src_files += $(call all-java-files-under,android/test/java) |
Neil Fuller | a2cab72 | 2015-04-13 13:06:22 +0100 | [diff] [blame] | 32 | okhttp_test_src_files += $(call all-java-files-under,okhttp-ws/src/main/java) |
| 33 | okhttp_test_src_files += $(call all-java-files-under,okhttp-ws-tests/src/test/java) |
Brian Carlstrom | d935f31 | 2013-04-03 10:06:56 -0700 | [diff] [blame] | 34 | |
Neil Fuller | 781c9c2 | 2015-05-07 13:14:41 +0100 | [diff] [blame] | 35 | # Exclude tests Android currently has problems with: |
| 36 | # 1) Parameterized (requires JUnit 4.11). |
| 37 | # 2) New dependencies like gson. |
| 38 | okhttp_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 | |
| 42 | okhttp_test_src_files := \ |
| 43 | $(filter-out $(okhttp_test_src_excludes), $(okhttp_test_src_files)) |
| 44 | |
Narayan Kamath | 153d095 | 2012-08-09 13:14:26 +0100 | [diff] [blame] | 45 | include $(CLEAR_VARS) |
| 46 | LOCAL_MODULE := okhttp |
| 47 | LOCAL_MODULE_TAGS := optional |
Allan Wojciechowski | e7f0391 | 2013-05-28 18:16:54 +0100 | [diff] [blame] | 48 | LOCAL_SRC_FILES := $(okhttp_system_src_files) |
jwilson | 2231db3 | 2012-12-26 11:37:43 -0700 | [diff] [blame] | 49 | LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt |
Susheel Yadagiri | 1b1e6e3 | 2014-10-06 10:47:16 -0700 | [diff] [blame] | 50 | LOCAL_JAVA_LIBRARIES := core-libart conscrypt tcmiface |
Brian Carlstrom | cd5fb67 | 2013-04-02 13:21:23 -0700 | [diff] [blame] | 51 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 52 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Narayan Kamath | 153d095 | 2012-08-09 13:14:26 +0100 | [diff] [blame] | 53 | include $(BUILD_JAVA_LIBRARY) |
jwilson | 2231db3 | 2012-12-26 11:37:43 -0700 | [diff] [blame] | 54 | |
Brian Carlstrom | d935f31 | 2013-04-03 10:06:56 -0700 | [diff] [blame] | 55 | # non-jarjar'd version of okhttp to compile the tests against |
| 56 | include $(CLEAR_VARS) |
| 57 | LOCAL_MODULE := okhttp-nojarjar |
| 58 | LOCAL_MODULE_TAGS := optional |
Allan Wojciechowski | e7f0391 | 2013-05-28 18:16:54 +0100 | [diff] [blame] | 59 | LOCAL_SRC_FILES := $(okhttp_system_src_files) |
Susheel Yadagiri | 1b1e6e3 | 2014-10-06 10:47:16 -0700 | [diff] [blame] | 60 | LOCAL_JAVA_LIBRARIES := core-libart conscrypt tcmiface |
Brian Carlstrom | d935f31 | 2013-04-03 10:06:56 -0700 | [diff] [blame] | 61 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 62 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Brian Carlstrom | 38381e4 | 2013-04-03 18:01:19 -0700 | [diff] [blame] | 63 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Brian Carlstrom | d935f31 | 2013-04-03 10:06:56 -0700 | [diff] [blame] | 64 | |
| 65 | include $(CLEAR_VARS) |
Neil Fuller | 98d2d60 | 2014-05-29 11:58:32 +0100 | [diff] [blame] | 66 | LOCAL_MODULE := okhttp-tests-nojarjar |
Brian Carlstrom | d935f31 | 2013-04-03 10:06:56 -0700 | [diff] [blame] | 67 | LOCAL_MODULE_TAGS := optional |
| 68 | LOCAL_SRC_FILES := $(okhttp_test_src_files) |
Susheel Yadagiri | 1b1e6e3 | 2014-10-06 10:47:16 -0700 | [diff] [blame] | 69 | LOCAL_JAVA_LIBRARIES := core-libart okhttp-nojarjar junit4-target bouncycastle-nojarjar conscrypt tcmiface |
Brian Carlstrom | d935f31 | 2013-04-03 10:06:56 -0700 | [diff] [blame] | 70 | LOCAL_NO_STANDARD_LIBRARIES := true |
| 71 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 72 | include $(BUILD_STATIC_JAVA_LIBRARY) |
| 73 | |
Narayan Kamath | 495552c | 2015-01-06 17:46:55 +0000 | [diff] [blame] | 74 | ifeq ($(HOST_OS),linux) |
Ian Rogers | 112fb08 | 2014-05-23 12:09:52 -0700 | [diff] [blame] | 75 | include $(CLEAR_VARS) |
| 76 | LOCAL_MODULE := okhttp-hostdex |
| 77 | LOCAL_MODULE_TAGS := optional |
| 78 | LOCAL_SRC_FILES := $(okhttp_system_src_files) |
Ian Rogers | 112fb08 | 2014-05-23 12:09:52 -0700 | [diff] [blame] | 79 | LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt |
Susheel Yadagiri | 1b1e6e3 | 2014-10-06 10:47:16 -0700 | [diff] [blame] | 80 | LOCAL_JAVA_LIBRARIES := conscrypt-hostdex tcmiface-hostdex |
Ian Rogers | 112fb08 | 2014-05-23 12:09:52 -0700 | [diff] [blame] | 81 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 82 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
Narayan Kamath | 495552c | 2015-01-06 17:46:55 +0000 | [diff] [blame] | 83 | endif # ($(HOST_OS),linux) |