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 19java_defaults { 20 name: "cts_backported_fixes_java_defaults", 21 min_sdk_version: "33", // Min SDK where API for Backported Fixes is a GMS requirement. 22 sdk_version: "test_current", 23} 24 25java_library { 26 name: "cts_backported_fixes_annotation", 27 defaults: ["cts_backported_fixes_java_defaults"], 28 srcs: [ 29 "src/com/android/cts/backportedfixes/BackportedFixTest.java", 30 ], 31 host_supported: true, 32} 33 34java_library { 35 name: "cts_backported_fixes_rule", 36 defaults: ["cts_backported_fixes_java_defaults"], 37 srcs: [ 38 "src/com/android/cts/backportedfixes/BackportedFixRule.java", 39 ], 40 static_libs: [ 41 "cts_backported_fixes_annotation", 42 "cts_backported_fixes_ids", 43 "cts_backported_fixes_resolver", 44 "junit", 45 ], 46} 47 48// TODO b/382721475 - use androidx libarary when available. 49java_library { 50 name: "cts_backported_fixes_resolver", 51 defaults: ["cts_backported_fixes_java_defaults"], 52 srcs: [ 53 "src/com/android/cts/backportedfixes/resolver/*.kt", 54 ], 55 static_libs: [ 56 "android.os.flags-aconfig-java", 57 "androidx.core_core", 58 "cts_backported_fixes_bitset", 59 "cts_backported_fixes_support", 60 ], 61} 62 63// TODO b/382721475 - use androidx libarary when available. 64java_library { 65 name: "cts_backported_fixes_bitset", 66 defaults: ["cts_backported_fixes_java_defaults"], 67 srcs: [ 68 "src/com/android/cts/backportedfixes/bitset/*.kt", 69 ], 70 host_supported: true, 71} 72 73// TODO b/382721475 - use androidx libarary when available. 74java_library { 75 name: "cts_backported_fixes_support", 76 defaults: ["cts_backported_fixes_java_defaults"], 77 srcs: [ 78 "src/com/android/cts/backportedfixes/support/*.kt", 79 ], 80 host_supported: true, 81} 82 83java_library { 84 name: "cts_backported_fixes_ids", 85 defaults: ["cts_backported_fixes_java_defaults"], 86 srcs: [ 87 "src/com/android/cts/backportedfixes/ApprovedBackportedFixes.java", 88 ], 89 static_libs: [ 90 "guava", 91 "backported_fixes_proto", 92 ], 93 host_supported: true, 94 java_resources: [ 95 ":cts_backported_fixes_binpb", 96 ], 97} 98 99java_library { 100 name: "cts_backported_fixes", 101 defaults: ["cts_backported_fixes_java_defaults"], 102 static_libs: [ 103 "cts_backported_fixes_annotation", 104 "cts_backported_fixes_rule", 105 "cts_backported_fixes_ids", 106 "junit", 107 "guava", 108 ], 109} 110 111genrule { 112 name: "cts_backported_fixes_binpb", 113 defaults: ["default_backported_fixes_combiner"], 114 srcs: [":cts_backported_fixes_binpbs"], 115 out: ["com/android/cts/backportedfixes/backported_fixes.binpb"], 116} 117 118gensrcs { 119 name: "cts_backported_fixes_binpbs", 120 defaults: ["default_backported_fix_binpbs"], 121 output_extension: "binpb", 122 srcs: [ 123 "approved/*.txtpb", 124 ], 125} 126 127java_test_host { 128 name: "cts_backported_fixes_bitset_tests", 129 srcs: [ 130 "tests/com/android/cts/backportedfixes/bitset/*.java", 131 "tests/com/android/cts/backportedfixes/bitset/*.kt", 132 ], 133 static_libs: [ 134 "cts_backported_fixes_bitset", 135 "junit", 136 "truth", 137 ], 138 test_options: { 139 unit_test: true, 140 }, 141 test_suites: ["general-tests"], 142} 143