blob: 17681b2d02b0f04240f6360be2faae0b4c09af7d [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
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010018okhttp_common_src_files := $(call all-java-files-under,src/main/java)
19okhttp_system_src_files := $(filter-out %/Platform.java, $(okhttp_common_src_files))
20okhttp_system_src_files += $(call all-java-files-under, android/main/java)
jwilson2231db32012-12-26 11:37:43 -070021
Brian Carlstromd935f312013-04-03 10:06:56 -070022okhttp_test_src_files := $(call all-java-files-under,src/test/java)
23okhttp_test_src_files := $(filter-out src/test/java/com/squareup/okhttp/internal/spdy/SpdyServer.java, $(okhttp_test_src_files))
24
Narayan Kamath153d0952012-08-09 13:14:26 +010025include $(CLEAR_VARS)
26LOCAL_MODULE := okhttp
27LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010028LOCAL_SRC_FILES := $(okhttp_system_src_files)
jwilson2231db32012-12-26 11:37:43 -070029LOCAL_JAVACFLAGS := -encoding UTF-8
30LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Kenny Rootee421d12013-04-23 22:39:04 -070031LOCAL_JAVA_LIBRARIES := conscrypt core
Brian Carlstromcd5fb672013-04-02 13:21:23 -070032LOCAL_NO_STANDARD_LIBRARIES := true
33LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Narayan Kamath153d0952012-08-09 13:14:26 +010034include $(BUILD_JAVA_LIBRARY)
jwilson2231db32012-12-26 11:37:43 -070035
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010036# static version of okhttp for inclusion in apps targeting older releases
37include $(CLEAR_VARS)
38LOCAL_MODULE := okhttp-static
39LOCAL_MODULE_TAGS := optional
40LOCAL_SRC_FILES := $(okhttp_common_src_files)
41LOCAL_JAVACFLAGS := -encoding UTF-8
42LOCAL_JAVA_LIBRARIES := core
43LOCAL_NO_STANDARD_LIBRARIES := true
44LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
45include $(BUILD_STATIC_JAVA_LIBRARY)
46
Brian Carlstromd935f312013-04-03 10:06:56 -070047# non-jarjar'd version of okhttp to compile the tests against
48include $(CLEAR_VARS)
49LOCAL_MODULE := okhttp-nojarjar
50LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010051LOCAL_SRC_FILES := $(okhttp_system_src_files)
Brian Carlstromd935f312013-04-03 10:06:56 -070052LOCAL_JAVACFLAGS := -encoding UTF-8
Kenny Rootee421d12013-04-23 22:39:04 -070053LOCAL_JAVA_LIBRARIES := conscrypt core
Brian Carlstromd935f312013-04-03 10:06:56 -070054LOCAL_NO_STANDARD_LIBRARIES := true
55LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Brian Carlstrom38381e42013-04-03 18:01:19 -070056include $(BUILD_STATIC_JAVA_LIBRARY)
Brian Carlstromd935f312013-04-03 10:06:56 -070057
58include $(CLEAR_VARS)
59LOCAL_MODULE := okhttp-tests
60LOCAL_MODULE_TAGS := optional
61LOCAL_SRC_FILES := $(okhttp_test_src_files)
62LOCAL_JAVACFLAGS := -encoding UTF-8
63LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
64LOCAL_JAVA_LIBRARIES := okhttp-nojarjar junit4-target mockwebserver bouncycastle-nojarjar
65LOCAL_NO_STANDARD_LIBRARIES := true
66LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
67include $(BUILD_STATIC_JAVA_LIBRARY)
68
jwilson2231db32012-12-26 11:37:43 -070069ifeq ($(WITH_HOST_DALVIK),true)
70 include $(CLEAR_VARS)
71 LOCAL_MODULE := okhttp-hostdex
72 LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010073 LOCAL_SRC_FILES := $(okhttp_system_src_files)
jwilson2231db32012-12-26 11:37:43 -070074 LOCAL_JAVACFLAGS := -encoding UTF-8
75 LOCAL_BUILD_HOST_DEX := true
76 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Kenny Rootee421d12013-04-23 22:39:04 -070077 LOCAL_JAVA_LIBRARIES := conscrypt-hostdex core-hostdex
Brian Carlstromcd5fb672013-04-02 13:21:23 -070078 LOCAL_NO_STANDARD_LIBRARIES := true
79 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
jwilson2231db32012-12-26 11:37:43 -070080 include $(BUILD_HOST_JAVA_LIBRARY)
81endif