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