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