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 18 okhttp_common_src_files := $(call all-java-files-under,okhttp/src/main/java) 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) 22 23 okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files)) 24 okhttp_system_src_files += $(call all-java-files-under, android/main/java) 25 26 okhttp_test_src_files := $(call all-java-files-under,android/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,okhttp-testing-support/src/main/java) 29 okhttp_test_src_files += $(call all-java-files-under,okhttp-tests/src/test/java) 30 okhttp_test_src_files += $(call all-java-files-under,okhttp-urlconnection/src/test/java) 31 okhttp_test_src_files += $(call all-java-files-under,okhttp-ws/src/main/java) 32 okhttp_test_src_files += $(call all-java-files-under,okhttp-ws-tests/src/test/java) 33 okhttp_test_src_files += $(call all-java-files-under,okio/okio/src/test/java) 34 okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java) 35 okhttp_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). 38 okhttp_test_src_excludes := \ 39 okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformUrlTest.java 40 41 okhttp_test_src_files := \ 42 $(filter-out $(okhttp_test_src_excludes), $(okhttp_test_src_files)) 43 44 include $(CLEAR_VARS) 45 LOCAL_MODULE := okhttp 46 LOCAL_MODULE_TAGS := optional 47 LOCAL_SRC_FILES := $(okhttp_system_src_files) 48 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt 49 LOCAL_JAVA_LIBRARIES := core-oj core-libart 50 LOCAL_NO_STANDARD_LIBRARIES := true 51 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 52 LOCAL_JAVA_LANGUAGE_VERSION := 1.7 53 include $(BUILD_JAVA_LIBRARY) 54 55 # 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. 58 include $(CLEAR_VARS) 59 LOCAL_MODULE := okhttp-testdex 60 LOCAL_MODULE_TAGS := optional 61 LOCAL_SRC_FILES := $(okhttp_system_src_files) 62 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt 63 LOCAL_JAVA_LIBRARIES := core-oj core-libart 64 LOCAL_NO_STANDARD_LIBRARIES := true 65 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 66 LOCAL_JAVA_LANGUAGE_VERSION := 1.7 67 include $(BUILD_JAVA_LIBRARY) 68 69 # non-jarjar'd version of okhttp to compile the tests against 70 include $(CLEAR_VARS) 71 LOCAL_MODULE := okhttp-nojarjar 72 LOCAL_MODULE_TAGS := optional 73 LOCAL_SRC_FILES := $(okhttp_system_src_files) 74 LOCAL_JAVA_LIBRARIES := core-oj core-libart 75 LOCAL_NO_STANDARD_LIBRARIES := true 76 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 77 LOCAL_JAVA_LANGUAGE_VERSION := 1.7 78 include $(BUILD_STATIC_JAVA_LIBRARY) 79 80 include $(CLEAR_VARS) 81 LOCAL_MODULE := okhttp-tests-nojarjar 82 LOCAL_MODULE_TAGS := optional 83 LOCAL_SRC_FILES := $(okhttp_test_src_files) 84 LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp-nojarjar junit bouncycastle-nojarjar conscrypt 85 LOCAL_NO_STANDARD_LIBRARIES := true 86 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 87 LOCAL_JAVA_LANGUAGE_VERSION := 1.7 88 include $(BUILD_STATIC_JAVA_LIBRARY) 89 90 ifeq ($(HOST_OS),linux) 91 include $(CLEAR_VARS) 92 LOCAL_MODULE := okhttp-hostdex 93 LOCAL_MODULE_TAGS := optional 94 LOCAL_SRC_FILES := $(okhttp_system_src_files) 95 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt 96 LOCAL_JAVA_LIBRARIES := conscrypt-hostdex 97 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 98 LOCAL_JAVA_LANGUAGE_VERSION := 1.7 99 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 100 endif # ($(HOST_OS),linux) 101