xref: /aosp_15_r20/cts/backported_fixes/Android.bp (revision b7c941bb3fa97aba169d73cee0bed2de8ac964bf)
1// Copyright (C) 2024 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
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19// TODO: b/372899205 - move Annotation and Rules to a common cts location.
20
21java_library {
22    name: "cts_backported_fixes_annotation",
23    srcs: [
24        "src/com/android/cts/backportedfixes/BackportedFixTest.java",
25    ],
26
27    sdk_version: "test_current",
28    host_supported: true,
29}
30
31java_library {
32    name: "cts_backported_fixes_rule",
33    srcs: [
34        "src/com/android/cts/backportedfixes/BackportedFixRule.java",
35    ],
36    static_libs: [
37        "cts_backported_fixes_annotation",
38        "cts_backported_fixes_ids",
39        "junit",
40    ],
41    sdk_version: "test_current",
42
43}
44
45java_library {
46    name: "cts_backported_fixes_proto",
47    srcs: [
48        "backported_fixes.proto",
49    ],
50    sdk_version: "test_current",
51    host_supported: true,
52}
53
54java_library {
55    name: "cts_backported_fixes_ids",
56    srcs: [
57        "src/com/android/cts/backportedfixes/ApprovedBackportedFixes.java",
58    ],
59    static_libs: [
60        "guava",
61        "cts_backported_fixes_proto",
62    ],
63    sdk_version: "test_current",
64    host_supported: true,
65    java_resources: [
66        ":cts_backported_fixes_binpb",
67    ],
68}
69
70java_library {
71    name: "cts_backported_fixes",
72    static_libs: [
73        "cts_backported_fixes_annotation",
74        "cts_backported_fixes_rule",
75        "cts_backported_fixes_ids",
76        "junit",
77        "guava",
78    ],
79    sdk_version: "test_current",
80}
81
82genrule {
83    name: "cts_backported_fixes_binpb",
84    tools: ["aprotoc"],
85    srcs: [
86        "backported_fixes.proto",
87        "approved/backported_fixes.txtpb",
88    ],
89    out: ["com/android/cts/backportedfixes/backported_fixes.binpb"],
90    cmd: "$(location aprotoc)  " +
91        " --encode=com.android.cts.backportedfixes.BackportedFixes" +
92        "  $(location backported_fixes.proto)" +
93        " < $(location approved/backported_fixes.txtpb)" +
94        " > $(location com/android/cts/backportedfixes/backported_fixes.binpb)",
95}
96