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,okio/src/main/java) 20 okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files)) 21 okhttp_system_src_files += $(call all-java-files-under, android/main/java) 22 23 okhttp_test_src_files := $(call all-java-files-under,okhttp-tests/src/test/java) 24 okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java) 25 okhttp_test_src_files += $(call all-java-files-under,android/test/java) 26 okhttp_test_src_files := $(filter-out mockwebserver/src/main/java/com/squareup/okhttp/internal/spdy/SpdyServer.java, $(okhttp_test_src_files)) 27 28 include $(CLEAR_VARS) 29 LOCAL_MODULE := okhttp 30 LOCAL_MODULE_TAGS := optional 31 LOCAL_SRC_FILES := $(okhttp_system_src_files) 32 LOCAL_JAVACFLAGS := -encoding UTF-8 33 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt 34 LOCAL_JAVA_LIBRARIES := core-libart conscrypt 35 LOCAL_NO_STANDARD_LIBRARIES := true 36 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 37 include $(BUILD_JAVA_LIBRARY) 38 39 # static version of okhttp for inclusion in apps targeting older releases 40 include $(CLEAR_VARS) 41 LOCAL_MODULE := okhttp-static 42 LOCAL_MODULE_TAGS := optional 43 LOCAL_SRC_FILES := $(okhttp_common_src_files) 44 LOCAL_JAVACFLAGS := -encoding UTF-8 45 # This is set when building apps - exclude platform targets. 46 ifneq ($(TARGET_BUILD_APPS),) 47 LOCAL_SDK_VERSION := 11 48 else 49 LOCAL_JAVA_LIBRARIES := core-libart 50 LOCAL_NO_STANDARD_LIBRARIES := true 51 endif 52 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 53 include $(BUILD_STATIC_JAVA_LIBRARY) 54 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 59 LOCAL_SRC_FILES := $(okhttp_system_src_files) 60 LOCAL_JAVACFLAGS := -encoding UTF-8 61 LOCAL_JAVA_LIBRARIES := core-libart conscrypt 62 LOCAL_NO_STANDARD_LIBRARIES := true 63 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 64 include $(BUILD_STATIC_JAVA_LIBRARY) 65 66 include $(CLEAR_VARS) 67 LOCAL_MODULE := okhttp-tests-nojarjar 68 LOCAL_MODULE_TAGS := optional 69 LOCAL_SRC_FILES := $(okhttp_test_src_files) 70 LOCAL_JAVACFLAGS := -encoding UTF-8 71 LOCAL_JAVA_LIBRARIES := core-libart okhttp-nojarjar junit4-target bouncycastle-nojarjar 72 LOCAL_NO_STANDARD_LIBRARIES := true 73 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 74 include $(BUILD_STATIC_JAVA_LIBRARY) 75 76 include $(CLEAR_VARS) 77 LOCAL_MODULE := okhttp-hostdex 78 LOCAL_MODULE_TAGS := optional 79 LOCAL_SRC_FILES := $(okhttp_system_src_files) 80 LOCAL_JAVACFLAGS := -encoding UTF-8 81 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt 82 LOCAL_JAVA_LIBRARIES := conscrypt-hostdex 83 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 84 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 85