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,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 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)
     24 
     25 okhttp_test_src_files := $(call all-java-files-under,android/test/java)
     26 okhttp_test_src_files += $(call all-java-files-under,okhttp-android-support/src/test/java)
     27 okhttp_test_src_files += $(call all-java-files-under,okhttp-testing-support/src/main/java)
     28 okhttp_test_src_files += $(call all-java-files-under,okhttp-tests/src/test/java)
     29 okhttp_test_src_files += $(call all-java-files-under,okhttp-urlconnection/src/test/java)
     30 okhttp_test_src_files += $(call all-java-files-under,okhttp-ws/src/main/java)
     31 okhttp_test_src_files += $(call all-java-files-under,okhttp-ws-tests/src/test/java)
     32 okhttp_test_src_files += $(call all-java-files-under,okio/okio/src/test/java)
     33 okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java)
     34 okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/test/java)
     35 
     36 # Exclude tests Android currently has problems with:
     37 # 1) Parameterized (requires JUnit 4.11).
     38 # 2) New dependencies like gson.
     39 okhttp_test_src_excludes := \
     40     okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformUrlTest.java \
     41     okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformTestRun.java
     42 
     43 okhttp_test_src_files := \
     44     $(filter-out $(okhttp_test_src_excludes), $(okhttp_test_src_files))
     45 
     46 include $(CLEAR_VARS)
     47 LOCAL_MODULE := okhttp
     48 LOCAL_MODULE_TAGS := optional
     49 LOCAL_SRC_FILES := $(okhttp_system_src_files)
     50 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
     51 LOCAL_JAVA_LIBRARIES := core-oj core-libart conscrypt
     52 LOCAL_NO_STANDARD_LIBRARIES := true
     53 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
     54 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     55 include $(BUILD_JAVA_LIBRARY)
     56 
     57 # non-jarjar'd version of okhttp to compile the tests against
     58 include $(CLEAR_VARS)
     59 LOCAL_MODULE := okhttp-nojarjar
     60 LOCAL_MODULE_TAGS := optional
     61 LOCAL_SRC_FILES := $(okhttp_system_src_files)
     62 LOCAL_JAVA_LIBRARIES := core-oj core-libart conscrypt
     63 LOCAL_NO_STANDARD_LIBRARIES := true
     64 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
     65 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     66 include $(BUILD_STATIC_JAVA_LIBRARY)
     67 
     68 include $(CLEAR_VARS)
     69 LOCAL_MODULE := okhttp-tests-nojarjar
     70 LOCAL_MODULE_TAGS := optional
     71 LOCAL_SRC_FILES := $(okhttp_test_src_files)
     72 LOCAL_JAVA_LIBRARIES := core-oj core-libart okhttp-nojarjar junit4-target bouncycastle-nojarjar conscrypt
     73 LOCAL_NO_STANDARD_LIBRARIES := true
     74 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
     75 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     76 include $(BUILD_STATIC_JAVA_LIBRARY)
     77 
     78 ifeq ($(HOST_OS),linux)
     79 include $(CLEAR_VARS)
     80 LOCAL_MODULE := okhttp-hostdex
     81 LOCAL_MODULE_TAGS := optional
     82 LOCAL_SRC_FILES := $(okhttp_system_src_files)
     83 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
     84 LOCAL_JAVA_LIBRARIES := conscrypt-hostdex
     85 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
     86 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     87 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
     88 endif  # ($(HOST_OS),linux)
     89