xref: /aosp_15_r20/external/grpc-grpc-java/annotation-stubs/Android.bp (revision e07d83d3ffcef9ecfc9f7f475418ec639ff0e5fe)
1*e07d83d3SAndroid Build Coastguard Worker// Copyright (C) 2018 The Android Open Source Project
2*e07d83d3SAndroid Build Coastguard Worker//
3*e07d83d3SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*e07d83d3SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*e07d83d3SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*e07d83d3SAndroid Build Coastguard Worker//
7*e07d83d3SAndroid Build Coastguard Worker//      http://www.apache.org/licenses/LICENSE-2.0
8*e07d83d3SAndroid Build Coastguard Worker//
9*e07d83d3SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*e07d83d3SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*e07d83d3SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*e07d83d3SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*e07d83d3SAndroid Build Coastguard Worker// limitations under the License.
14*e07d83d3SAndroid Build Coastguard Worker//
15*e07d83d3SAndroid Build Coastguard Worker
16*e07d83d3SAndroid Build Coastguard Workerpackage {
17*e07d83d3SAndroid Build Coastguard Worker    // See: http://go/android-license-faq
18*e07d83d3SAndroid Build Coastguard Worker    // A large-scale-change added 'default_applicable_licenses' to import
19*e07d83d3SAndroid Build Coastguard Worker    // all of the 'license_kinds' from "external_grpc-grpc-java_license"
20*e07d83d3SAndroid Build Coastguard Worker    // to get the below license kinds:
21*e07d83d3SAndroid Build Coastguard Worker    //   SPDX-license-identifier-Apache-2.0
22*e07d83d3SAndroid Build Coastguard Worker    default_applicable_licenses: ["external_grpc-grpc-java_license"],
23*e07d83d3SAndroid Build Coastguard Worker}
24*e07d83d3SAndroid Build Coastguard Worker
25*e07d83d3SAndroid Build Coastguard Workerjava_library {
26*e07d83d3SAndroid Build Coastguard Worker    name: "grpc-java-annotation-stubs",
27*e07d83d3SAndroid Build Coastguard Worker    host_supported: true,
28*e07d83d3SAndroid Build Coastguard Worker    srcs: [
29*e07d83d3SAndroid Build Coastguard Worker        ":grpc-java-annotation-stubs-srcjar",
30*e07d83d3SAndroid Build Coastguard Worker    ],
31*e07d83d3SAndroid Build Coastguard Worker    sdk_version: "current",
32*e07d83d3SAndroid Build Coastguard Worker    min_sdk_version: "30",
33*e07d83d3SAndroid Build Coastguard Worker    // b/267831518: Pin tradefed and dependencies to Java 11.
34*e07d83d3SAndroid Build Coastguard Worker    java_version: "11",
35*e07d83d3SAndroid Build Coastguard Worker    apex_available: [
36*e07d83d3SAndroid Build Coastguard Worker        "//apex_available:platform",
37*e07d83d3SAndroid Build Coastguard Worker        "com.android.adservices",
38*e07d83d3SAndroid Build Coastguard Worker        "com.android.devicelock",
39*e07d83d3SAndroid Build Coastguard Worker        "com.android.extservices",
40*e07d83d3SAndroid Build Coastguard Worker    ],
41*e07d83d3SAndroid Build Coastguard Worker    target: {
42*e07d83d3SAndroid Build Coastguard Worker        windows: {
43*e07d83d3SAndroid Build Coastguard Worker            enabled: true,
44*e07d83d3SAndroid Build Coastguard Worker        },
45*e07d83d3SAndroid Build Coastguard Worker    },
46*e07d83d3SAndroid Build Coastguard Worker    is_stubs_module: true,
47*e07d83d3SAndroid Build Coastguard Worker}
48*e07d83d3SAndroid Build Coastguard Worker
49*e07d83d3SAndroid Build Coastguard Workerpython_binary_host {
50*e07d83d3SAndroid Build Coastguard Worker    name: "gen_annotations",
51*e07d83d3SAndroid Build Coastguard Worker    srcs: [
52*e07d83d3SAndroid Build Coastguard Worker        "gen_annotations.py",
53*e07d83d3SAndroid Build Coastguard Worker    ],
54*e07d83d3SAndroid Build Coastguard Worker    version: {
55*e07d83d3SAndroid Build Coastguard Worker        py3: {
56*e07d83d3SAndroid Build Coastguard Worker            embedded_launcher: true,
57*e07d83d3SAndroid Build Coastguard Worker        },
58*e07d83d3SAndroid Build Coastguard Worker    },
59*e07d83d3SAndroid Build Coastguard Worker}
60*e07d83d3SAndroid Build Coastguard Worker
61*e07d83d3SAndroid Build Coastguard Workergensrcs {
62*e07d83d3SAndroid Build Coastguard Worker    name: "grpc-java-annotation-stubs-srcjar",
63*e07d83d3SAndroid Build Coastguard Worker    tools: [
64*e07d83d3SAndroid Build Coastguard Worker        "soong_zip",
65*e07d83d3SAndroid Build Coastguard Worker        "gen_annotations",
66*e07d83d3SAndroid Build Coastguard Worker    ],
67*e07d83d3SAndroid Build Coastguard Worker    cmd: "$(location gen_annotations) $(genDir)/java && " +
68*e07d83d3SAndroid Build Coastguard Worker         "$(location soong_zip) -jar -o $(out) -C $(genDir)/java -D $(genDir)/java",
69*e07d83d3SAndroid Build Coastguard Worker    srcs: [
70*e07d83d3SAndroid Build Coastguard Worker        // A dummy source file since Soong crashes otherwise.
71*e07d83d3SAndroid Build Coastguard Worker        "Android.bp",
72*e07d83d3SAndroid Build Coastguard Worker    ],
73*e07d83d3SAndroid Build Coastguard Worker    output_extension: "srcjar",
74*e07d83d3SAndroid Build Coastguard Worker}
75