summaryrefslogtreecommitdiffstats
path: root/Android.mk
blob: 4d0bdc7c2636d2fad0bfe9707397f0bc1f25726f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH:= $(call my-dir)

apache_http_src_files := \
    $(call all-java-files-under,src) \
    $(call all-java-files-under,android)

apache_http_java_libs := conscrypt

apache_http_packages := $(strip \
  com.android.internal.http.multipart \
  org.apache.commons.logging \
  org.apache.commons.logging.impl \
  org.apache.commons.codec \
  org.apache.commons.codec.net \
  org.apache.commons.codec.language \
  org.apache.commons.codec.binary \
  org.apache.http.params \
  org.apache.http \
  org.apache.http.client.params \
  org.apache.http.client \
  org.apache.http.client.utils \
  org.apache.http.client.protocol \
  org.apache.http.client.methods \
  org.apache.http.client.entity \
  org.apache.http.protocol \
  org.apache.http.impl \
  org.apache.http.impl.client \
  org.apache.http.impl.auth \
  org.apache.http.impl.cookie \
  org.apache.http.impl.entity \
  org.apache.http.impl.io \
  org.apache.http.impl.conn \
  org.apache.http.impl.conn.tsccm \
  org.apache.http.message \
  org.apache.http.auth.params \
  org.apache.http.auth \
  org.apache.http.cookie.params \
  org.apache.http.cookie \
  org.apache.http.util \
  org.apache.http.entity \
  org.apache.http.io \
  org.apache.http.conn.params \
  org.apache.http.conn \
  org.apache.http.conn.routing \
  org.apache.http.conn.scheme \
  org.apache.http.conn.util \
  android.net.compatibility \
  android.net.http \
)

include $(CLEAR_VARS)
LOCAL_MODULE := org.apache.http.legacy.boot
LOCAL_MODULE_TAGS := optional
LOCAL_JAVA_LIBRARIES := $(apache_http_java_libs)
LOCAL_SRC_FILES := $(apache_http_src_files)
LOCAL_SDK_VERSION := 21
LOCAL_MODULE_TAGS := optional
include $(BUILD_JAVA_LIBRARY)

##############################################
# Generate the stub source files
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(apache_http_src_files)
LOCAL_SRC_FILES += \
    ../../frameworks/base/core/java/org/apache/http/conn/ConnectTimeoutException.java \
    ../../frameworks/base/core/java/org/apache/http/conn/scheme/HostNameResolver.java \
    ../../frameworks/base/core/java/org/apache/http/conn/scheme/LayeredSocketFactory.java \
    ../../frameworks/base/core/java/org/apache/http/conn/scheme/SocketFactory.java \
    ../../frameworks/base/core/java/org/apache/http/conn/ssl/AbstractVerifier.java \
    ../../frameworks/base/core/java/org/apache/http/conn/ssl/AllowAllHostnameVerifier.java \
    ../../frameworks/base/core/java/org/apache/http/conn/ssl/AndroidDistinguishedNameParser.java \
    ../../frameworks/base/core/java/org/apache/http/conn/ssl/BrowserCompatHostnameVerifier.java \
    ../../frameworks/base/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java \
    ../../frameworks/base/core/java/org/apache/http/conn/ssl/StrictHostnameVerifier.java \
    ../../frameworks/base/core/java/org/apache/http/conn/ssl/X509HostnameVerifier.java \
    ../../frameworks/base/core/java/org/apache/http/params/CoreConnectionPNames.java \
    ../../frameworks/base/core/java/org/apache/http/params/HttpConnectionParams.java \
    ../../frameworks/base/core/java/org/apache/http/params/HttpParams.java \
    ../../frameworks/base/core/java/android/net/http/HttpResponseCache.java \
    ../../frameworks/base/core/java/android/net/http/SslCertificate.java \
    ../../frameworks/base/core/java/android/net/http/SslError.java \
    ../../frameworks/base/core/java/com/android/internal/util/HexDump.java \

LOCAL_JAVA_LIBRARIES := bouncycastle okhttp $(apache_http_java_libs)
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src \
  $(LOCAL_PATH)/android \
  $(LOCAL_PATH)/../../frameworks/base/core/java/org/apache

LOCAL_DROIDDOC_OPTIONS:= \
    -stubpackages $(subst $(space),:,$(apache_http_packages)) \
    -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/src \
    -nodocs

LOCAL_SDK_VERSION := 21
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_MODULE := apache-http-stubs-gen

include $(BUILD_DROIDDOC)
apache_http_stubs_gen_stamp := $(full_target)

# For unbundled build we'll use the prebuilt jar from prebuilts/sdk.
ifeq (,$(TARGET_BUILD_APPS))
###############################################
# Build the stub source files into a jar.
include $(CLEAR_VARS)
LOCAL_MODULE := org.apache.http.legacy
LOCAL_SOURCE_FILES_ALL_GENERATED := true
LOCAL_SDK_VERSION := 21
include $(BUILD_STATIC_JAVA_LIBRARY)

# Make sure to run droiddoc first to generate the stub source files.
$(full_classes_compiled_jar) : $(apache_http_stubs_gen_stamp)
$(full_classes_jack) : $(apache_http_stubs_gen_stamp)

# Archive a copy of the classes.jar in SDK build.
$(call dist-for-goals,sdk win_sdk,$(full_classes_jar):org.apache.http.legacy.jar)
endif  # not TARGET_BUILD_APPS

apache_http_src_files :=
apache_http_java_libs :=
apache_http_packages :=
apache_http_stubs_gen_stamp :=