backported_fixes_proto target requires sdk_version to be specified. Specifying the current SDK. Change-Id: I0266553b0e6d4cd8dba4ffa383b29040569637e1 Test: atest CtsOsTestCases Bug: 384663328
145 lines
3.9 KiB
Plaintext
145 lines
3.9 KiB
Plaintext
// Copyright 2024 Google Inc. All rights reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package {
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
default_team: "trendy_team_android_media_reliability",
|
|
}
|
|
|
|
genrule {
|
|
name: "applied_backported_fixes",
|
|
tools: ["applied_backported_fixes_property_writer"],
|
|
srcs: [":applied_backported_fix_binpbs"],
|
|
out: ["applied_backported_fixes.prop"],
|
|
cmd: "$(location applied_backported_fixes_property_writer)" +
|
|
" -p $(location applied_backported_fixes.prop)" +
|
|
" $(in)",
|
|
}
|
|
|
|
filegroup {
|
|
name: "backported_fixes_proto_file",
|
|
srcs: [
|
|
"backported_fixes.proto",
|
|
],
|
|
}
|
|
|
|
java_library {
|
|
name: "backported_fixes_proto",
|
|
srcs: ["backported_fixes.proto"],
|
|
host_supported: true,
|
|
sdk_version: "current",
|
|
}
|
|
|
|
java_library {
|
|
name: "backported_fixes_common",
|
|
srcs: ["src/java/com/android/build/backportedfixes/common/*.java"],
|
|
static_libs: [
|
|
"backported_fixes_proto",
|
|
"guava",
|
|
],
|
|
host_supported: true,
|
|
}
|
|
|
|
java_test_host {
|
|
name: "backported_fixes_common_test",
|
|
srcs: ["tests/java/com/android/build/backportedfixes/common/*.java"],
|
|
static_libs: [
|
|
"backported_fixes_common",
|
|
"backported_fixes_proto",
|
|
"junit",
|
|
"truth",
|
|
"truth-liteproto-extension",
|
|
"truth-proto-extension",
|
|
],
|
|
test_options: {
|
|
unit_test: true,
|
|
},
|
|
test_suites: ["general-tests"],
|
|
}
|
|
|
|
java_library {
|
|
name: "backported_fixes_main_lib",
|
|
srcs: ["src/java/com/android/build/backportedfixes/*.java"],
|
|
static_libs: [
|
|
"backported_fixes_common",
|
|
"backported_fixes_proto",
|
|
"jcommander",
|
|
"guava",
|
|
],
|
|
host_supported: true,
|
|
}
|
|
|
|
java_binary_host {
|
|
name: "applied_backported_fixes_property_writer",
|
|
main_class: "com.android.build.backportedfixes.WriteBackportedFixesPropFile",
|
|
static_libs: [
|
|
"backported_fixes_main_lib",
|
|
],
|
|
}
|
|
|
|
java_binary_host {
|
|
name: "backported_fixes_combiner",
|
|
main_class: "com.android.build.backportedfixes.CombineBackportedFixes",
|
|
static_libs: [
|
|
"backported_fixes_main_lib",
|
|
],
|
|
}
|
|
|
|
// Combines BackportedFix binary proto files into a single BackportedFixes binary proto file.
|
|
genrule_defaults {
|
|
name: "default_backported_fixes_combiner",
|
|
tools: ["backported_fixes_combiner"],
|
|
cmd: "$(location backported_fixes_combiner)" +
|
|
" -o $(out)" +
|
|
" $(in)",
|
|
}
|
|
|
|
java_test_host {
|
|
name: "backported_fixes_main_lib_test",
|
|
srcs: ["tests/java/com/android/build/backportedfixes/*.java"],
|
|
static_libs: [
|
|
"backported_fixes_main_lib",
|
|
"backported_fixes_proto",
|
|
"junit",
|
|
"truth",
|
|
],
|
|
test_options: {
|
|
unit_test: true,
|
|
},
|
|
test_suites: ["general-tests"],
|
|
}
|
|
|
|
// Converts BackprotedFix text protos to binary protos
|
|
genrule_defaults {
|
|
name: "default_backported_fix_binpbs",
|
|
tools: ["aprotoc"],
|
|
tool_files: [
|
|
":backported_fixes_proto_file",
|
|
],
|
|
cmd: "$(location aprotoc) " +
|
|
" --encode=com.android.build.backportedfixes.BackportedFix" +
|
|
" $(location :backported_fixes_proto_file)" +
|
|
" < $(in)" +
|
|
" > $(out); echo $(out)",
|
|
}
|
|
|
|
gensrcs {
|
|
name: "applied_backported_fix_binpbs",
|
|
defaults: ["default_backported_fix_binpbs"],
|
|
output_extension: "binpb",
|
|
srcs: [
|
|
"applied_fixes/*.txtpb",
|
|
],
|
|
}
|