xref: /aosp_15_r20/cts/hostsidetests/packagemanager/parsing/processing/Android.bp (revision b7c941bb3fa97aba169d73cee0bed2de8ac964bf)
1// Copyright (C) 2021 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_team: "trendy_team_framework_android_packages",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20java_library_host {
21    name: "CtsPackageManagerParsingAnnotationProcessorApi",
22    srcs: ["api/src/**/*.kt"],
23    defaults: ["cts_defaults"],
24    libs: [
25        "compatibility-host-util",
26        "cts-tradefed",
27        "tradefed",
28    ],
29    static_libs: [
30        "cts-host-utils",
31        "jetbrains-annotations",
32        "junit",
33    ],
34}
35
36filegroup {
37    name: "CtsPackageManagerApkGeneratorSrc",
38    srcs: ["ApkGenerator.py"],
39}
40
41filegroup {
42    name: "CtsPackageManagerApkGeneratorJks",
43    srcs: ["ApkGenerator.jks"],
44}
45
46filegroup {
47    name: "frameworks-res-CtsPackageManagerParsingApkGenerator",
48    device_common_srcs: [":framework-res"],
49    visibility: ["//cts/hostsidetests/packagemanager/parsing:__subpackages__"],
50}
51
52genrule_defaults {
53    name: "CtsPackageManagerParsingApkGenerator",
54    tool_files: [
55        ":CtsPackageManagerApkGeneratorSrc",
56        ":CtsPackageManagerApkGeneratorJks",
57        ":frameworks-res-CtsPackageManagerParsingApkGenerator",
58    ],
59    tools: [
60        "aapt2",
61        "apksigner",
62        "soong_zip",
63    ],
64    cmd: "python3 $(location :CtsPackageManagerApkGeneratorSrc) \"$(location aapt2)\" " +
65        "\"$(location :frameworks-res-CtsPackageManagerParsingApkGenerator)\" " +
66        "\"$(location apksigner)\" " +
67        "\"$(location :CtsPackageManagerApkGeneratorJks)\" " +
68        "\"$(genDir)\" $(in) && $(location soong_zip) -o $(out) -L 0 -C $(genDir)/out -D $(genDir)/out",
69}
70