Motomu Utsumi | ceb2a75 | 2022-10-04 18:38:04 +0900 | [diff] [blame^] | 1 | // Copyright (C) 2019 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 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
| 19 | java_import { |
| 20 | name: "cronet_impl_native_java", |
| 21 | jars: ["prebuilt/cronet_impl_native_java.jar"], |
| 22 | visibility: ["//visibility:private"], |
| 23 | apex_available: ["com.android.cronet"], |
| 24 | } |
| 25 | |
| 26 | java_import { |
| 27 | name: "cronet_impl_common_java", |
| 28 | jars: ["prebuilt/cronet_impl_common_java.jar"], |
| 29 | visibility: ["//visibility:private"], |
| 30 | apex_available: ["com.android.cronet"], |
| 31 | } |
| 32 | |
| 33 | java_import { |
| 34 | name: "cronet_impl_platform_java", |
| 35 | jars: ["prebuilt/cronet_impl_platform_java.jar"], |
| 36 | visibility: ["//visibility:private"], |
| 37 | apex_available: ["com.android.cronet"], |
| 38 | } |
| 39 | |
| 40 | cc_prebuilt_library_shared { |
| 41 | name: "libcronet.80.0.3986.0", |
| 42 | // STOPSHIP: Confirm if it is safe |
| 43 | shared_libs: [ |
| 44 | "libandroid", |
| 45 | "libc", |
| 46 | "libdl", |
| 47 | "liblog", |
| 48 | "libm", |
| 49 | ], |
| 50 | stl: "libc++_static", |
| 51 | target: { |
| 52 | android_arm64: { |
| 53 | srcs: ["prebuilt/libs/arm64-v8a/libcronet.80.0.3986.0.so"], |
| 54 | }, |
| 55 | android_arm: { |
| 56 | srcs: ["prebuilt/libs/armeabi-v7a/libcronet.80.0.3986.0.so"], |
| 57 | }, |
| 58 | android_x86_64: { |
| 59 | srcs: ["prebuilt/libs/x86_64/libcronet.80.0.3986.0.so"], |
| 60 | }, |
| 61 | android_x86: { |
| 62 | srcs: ["prebuilt/libs/x86/libcronet.80.0.3986.0.so"], |
| 63 | }, |
| 64 | }, |
| 65 | // These are already stripped, and restripping them just issues diagnostics. |
| 66 | strip: { |
| 67 | none: true, |
| 68 | }, |
| 69 | apex_available: ["com.android.cronet"], |
| 70 | } |
| 71 | |
| 72 | genrule { |
| 73 | name: "cronet_api-src", |
| 74 | srcs: ["prebuilt/cronet_api-src.jar"], |
| 75 | cmd: "cp $(in) $(out)", |
| 76 | out: [ |
| 77 | "cronet_api-src.srcjar", |
| 78 | ], |
| 79 | } |
| 80 | |
| 81 | java_sdk_library { |
| 82 | name: "org.chromium.net.cronet", |
| 83 | srcs: [ |
| 84 | ":cronet_api-src", |
| 85 | ], |
| 86 | // Only public non-hide methods for now. |
| 87 | // TODO: Confirm target APIs with Cronet team. |
| 88 | api_packages: [ |
| 89 | "org.chromium.net", |
| 90 | ], |
| 91 | libs: [ |
| 92 | "androidx.annotation_annotation", |
| 93 | ], |
| 94 | static_libs: [ |
| 95 | "cronet_impl_common_java", |
| 96 | "cronet_impl_native_java", |
| 97 | "cronet_impl_platform_java", |
| 98 | ], |
| 99 | // Add dependencies on files used by droiddoc_options. |
| 100 | droiddoc_option_files: [":cronet-api-current.txt"], |
| 101 | apex_available: ["com.android.cronet"], |
| 102 | unsafe_ignore_missing_latest_api: true, |
| 103 | dist_group: "android", |
| 104 | } |
| 105 | |
| 106 | // Make the current.txt available for use by the cts/tests/signature tests. |
| 107 | // ======================================================================== |
| 108 | filegroup { |
| 109 | name: "cronet-api-current.txt", |
| 110 | srcs: [ |
| 111 | "api/current.txt", |
| 112 | ], |
| 113 | } |