1*9e94795aSAndroid Build Coastguard Worker// Copyright 2024 Google Inc. All rights reserved. 2*9e94795aSAndroid Build Coastguard Worker// 3*9e94795aSAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 4*9e94795aSAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 5*9e94795aSAndroid Build Coastguard Worker// You may obtain a copy of the License at 6*9e94795aSAndroid Build Coastguard Worker// 7*9e94795aSAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 8*9e94795aSAndroid Build Coastguard Worker// 9*9e94795aSAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 10*9e94795aSAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 11*9e94795aSAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*9e94795aSAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 13*9e94795aSAndroid Build Coastguard Worker// limitations under the License. 14*9e94795aSAndroid Build Coastguard Worker 15*9e94795aSAndroid Build Coastguard Workerpackage { 16*9e94795aSAndroid Build Coastguard Worker default_applicable_licenses: ["Android-Apache-2.0"], 17*9e94795aSAndroid Build Coastguard Worker default_team: "trendy_team_android_media_reliability", 18*9e94795aSAndroid Build Coastguard Worker} 19*9e94795aSAndroid Build Coastguard Worker 20*9e94795aSAndroid Build Coastguard Workergenrule { 21*9e94795aSAndroid Build Coastguard Worker name: "applied_backported_fixes", 22*9e94795aSAndroid Build Coastguard Worker tools: ["applied_backported_fixes_main"], 23*9e94795aSAndroid Build Coastguard Worker srcs: [":applied_backported_fix_binpbs"], 24*9e94795aSAndroid Build Coastguard Worker out: ["applied_backported_fixes.prop"], 25*9e94795aSAndroid Build Coastguard Worker cmd: "$(location applied_backported_fixes_main)" + 26*9e94795aSAndroid Build Coastguard Worker " -p $(location applied_backported_fixes.prop)" + 27*9e94795aSAndroid Build Coastguard Worker " $(in)", 28*9e94795aSAndroid Build Coastguard Worker} 29*9e94795aSAndroid Build Coastguard Worker 30*9e94795aSAndroid Build Coastguard Workerjava_library { 31*9e94795aSAndroid Build Coastguard Worker name: "backported_fixes_proto", 32*9e94795aSAndroid Build Coastguard Worker srcs: [ 33*9e94795aSAndroid Build Coastguard Worker "backported_fixes.proto", 34*9e94795aSAndroid Build Coastguard Worker ], 35*9e94795aSAndroid Build Coastguard Worker host_supported: true, 36*9e94795aSAndroid Build Coastguard Worker} 37*9e94795aSAndroid Build Coastguard Worker 38*9e94795aSAndroid Build Coastguard Workerjava_library { 39*9e94795aSAndroid Build Coastguard Worker name: "backported_fixes_common", 40*9e94795aSAndroid Build Coastguard Worker srcs: ["src/java/com/android/build/backportedfixes/common/*.java"], 41*9e94795aSAndroid Build Coastguard Worker static_libs: [ 42*9e94795aSAndroid Build Coastguard Worker "backported_fixes_proto", 43*9e94795aSAndroid Build Coastguard Worker "guava", 44*9e94795aSAndroid Build Coastguard Worker ], 45*9e94795aSAndroid Build Coastguard Worker host_supported: true, 46*9e94795aSAndroid Build Coastguard Worker} 47*9e94795aSAndroid Build Coastguard Worker 48*9e94795aSAndroid Build Coastguard Workerjava_test_host { 49*9e94795aSAndroid Build Coastguard Worker name: "backported_fixes_common_test", 50*9e94795aSAndroid Build Coastguard Worker srcs: ["tests/java/com/android/build/backportedfixes/common/*.java"], 51*9e94795aSAndroid Build Coastguard Worker static_libs: [ 52*9e94795aSAndroid Build Coastguard Worker "backported_fixes_common", 53*9e94795aSAndroid Build Coastguard Worker "backported_fixes_proto", 54*9e94795aSAndroid Build Coastguard Worker "junit", 55*9e94795aSAndroid Build Coastguard Worker "truth", 56*9e94795aSAndroid Build Coastguard Worker "truth-liteproto-extension", 57*9e94795aSAndroid Build Coastguard Worker "truth-proto-extension", 58*9e94795aSAndroid Build Coastguard Worker ], 59*9e94795aSAndroid Build Coastguard Worker test_options: { 60*9e94795aSAndroid Build Coastguard Worker unit_test: true, 61*9e94795aSAndroid Build Coastguard Worker }, 62*9e94795aSAndroid Build Coastguard Worker test_suites: ["general-tests"], 63*9e94795aSAndroid Build Coastguard Worker} 64*9e94795aSAndroid Build Coastguard Worker 65*9e94795aSAndroid Build Coastguard Workerjava_library { 66*9e94795aSAndroid Build Coastguard Worker name: "applied_backported_fixes_lib", 67*9e94795aSAndroid Build Coastguard Worker srcs: ["src/java/com/android/build/backportedfixes/*.java"], 68*9e94795aSAndroid Build Coastguard Worker static_libs: [ 69*9e94795aSAndroid Build Coastguard Worker "backported_fixes_common", 70*9e94795aSAndroid Build Coastguard Worker "backported_fixes_proto", 71*9e94795aSAndroid Build Coastguard Worker "jcommander", 72*9e94795aSAndroid Build Coastguard Worker "guava", 73*9e94795aSAndroid Build Coastguard Worker ], 74*9e94795aSAndroid Build Coastguard Worker host_supported: true, 75*9e94795aSAndroid Build Coastguard Worker} 76*9e94795aSAndroid Build Coastguard Worker 77*9e94795aSAndroid Build Coastguard Workerjava_binary_host { 78*9e94795aSAndroid Build Coastguard Worker name: "applied_backported_fixes_main", 79*9e94795aSAndroid Build Coastguard Worker main_class: "com.android.build.backportedfixes.Main", 80*9e94795aSAndroid Build Coastguard Worker static_libs: [ 81*9e94795aSAndroid Build Coastguard Worker "applied_backported_fixes_lib", 82*9e94795aSAndroid Build Coastguard Worker ], 83*9e94795aSAndroid Build Coastguard Worker} 84*9e94795aSAndroid Build Coastguard Worker 85*9e94795aSAndroid Build Coastguard Workerjava_test_host { 86*9e94795aSAndroid Build Coastguard Worker name: "applied_backported_fixes_test", 87*9e94795aSAndroid Build Coastguard Worker srcs: ["tests/java/com/android/build/backportedfixes/*.java"], 88*9e94795aSAndroid Build Coastguard Worker static_libs: [ 89*9e94795aSAndroid Build Coastguard Worker "applied_backported_fixes_lib", 90*9e94795aSAndroid Build Coastguard Worker "backported_fixes_proto", 91*9e94795aSAndroid Build Coastguard Worker "junit", 92*9e94795aSAndroid Build Coastguard Worker "truth", 93*9e94795aSAndroid Build Coastguard Worker ], 94*9e94795aSAndroid Build Coastguard Worker test_options: { 95*9e94795aSAndroid Build Coastguard Worker unit_test: true, 96*9e94795aSAndroid Build Coastguard Worker }, 97*9e94795aSAndroid Build Coastguard Worker test_suites: ["general-tests"], 98*9e94795aSAndroid Build Coastguard Worker} 99*9e94795aSAndroid Build Coastguard Worker 100*9e94795aSAndroid Build Coastguard Workergensrcs { 101*9e94795aSAndroid Build Coastguard Worker name: "applied_backported_fix_binpbs", 102*9e94795aSAndroid Build Coastguard Worker tools: ["aprotoc"], 103*9e94795aSAndroid Build Coastguard Worker srcs: [ 104*9e94795aSAndroid Build Coastguard Worker "applied_fixes/*.txtpb", 105*9e94795aSAndroid Build Coastguard Worker ], 106*9e94795aSAndroid Build Coastguard Worker tool_files: [ 107*9e94795aSAndroid Build Coastguard Worker "backported_fixes.proto", 108*9e94795aSAndroid Build Coastguard Worker ], 109*9e94795aSAndroid Build Coastguard Worker output_extension: "binpb", 110*9e94795aSAndroid Build Coastguard Worker cmd: "$(location aprotoc) " + 111*9e94795aSAndroid Build Coastguard Worker " --encode=com.android.build.backportedfixes.BackportedFix" + 112*9e94795aSAndroid Build Coastguard Worker " $(location backported_fixes.proto)" + 113*9e94795aSAndroid Build Coastguard Worker " < $(in)" + 114*9e94795aSAndroid Build Coastguard Worker " > $(out); echo $(out)", 115*9e94795aSAndroid Build Coastguard Worker} 116