xref: /aosp_15_r20/external/bazelbuild-rules_cc/tools/migration/BUILD (revision eed53cd41c5909d05eedc7ad9720bb158fd93452)
1*eed53cd4SHONG Yifan# Copyright 2018 The Bazel Authors. All rights reserved.
2*eed53cd4SHONG Yifan#
3*eed53cd4SHONG Yifan# Licensed under the Apache License, Version 2.0 (the "License");
4*eed53cd4SHONG Yifan# you may not use this file except in compliance with the License.
5*eed53cd4SHONG Yifan# You may obtain a copy of the License at
6*eed53cd4SHONG Yifan#
7*eed53cd4SHONG Yifan#    http://www.apache.org/licenses/LICENSE-2.0
8*eed53cd4SHONG Yifan#
9*eed53cd4SHONG Yifan# Unless required by applicable law or agreed to in writing, software
10*eed53cd4SHONG Yifan# distributed under the License is distributed on an "AS IS" BASIS,
11*eed53cd4SHONG Yifan# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*eed53cd4SHONG Yifan# See the License for the specific language governing permissions and
13*eed53cd4SHONG Yifan# limitations under the License.
14*eed53cd4SHONG Yifan
15*eed53cd4SHONG Yifanload("@bazel_skylib//:bzl_library.bzl", "bzl_library")
16*eed53cd4SHONG Yifanload("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
17*eed53cd4SHONG Yifanload("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
18*eed53cd4SHONG Yifan
19*eed53cd4SHONG Yifanpackage(default_visibility = ["//visibility:public"])
20*eed53cd4SHONG Yifan
21*eed53cd4SHONG Yifanlicenses(["notice"])
22*eed53cd4SHONG Yifan
23*eed53cd4SHONG Yifanpy_binary(
24*eed53cd4SHONG Yifan    name = "legacy_fields_migrator",
25*eed53cd4SHONG Yifan    srcs = ["legacy_fields_migrator.py"],
26*eed53cd4SHONG Yifan    python_version = "PY3",
27*eed53cd4SHONG Yifan    deps = [
28*eed53cd4SHONG Yifan        ":legacy_fields_migration_lib",
29*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2",
30*eed53cd4SHONG Yifan        "@io_abseil_py//absl:app",
31*eed53cd4SHONG Yifan        "@io_abseil_py//absl/flags",
32*eed53cd4SHONG Yifan        #internal proto upb dep,
33*eed53cd4SHONG Yifan    ],
34*eed53cd4SHONG Yifan)
35*eed53cd4SHONG Yifan
36*eed53cd4SHONG Yifanpy_library(
37*eed53cd4SHONG Yifan    name = "legacy_fields_migration_lib",
38*eed53cd4SHONG Yifan    srcs = ["legacy_fields_migration_lib.py"],
39*eed53cd4SHONG Yifan    deps = [
40*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2",
41*eed53cd4SHONG Yifan    ],
42*eed53cd4SHONG Yifan)
43*eed53cd4SHONG Yifan
44*eed53cd4SHONG Yifanpy_test(
45*eed53cd4SHONG Yifan    name = "legacy_fields_migration_lib_test",
46*eed53cd4SHONG Yifan    srcs = ["legacy_fields_migration_lib_test.py"],
47*eed53cd4SHONG Yifan    python_version = "PY3",
48*eed53cd4SHONG Yifan    deps = [
49*eed53cd4SHONG Yifan        ":legacy_fields_migration_lib",
50*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2",
51*eed53cd4SHONG Yifan    ],
52*eed53cd4SHONG Yifan)
53*eed53cd4SHONG Yifan
54*eed53cd4SHONG Yifanpy_binary(
55*eed53cd4SHONG Yifan    name = "crosstool_query",
56*eed53cd4SHONG Yifan    srcs = ["crosstool_query.py"],
57*eed53cd4SHONG Yifan    python_version = "PY3",
58*eed53cd4SHONG Yifan    deps = [
59*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2",
60*eed53cd4SHONG Yifan        "@io_abseil_py//absl:app",
61*eed53cd4SHONG Yifan        "@io_abseil_py//absl/flags",
62*eed53cd4SHONG Yifan        #internal proto upb dep,
63*eed53cd4SHONG Yifan    ],
64*eed53cd4SHONG Yifan)
65*eed53cd4SHONG Yifan
66*eed53cd4SHONG Yifanpy_binary(
67*eed53cd4SHONG Yifan    name = "ctoolchain_comparator",
68*eed53cd4SHONG Yifan    srcs = ["ctoolchain_comparator.py"],
69*eed53cd4SHONG Yifan    python_version = "PY3",
70*eed53cd4SHONG Yifan    deps = [
71*eed53cd4SHONG Yifan        ":ctoolchain_comparator_lib",
72*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2",
73*eed53cd4SHONG Yifan        "@io_abseil_py//absl:app",
74*eed53cd4SHONG Yifan        "@io_abseil_py//absl/flags",
75*eed53cd4SHONG Yifan        #internal proto upb dep,
76*eed53cd4SHONG Yifan    ],
77*eed53cd4SHONG Yifan)
78*eed53cd4SHONG Yifan
79*eed53cd4SHONG Yifanpy_library(
80*eed53cd4SHONG Yifan    name = "ctoolchain_comparator_lib",
81*eed53cd4SHONG Yifan    srcs = ["ctoolchain_comparator_lib.py"],
82*eed53cd4SHONG Yifan    deps = [
83*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2",
84*eed53cd4SHONG Yifan    ],
85*eed53cd4SHONG Yifan)
86*eed53cd4SHONG Yifan
87*eed53cd4SHONG Yifanpy_test(
88*eed53cd4SHONG Yifan    name = "ctoolchain_comparator_lib_test",
89*eed53cd4SHONG Yifan    srcs = ["ctoolchain_comparator_lib_test.py"],
90*eed53cd4SHONG Yifan    python_version = "PY3",
91*eed53cd4SHONG Yifan    deps = [
92*eed53cd4SHONG Yifan        ":ctoolchain_comparator_lib",
93*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_py_pb2",
94*eed53cd4SHONG Yifan        "@py_mock//py/mock",
95*eed53cd4SHONG Yifan    ],
96*eed53cd4SHONG Yifan)
97*eed53cd4SHONG Yifan
98*eed53cd4SHONG Yifango_binary(
99*eed53cd4SHONG Yifan    name = "convert_crosstool_to_starlark",
100*eed53cd4SHONG Yifan    srcs = ["convert_crosstool_to_starlark.go"],
101*eed53cd4SHONG Yifan    deps = [
102*eed53cd4SHONG Yifan        ":crosstooltostarlarklib",
103*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_go_proto",
104*eed53cd4SHONG Yifan        "@com_github_golang_protobuf//proto:go_default_library",
105*eed53cd4SHONG Yifan    ],
106*eed53cd4SHONG Yifan)
107*eed53cd4SHONG Yifan
108*eed53cd4SHONG Yifango_library(
109*eed53cd4SHONG Yifan    name = "crosstooltostarlarklib",
110*eed53cd4SHONG Yifan    srcs = ["crosstool_to_starlark_lib.go"],
111*eed53cd4SHONG Yifan    importpath = "tools/migration/crosstooltostarlarklib",
112*eed53cd4SHONG Yifan    deps = ["//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_go_proto"],
113*eed53cd4SHONG Yifan)
114*eed53cd4SHONG Yifan
115*eed53cd4SHONG Yifango_test(
116*eed53cd4SHONG Yifan    name = "crosstooltostarlarklib_test",
117*eed53cd4SHONG Yifan    size = "small",
118*eed53cd4SHONG Yifan    srcs = ["crosstool_to_starlark_lib_test.go"],
119*eed53cd4SHONG Yifan    embed = [":crosstooltostarlarklib"],
120*eed53cd4SHONG Yifan    deps = [
121*eed53cd4SHONG Yifan        "//third_party/com/github/bazelbuild/bazel/src/main/protobuf:crosstool_config_go_proto",
122*eed53cd4SHONG Yifan        "@com_github_golang_protobuf//proto:go_default_library",
123*eed53cd4SHONG Yifan    ],
124*eed53cd4SHONG Yifan)
125*eed53cd4SHONG Yifan
126*eed53cd4SHONG Yifanfilegroup(
127*eed53cd4SHONG Yifan    name = "bazel_osx_p4deps",
128*eed53cd4SHONG Yifan    srcs = [
129*eed53cd4SHONG Yifan        "BUILD",
130*eed53cd4SHONG Yifan        "ctoolchain_compare.bzl",
131*eed53cd4SHONG Yifan    ],
132*eed53cd4SHONG Yifan)
133*eed53cd4SHONG Yifan
134*eed53cd4SHONG Yifanbzl_library(
135*eed53cd4SHONG Yifan    name = "ctoolchain_compare_bzl",
136*eed53cd4SHONG Yifan    srcs = ["ctoolchain_compare.bzl"],
137*eed53cd4SHONG Yifan    visibility = ["//visibility:private"],
138*eed53cd4SHONG Yifan)
139*eed53cd4SHONG Yifan
140*eed53cd4SHONG Yifanbzl_library(
141*eed53cd4SHONG Yifan    name = "cc_toolchain_config_comparator_bzl",
142*eed53cd4SHONG Yifan    srcs = ["cc_toolchain_config_comparator.bzl"],
143*eed53cd4SHONG Yifan    visibility = ["//visibility:private"],
144*eed53cd4SHONG Yifan)
145