blob: 6a1151f912d5d9ec33738822693f4bdd03d6dacc [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)
Neil Fuller3c938a32014-02-19 09:40:26 +000019okhttp_common_src_files += $(call all-java-files-under,okio/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
Neil Fuller3c938a32014-02-19 09:40:26 +000023okhttp_test_src_files := $(call all-java-files-under,okhttp-tests/src/test/java)
Narayan Kamath166772b2013-11-04 16:04:55 +000024okhttp_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))
Brian Carlstromd935f312013-04-03 10:06:56 -070026
Narayan Kamath153d0952012-08-09 13:14:26 +010027include $(CLEAR_VARS)
28LOCAL_MODULE := okhttp
29LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010030LOCAL_SRC_FILES := $(okhttp_system_src_files)
jwilson2231db32012-12-26 11:37:43 -070031LOCAL_JAVACFLAGS := -encoding UTF-8
32LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Kenny Rootee421d12013-04-23 22:39:04 -070033LOCAL_JAVA_LIBRARIES := conscrypt core
Brian Carlstromcd5fb672013-04-02 13:21:23 -070034LOCAL_NO_STANDARD_LIBRARIES := true
35LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Narayan Kamath153d0952012-08-09 13:14:26 +010036include $(BUILD_JAVA_LIBRARY)
jwilson2231db32012-12-26 11:37:43 -070037
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010038# 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
44LOCAL_JAVA_LIBRARIES := core
45LOCAL_NO_STANDARD_LIBRARIES := true
46LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
47include $(BUILD_STATIC_JAVA_LIBRARY)
48
Brian Carlstromd935f312013-04-03 10:06:56 -070049# non-jarjar'd version of okhttp to compile the tests against
50include $(CLEAR_VARS)
51LOCAL_MODULE := okhttp-nojarjar
52LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010053LOCAL_SRC_FILES := $(okhttp_system_src_files)
Brian Carlstromd935f312013-04-03 10:06:56 -070054LOCAL_JAVACFLAGS := -encoding UTF-8
Kenny Rootee421d12013-04-23 22:39:04 -070055LOCAL_JAVA_LIBRARIES := conscrypt core
Brian Carlstromd935f312013-04-03 10:06:56 -070056LOCAL_NO_STANDARD_LIBRARIES := true
57LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Brian Carlstrom38381e42013-04-03 18:01:19 -070058include $(BUILD_STATIC_JAVA_LIBRARY)
Brian Carlstromd935f312013-04-03 10:06:56 -070059
60include $(CLEAR_VARS)
Neil Fuller98d2d602014-05-29 11:58:32 +010061LOCAL_MODULE := okhttp-tests-nojarjar
Brian Carlstromd935f312013-04-03 10:06:56 -070062LOCAL_MODULE_TAGS := optional
63LOCAL_SRC_FILES := $(okhttp_test_src_files)
64LOCAL_JAVACFLAGS := -encoding UTF-8
Neil Fuller98d2d602014-05-29 11:58:32 +010065LOCAL_JAVA_LIBRARIES := okhttp-nojarjar junit4-target bouncycastle-nojarjar
Brian Carlstromd935f312013-04-03 10:06:56 -070066LOCAL_NO_STANDARD_LIBRARIES := true
67LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
68include $(BUILD_STATIC_JAVA_LIBRARY)
69
jwilson2231db32012-12-26 11:37:43 -070070ifeq ($(WITH_HOST_DALVIK),true)
71 include $(CLEAR_VARS)
72 LOCAL_MODULE := okhttp-hostdex
73 LOCAL_MODULE_TAGS := optional
Allan Wojciechowskie7f03912013-05-28 18:16:54 +010074 LOCAL_SRC_FILES := $(okhttp_system_src_files)
jwilson2231db32012-12-26 11:37:43 -070075 LOCAL_JAVACFLAGS := -encoding UTF-8
jwilson2231db32012-12-26 11:37:43 -070076 LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
Narayan Kamath565b4722013-10-28 14:25:49 +000077 LOCAL_JAVA_LIBRARIES := conscrypt-hostdex
Brian Carlstromcd5fb672013-04-02 13:21:23 -070078 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Narayan Kamath565b4722013-10-28 14:25:49 +000079 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
jwilson2231db32012-12-26 11:37:43 -070080endif