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
15genrule {
16    name: "mpc_requirements_binarypb",
17    tools: ["aprotoc"],
18    srcs: [
19        "mpc.proto",
20        "requirements.proto",
21        "requirements.txtpb",
22    ],
23    out: ["requirements.binpb"],
24    cmd: "$(location aprotoc)  " +
25        " --encode=android.media.performanceclass.requirements.RequirementList" +
26        "  $(location mpc.proto)" +
27        "  $(location requirements.proto)" +
28        " < $(location requirements.txtpb)" +
29        " > $(location requirements.binpb)",
30}
31
32blueprint_go_binary {
33    name: "genreqsrc",
34    srcs: ["genreqsrc.go"],
35    deps: ["requirements"],
36}
37
38bootstrap_go_package {
39    name: "requirements",
40    pkgPath: "cts/test/mediapc/requirements/requirements",
41    srcs: [
42        "requirements.go",
43    ],
44    deps: [
45        "templatefns",
46        "golang-protobuf-proto",
47        "requirements_go_proto",
48    ],
49}
50
51// Regenerate the go proto srcs with these commands
52// m aprotoc protoc-go-gen && \
53// aprotoc  \
54//   --go_out=paths=source_relative:. \
55//   cts/tests/mediapc/requirements/mpc.proto \
56//   cts/tests/mediapc/requirements/requirements.proto
57
58bootstrap_go_package {
59    name: "requirements_go_proto",
60    pkgPath: "cts/test/mediapc/requirements/requirements_go_proto",
61    srcs: [
62        "requirements.pb.go",
63        //"requirements.binpb",
64    ],
65    deps: [
66        "mpc_go_proto",
67        "golang-protobuf-reflect-protoreflect",
68        "golang-protobuf-runtime-protoimpl",
69
70    ],
71}
72
73bootstrap_go_package {
74    name: "mpc_go_proto",
75    pkgPath: "cts/test/mediapc/requirements/mpc_go_proto",
76    srcs: [
77        "mpc.pb.go",
78
79    ],
80    deps: [
81        "golang-protobuf-reflect-protoreflect",
82        "golang-protobuf-runtime-protoimpl",
83    ],
84}
85
86bootstrap_go_package {
87    name: "templatefns",
88    pkgPath: "cts/test/mediapc/requirements/templatefns",
89    srcs: ["templatefns.go"],
90}
91