1# Copyright (C) 2023 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
15py_binary(
16    name = "incremental_build",
17    srcs = [
18        "clone.py",
19        "cuj.py",
20        "cuj_catalog.py",
21        "cuj_regex_based.py",
22        "go_allowlists.py",
23        "incremental_build.py",
24        "ui.py",
25    ],
26    main = "incremental_build.py",
27    python_version = "PY3",
28    deps = [
29        ":perf_metrics",
30        ":pretty",
31    ],
32)
33
34py_binary(
35    name = "pretty",
36    srcs = [
37        "plot_metrics.py",
38        "pretty.py",
39    ],
40    data = [":plot_metrics.template.txt"],
41    main = "pretty.py",
42    python_version = "PY3",
43    deps = [":util"],
44)
45
46py_test(
47    name = "pretty_test",
48    srcs = [
49        "plot_metrics_test.py",
50        "pretty_test.py",
51    ],
52    deps = [":pretty"],
53)
54
55py_binary(
56    name = "clone",
57    srcs = [
58        "clone.py",
59        "cuj.py",
60        "go_allowlists.py",
61    ],
62    main = "clone.py",
63    python_version = "PY3",
64    deps = [":util"],
65)
66
67py_test(
68    name = "clone_test",
69    srcs = [
70        "clone_test.py",
71        "go_allowlists_test.py",
72    ],
73    deps = [":clone"],
74)
75
76py_library(
77    name = "util",
78    srcs = [
79        "finder.py",
80        "util.py",
81    ],
82    imports = ["."],
83)
84
85py_test(
86    name = "util_test",
87    srcs = [
88        "finder_test.py",
89        "util_test.py",
90    ],
91    deps = [":util"],
92)
93
94py_library(
95    name = "perf_metrics",
96    srcs = ["perf_metrics.py"],
97    deps = [
98        ":util",
99        "//build/soong/ui/metrics:metrics-py-proto",
100    ],
101)
102
103py_test(
104    name = "perf_metrics_test",
105    srcs = ["perf_metrics_test.py"],
106    deps = [":perf_metrics"],
107)
108