xref: /aosp_15_r20/cts/tests/mediapc/common/Android.bp (revision b7c941bb3fa97aba169d73cee0bed2de8ac964bf)
1// Copyright (C) 2022 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_library {
20    name: "MediaPerformanceClassCommon",
21    srcs: [
22        "src/**/*.java",
23    ],
24    libs: [
25        "compatibility-device-util-axt",
26        "android.test.base.stubs.system",
27        "auto_value_annotations",
28        "guava",
29        "cts-verifier-framework",
30        "CtsCameraUtils",
31    ],
32    plugins: ["auto_value_plugin"],
33}
34
35android_test {
36    name: "MediaPerformanceClassCommonTests",
37    compile_multilib: "both",
38    static_libs: [
39        "compatibility-device-util-axt",
40        "MediaPerformanceClassCommon",
41        "mediapc-auto-constants",
42        "mediapc-requirements",
43    ],
44    platform_apis: true,
45    srcs: ["tests/src/**/*.java"],
46    test_suites: [
47        "general-tests",
48    ],
49    min_sdk_version: "30",
50}
51
52genrule {
53    name: "mediapc-auto-constants-gen",
54    srcs: ["src/android/mediapc/cts/common/AutoConstants.java.tmpl"],
55    tools: ["genreqsrc"],
56    tool_files: [":mpc_requirements_binarypb"],
57    cmd: "cat $(in) | $(location genreqsrc) -f $(location :mpc_requirements_binarypb) > $(out) ",
58    out: ["android/mediapc/cts/common/AutoConstants.java"],
59}
60
61java_library {
62    name: "mediapc-auto-constants",
63    srcs: [
64        ":mediapc-auto-constants-gen",
65    ],
66}
67
68genrule {
69    name: "mediapc-requirements-gen",
70    srcs: ["src/android/mediapc/cts/common/Requirements.java.tmpl"],
71    tools: ["genreqsrc"],
72    tool_files: [":mpc_requirements_binarypb"],
73    cmd: "cat $(in) | $(location genreqsrc) -f $(location :mpc_requirements_binarypb) > $(out) ",
74    out: ["android/mediapc/cts/common/Requirements.java"],
75}
76
77java_library {
78    name: "mediapc-requirements",
79    srcs: [":mediapc-requirements-gen"],
80    libs: ["MediaPerformanceClassCommon"],
81}
82