blob: ede28facdf8dcaec73c7bc70f05d8e63394357d9 [file] [log] [blame]
Narayan Kamath153d0952012-08-09 13:14:26 +01001#
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
Narayan Kamath166772b2013-11-04 16:04:55 +000018okhttp_common_src_files := $(call all-java-files-under,okhttp/src/main/java)
19okhttp_common_src_files += $(call all-java-files-under,okhttp-protocols/src/main/java)
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010020okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files))
21okhttp_system_src_files += $(call all-java-files-under, android/main/java)
jwilson2231db32012-12-26 11:37:43 -070022
Narayan Kamath166772b2013-11-04 16:04:55 +000023okhttp_test_src_files := $(call all-java-files-under,okhttp/src/test/java)
24okhttp_test_src_files += $(call all-java-files-under,okhttp-protocols/src/test/java)
25okhttp_test_src_files += $(call all-java-files-under,mockwebserver/src/main/java)
26okhttp_test_src_files := $(filter-out mockwebserver/src/main/java/com/squareup/okhttp/internal/spdy/SpdyServer.java, $(okhttp_test_src_files))
Brian Carlstromd935f312013-04-03 10:06:56 -070027
Narayan Kamath153d0952012-08-09 13:14:26 +010028include $(CLEAR_VARS)
29LOCAL_MODULE := okhttp
30LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010031LOCAL_SRC_FILES := $(okhttp_system_src_files)
jwilson2231db32012-12-26 11:37:43 -070032LOCAL_JAVACFLAGS := -encoding UTF-8
33LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Kenny Rootee421d12013-04-23 22:39:04 -070034LOCAL_JAVA_LIBRARIES := conscrypt core
Brian Carlstromcd5fb672013-04-02 13:21:23 -070035LOCAL_NO_STANDARD_LIBRARIES := true
36LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Narayan Kamath153d0952012-08-09 13:14:26 +010037include $(BUILD_JAVA_LIBRARY)
jwilson2231db32012-12-26 11:37:43 -070038
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010039# static version of okhttp for inclusion in apps targeting older releases
40include $(CLEAR_VARS)
41LOCAL_MODULE := okhttp-static
42LOCAL_MODULE_TAGS := optional
43LOCAL_SRC_FILES := $(okhttp_common_src_files)
44LOCAL_JAVACFLAGS := -encoding UTF-8
45LOCAL_JAVA_LIBRARIES := core
46LOCAL_NO_STANDARD_LIBRARIES := true
47LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
48include $(BUILD_STATIC_JAVA_LIBRARY)
49
Brian Carlstromd935f312013-04-03 10:06:56 -070050# non-jarjar'd version of okhttp to compile the tests against
51include $(CLEAR_VARS)
52LOCAL_MODULE := okhttp-nojarjar
53LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010054LOCAL_SRC_FILES := $(okhttp_system_src_files)
Brian Carlstromd935f312013-04-03 10:06:56 -070055LOCAL_JAVACFLAGS := -encoding UTF-8
Kenny Rootee421d12013-04-23 22:39:04 -070056LOCAL_JAVA_LIBRARIES := conscrypt core
Brian Carlstromd935f312013-04-03 10:06:56 -070057LOCAL_NO_STANDARD_LIBRARIES := true
58LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Brian Carlstrom38381e42013-04-03 18:01:19 -070059include $(BUILD_STATIC_JAVA_LIBRARY)
Brian Carlstromd935f312013-04-03 10:06:56 -070060
61include $(CLEAR_VARS)
62LOCAL_MODULE := okhttp-tests
63LOCAL_MODULE_TAGS := optional
64LOCAL_SRC_FILES := $(okhttp_test_src_files)
65LOCAL_JAVACFLAGS := -encoding UTF-8
66LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
67LOCAL_JAVA_LIBRARIES := okhttp-nojarjar junit4-target mockwebserver bouncycastle-nojarjar
68LOCAL_NO_STANDARD_LIBRARIES := true
69LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
70include $(BUILD_STATIC_JAVA_LIBRARY)
71
jwilson2231db32012-12-26 11:37:43 -070072ifeq ($(WITH_HOST_DALVIK),true)
73 include $(CLEAR_VARS)
74 LOCAL_MODULE := okhttp-hostdex
75 LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010076 LOCAL_SRC_FILES := $(okhttp_system_src_files)
jwilson2231db32012-12-26 11:37:43 -070077 LOCAL_JAVACFLAGS := -encoding UTF-8
78 LOCAL_BUILD_HOST_DEX := true
79 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Kenny Rootee421d12013-04-23 22:39:04 -070080 LOCAL_JAVA_LIBRARIES := conscrypt-hostdex core-hostdex
Brian Carlstromcd5fb672013-04-02 13:21:23 -070081 LOCAL_NO_STANDARD_LIBRARIES := true
82 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
jwilson2231db32012-12-26 11:37:43 -070083 include $(BUILD_HOST_JAVA_LIBRARY)
84endif