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