Narayan Kamath | df5e4d4 | 2015-01-20 12:55:52 +0000 | [diff] [blame] | 1 | # Copyright (C) 2014 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # |
| 15 | LOCAL_PATH:= $(call my-dir) |
| 16 | |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 17 | apache_http_src_files := \ |
Narayan Kamath | a8b46a3 | 2014-11-27 18:15:37 +0000 | [diff] [blame] | 18 | $(call all-java-files-under,src) \ |
| 19 | $(call all-java-files-under,android) |
Narayan Kamath | df5e4d4 | 2015-01-20 12:55:52 +0000 | [diff] [blame] | 20 | |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 21 | apache_http_java_libs := conscrypt |
Narayan Kamath | 3e38746 | 2015-01-23 15:31:00 +0000 | [diff] [blame] | 22 | |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 23 | apache_http_packages := $(strip \ |
| 24 | com.android.internal.http.multipart \ |
| 25 | org.apache.commons.logging \ |
| 26 | org.apache.commons.logging.impl \ |
| 27 | org.apache.commons.codec \ |
| 28 | org.apache.commons.codec.net \ |
| 29 | org.apache.commons.codec.language \ |
| 30 | org.apache.commons.codec.binary \ |
| 31 | org.apache.http.params \ |
| 32 | org.apache.http \ |
| 33 | org.apache.http.client.params \ |
| 34 | org.apache.http.client \ |
| 35 | org.apache.http.client.utils \ |
| 36 | org.apache.http.client.protocol \ |
| 37 | org.apache.http.client.methods \ |
| 38 | org.apache.http.client.entity \ |
| 39 | org.apache.http.protocol \ |
| 40 | org.apache.http.impl \ |
| 41 | org.apache.http.impl.client \ |
| 42 | org.apache.http.impl.auth \ |
| 43 | org.apache.http.impl.cookie \ |
| 44 | org.apache.http.impl.entity \ |
| 45 | org.apache.http.impl.io \ |
| 46 | org.apache.http.impl.conn \ |
| 47 | org.apache.http.impl.conn.tsccm \ |
| 48 | org.apache.http.message \ |
| 49 | org.apache.http.auth.params \ |
| 50 | org.apache.http.auth \ |
| 51 | org.apache.http.cookie.params \ |
| 52 | org.apache.http.cookie \ |
| 53 | org.apache.http.util \ |
| 54 | org.apache.http.entity \ |
| 55 | org.apache.http.io \ |
| 56 | org.apache.http.conn.params \ |
| 57 | org.apache.http.conn \ |
| 58 | org.apache.http.conn.routing \ |
| 59 | org.apache.http.conn.scheme \ |
| 60 | org.apache.http.conn.util \ |
| 61 | android.net.compatibility \ |
| 62 | android.net.http \ |
| 63 | ) |
| 64 | |
| 65 | include $(CLEAR_VARS) |
Narayan Kamath | 3049bb7 | 2015-04-09 13:06:40 +0100 | [diff] [blame] | 66 | LOCAL_MODULE := org.apache.http.legacy.boot |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 67 | LOCAL_MODULE_TAGS := optional |
| 68 | LOCAL_JAVA_LIBRARIES := $(apache_http_java_libs) |
| 69 | LOCAL_SRC_FILES := $(apache_http_src_files) |
| 70 | LOCAL_SDK_VERSION := 21 |
Narayan Kamath | df5e4d4 | 2015-01-20 12:55:52 +0000 | [diff] [blame] | 71 | LOCAL_MODULE_TAGS := optional |
Paul Duffin | e3f3d3e | 2017-09-14 13:17:57 +0100 | [diff] [blame] | 72 | # Previously, this JAR was included on the bootclasspath so was compiled using |
| 73 | # the speed-profile. ensures that it continues to be compiled using the |
| 74 | # speed-profile in order to avoid regressing the performance, particularly of |
| 75 | # app launch times. Without this it would be compiled using quicken (which is |
| 76 | # interpreter + JIT) and so would be slower. |
| 77 | LOCAL_DEX_PREOPT_GENERATE_PROFILE := true |
| 78 | LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING := $(LOCAL_PATH)/art-profile/$(LOCAL_MODULE).prof.txt |
Narayan Kamath | df5e4d4 | 2015-01-20 12:55:52 +0000 | [diff] [blame] | 79 | include $(BUILD_JAVA_LIBRARY) |
Ying Wang | 30a19d9 | 2015-02-25 12:22:35 -0800 | [diff] [blame] | 80 | |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 81 | ############################################## |
| 82 | # Generate the stub source files |
| 83 | include $(CLEAR_VARS) |
| 84 | LOCAL_SRC_FILES := $(apache_http_src_files) |
Narayan Kamath | 0399abc | 2016-02-08 17:04:51 +0000 | [diff] [blame] | 85 | LOCAL_SRC_FILES += \ |
| 86 | ../../frameworks/base/core/java/org/apache/http/conn/ConnectTimeoutException.java \ |
| 87 | ../../frameworks/base/core/java/org/apache/http/conn/scheme/HostNameResolver.java \ |
| 88 | ../../frameworks/base/core/java/org/apache/http/conn/scheme/LayeredSocketFactory.java \ |
| 89 | ../../frameworks/base/core/java/org/apache/http/conn/scheme/SocketFactory.java \ |
| 90 | ../../frameworks/base/core/java/org/apache/http/conn/ssl/AbstractVerifier.java \ |
| 91 | ../../frameworks/base/core/java/org/apache/http/conn/ssl/AllowAllHostnameVerifier.java \ |
| 92 | ../../frameworks/base/core/java/org/apache/http/conn/ssl/AndroidDistinguishedNameParser.java \ |
| 93 | ../../frameworks/base/core/java/org/apache/http/conn/ssl/BrowserCompatHostnameVerifier.java \ |
| 94 | ../../frameworks/base/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java \ |
| 95 | ../../frameworks/base/core/java/org/apache/http/conn/ssl/StrictHostnameVerifier.java \ |
| 96 | ../../frameworks/base/core/java/org/apache/http/conn/ssl/X509HostnameVerifier.java \ |
| 97 | ../../frameworks/base/core/java/org/apache/http/params/CoreConnectionPNames.java \ |
| 98 | ../../frameworks/base/core/java/org/apache/http/params/HttpConnectionParams.java \ |
| 99 | ../../frameworks/base/core/java/org/apache/http/params/HttpParams.java \ |
| 100 | ../../frameworks/base/core/java/android/net/http/HttpResponseCache.java \ |
| 101 | ../../frameworks/base/core/java/android/net/http/SslCertificate.java \ |
| 102 | ../../frameworks/base/core/java/android/net/http/SslError.java \ |
Ian Rogers | dde4574 | 2016-04-29 16:21:35 -0700 | [diff] [blame] | 103 | ../../frameworks/base/core/java/com/android/internal/util/HexDump.java \ |
Narayan Kamath | 0399abc | 2016-02-08 17:04:51 +0000 | [diff] [blame] | 104 | |
Ian Rogers | dde4574 | 2016-04-29 16:21:35 -0700 | [diff] [blame] | 105 | LOCAL_JAVA_LIBRARIES := bouncycastle okhttp $(apache_http_java_libs) |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 106 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 107 | LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)/src \ |
Narayan Kamath | 0399abc | 2016-02-08 17:04:51 +0000 | [diff] [blame] | 108 | $(LOCAL_PATH)/android \ |
| 109 | $(LOCAL_PATH)/../../frameworks/base/core/java/org/apache |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 110 | |
Paul Duffin | 03a9565 | 2017-07-14 13:48:42 +0100 | [diff] [blame] | 111 | APACHE_HTTP_LEGACY_OUTPUT_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/org.apache.http.legacy.stubs_intermediates/api.txt |
| 112 | APACHE_HTTP_LEGACY_OUTPUT_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/org.apache.http.legacy.stubs_intermediates/removed.txt |
| 113 | |
| 114 | APACHE_HTTP_LEGACY_API_FILE := $(LOCAL_PATH)/api/apache-http-legacy-current.txt |
| 115 | APACHE_HTTP_LEGACY_REMOVED_API_FILE := $(LOCAL_PATH)/api/apache-http-legacy-removed.txt |
| 116 | |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 117 | LOCAL_DROIDDOC_OPTIONS:= \ |
| 118 | -stubpackages $(subst $(space),:,$(apache_http_packages)) \ |
Narayan Kamath | 3049bb7 | 2015-04-09 13:06:40 +0100 | [diff] [blame] | 119 | -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/src \ |
Paul Duffin | 03a9565 | 2017-07-14 13:48:42 +0100 | [diff] [blame] | 120 | -nodocs \ |
| 121 | -api $(APACHE_HTTP_LEGACY_OUTPUT_API_FILE) \ |
| 122 | -removedApi $(APACHE_HTTP_LEGACY_OUTPUT_REMOVED_API_FILE) \ |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 123 | |
| 124 | LOCAL_SDK_VERSION := 21 |
| 125 | LOCAL_UNINSTALLABLE_MODULE := true |
| 126 | LOCAL_MODULE := apache-http-stubs-gen |
| 127 | |
| 128 | include $(BUILD_DROIDDOC) |
Paul Duffin | 03a9565 | 2017-07-14 13:48:42 +0100 | [diff] [blame] | 129 | |
| 130 | # Remember the target that will trigger the code generation. |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 131 | apache_http_stubs_gen_stamp := $(full_target) |
| 132 | |
Paul Duffin | 03a9565 | 2017-07-14 13:48:42 +0100 | [diff] [blame] | 133 | # Add some additional dependencies |
| 134 | $(APACHE_HTTP_LEGACY_OUTPUT_API_FILE): $(full_target) |
| 135 | $(APACHE_HTTP_LEGACY_OUTPUT_REMOVED_API_FILE): $(full_target) |
| 136 | |
Ying Wang | 80540ef | 2015-04-14 18:42:03 -0700 | [diff] [blame] | 137 | # For unbundled build we'll use the prebuilt jar from prebuilts/sdk. |
Ying Wang | cc9d128 | 2016-02-18 20:02:29 +0000 | [diff] [blame] | 138 | ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 139 | ############################################### |
| 140 | # Build the stub source files into a jar. |
| 141 | include $(CLEAR_VARS) |
Narayan Kamath | 3049bb7 | 2015-04-09 13:06:40 +0100 | [diff] [blame] | 142 | LOCAL_MODULE := org.apache.http.legacy |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 143 | LOCAL_SOURCE_FILES_ALL_GENERATED := true |
Ying Wang | 80540ef | 2015-04-14 18:42:03 -0700 | [diff] [blame] | 144 | LOCAL_SDK_VERSION := 21 |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 145 | # Make sure to run droiddoc first to generate the stub source files. |
Colin Cross | ad1d58e | 2017-05-30 10:41:08 -0700 | [diff] [blame] | 146 | LOCAL_ADDITIONAL_DEPENDENCIES := $(apache_http_stubs_gen_stamp) |
| 147 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 148 | |
Ying Wang | 30a19d9 | 2015-02-25 12:22:35 -0800 | [diff] [blame] | 149 | # Archive a copy of the classes.jar in SDK build. |
| 150 | $(call dist-for-goals,sdk win_sdk,$(full_classes_jar):org.apache.http.legacy.jar) |
Paul Duffin | 03a9565 | 2017-07-14 13:48:42 +0100 | [diff] [blame] | 151 | |
| 152 | # Check that the org.apache.http.legacy.stubs library has not changed |
| 153 | # =================================================================== |
| 154 | |
| 155 | # Check that the API we're building hasn't changed from the not-yet-released |
| 156 | # SDK version. |
| 157 | $(eval $(call check-api, \ |
| 158 | check-apache-http-legacy-api-current, \ |
| 159 | $(APACHE_HTTP_LEGACY_API_FILE), \ |
| 160 | $(APACHE_HTTP_LEGACY_OUTPUT_API_FILE), \ |
| 161 | $(APACHE_HTTP_LEGACY_REMOVED_API_FILE), \ |
| 162 | $(APACHE_HTTP_LEGACY_OUTPUT_REMOVED_API_FILE), \ |
| 163 | -error 2 -error 3 -error 4 -error 5 -error 6 \ |
| 164 | -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ |
| 165 | -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 \ |
| 166 | -error 25 -error 26 -error 27, \ |
| 167 | cat $(LOCAL_PATH)/api/apicheck_msg_apache_http_legacy.txt, \ |
| 168 | check-apache-http-legacy-api, \ |
| 169 | $(call doc-timestamp-for,apache-http-stubs-gen) \ |
| 170 | )) |
| 171 | |
| 172 | .PHONY: check-apache-http-legacy-api |
| 173 | checkapi: check-apache-http-legacy-api |
| 174 | |
| 175 | .PHONY: update-apache-http-legacy-api |
| 176 | update-api: update-apache-http-legacy-api |
| 177 | |
| 178 | update-apache-http-legacy-api: $(APACHE_HTTP_LEGACY_OUTPUT_API_FILE) | $(ACP) |
| 179 | @echo Copying apache-http-legacy-current.txt |
| 180 | $(hide) $(ACP) $(APACHE_HTTP_LEGACY_OUTPUT_API_FILE) $(APACHE_HTTP_LEGACY_API_FILE) |
| 181 | @echo Copying apache-http-legacy-removed.txt |
| 182 | $(hide) $(ACP) $(APACHE_HTTP_LEGACY_OUTPUT_REMOVED_API_FILE) $(APACHE_HTTP_LEGACY_REMOVED_API_FILE) |
| 183 | |
Ying Wang | 80540ef | 2015-04-14 18:42:03 -0700 | [diff] [blame] | 184 | endif # not TARGET_BUILD_APPS |
Narayan Kamath | abddcd8 | 2015-04-08 18:27:53 +0100 | [diff] [blame] | 185 | |
| 186 | apache_http_src_files := |
| 187 | apache_http_java_libs := |
| 188 | apache_http_packages := |
| 189 | apache_http_stubs_gen_stamp := |