From 569bb0baff6529f0518937a23722c3955284b08e Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Mon, 26 May 2025 15:07:03 +0200 Subject: [PATCH] bazel: cleanup BUILD.bazel --- .allstar/BUILD.bazel | 17 ----------- examples/cpp/BUILD.bazel | 28 +++++++++---------- ortools/algorithms/BUILD.bazel | 2 +- ortools/base/BUILD.bazel | 16 +++++------ ortools/bop/BUILD.bazel | 8 +++--- ortools/graph/BUILD.bazel | 2 +- .../linear_solver/proto_solver/BUILD.bazel | 2 +- ortools/lp_data/BUILD.bazel | 2 +- ortools/math_opt/core/BUILD.bazel | 4 +-- ortools/math_opt/cpp/BUILD.bazel | 6 ++-- ortools/math_opt/elemental/BUILD.bazel | 2 +- ortools/math_opt/solvers/BUILD.bazel | 4 +-- ortools/math_opt/storage/BUILD.bazel | 4 +-- ortools/math_opt/validators/BUILD.bazel | 6 ++-- ortools/pdlp/BUILD.bazel | 2 +- ortools/port/BUILD.bazel | 2 +- ortools/routing/parsers/BUILD.bazel | 4 +-- ortools/sat/BUILD.bazel | 22 +++++++-------- ortools/sat/samples/code_samples.bzl | 2 +- ortools/scheduling/BUILD.bazel | 2 +- ortools/util/BUILD.bazel | 6 ++-- 21 files changed, 63 insertions(+), 80 deletions(-) delete mode 100644 .allstar/BUILD.bazel diff --git a/.allstar/BUILD.bazel b/.allstar/BUILD.bazel deleted file mode 100644 index c6f182d9ae..0000000000 --- a/.allstar/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2010-2025 Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -exports_files( - glob(["**"]), - visibility = ["//ortools/open_source:__subpackages__"], -) diff --git a/examples/cpp/BUILD.bazel b/examples/cpp/BUILD.bazel index 37961c55ef..a31911a537 100644 --- a/examples/cpp/BUILD.bazel +++ b/examples/cpp/BUILD.bazel @@ -33,7 +33,7 @@ cc_binary( "@abseil-cpp//absl/container:btree", "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -52,7 +52,7 @@ cc_test( "//ortools/packing:multiple_dimensions_bin_packing_cc_proto", "//ortools/sat:cp_model", "@abseil-cpp//absl/flags:flag", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -200,7 +200,7 @@ cc_binary( "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/flags:parse", "@abseil-cpp//absl/strings:str_format", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -216,7 +216,7 @@ cc_test( "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/flags:parse", "@abseil-cpp//absl/strings:str_format", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -232,7 +232,7 @@ cc_binary( "//ortools/sat:cp_model", "//ortools/sat:cp_model_solver", "@abseil-cpp//absl/flags:flag", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -250,7 +250,7 @@ cc_test( "//ortools/packing:multiple_dimensions_bin_packing_cc_proto", "//ortools/sat:cp_model", "@abseil-cpp//absl/flags:flag", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -405,7 +405,7 @@ cc_binary( "//ortools/util:filelineiter", "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -433,7 +433,7 @@ cc_test( "//ortools/util:filelineiter", "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -607,7 +607,7 @@ cc_binary( "//ortools/constraint_solver:routing", "//ortools/util:random_engine", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -623,7 +623,7 @@ cc_binary( "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -766,7 +766,7 @@ cc_binary( "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -787,7 +787,7 @@ cc_test( "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -943,7 +943,7 @@ cc_binary( "//ortools/util:qap_reader", "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -977,7 +977,7 @@ cc_binary( "@abseil-cpp//absl/flags:flag", "@abseil-cpp//absl/flags:parse", "@abseil-cpp//absl/random", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/algorithms/BUILD.bazel b/ortools/algorithms/BUILD.bazel index c1dacf06bc..4f4def32e7 100644 --- a/ortools/algorithms/BUILD.bazel +++ b/ortools/algorithms/BUILD.bazel @@ -141,7 +141,7 @@ cc_library( "@abseil-cpp//absl/random", "@abseil-cpp//absl/random:distributions", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/base/BUILD.bazel b/ortools/base/BUILD.bazel index 771c9607da..f5750c3e04 100644 --- a/ortools/base/BUILD.bazel +++ b/ortools/base/BUILD.bazel @@ -253,7 +253,7 @@ cc_library( "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", "@bzip2//:bz2", - "@protobuf//:protobuf", + "@protobuf", "@zlib", ], ) @@ -267,7 +267,7 @@ cc_library( "@fuzztest//fuzztest", "@fuzztest//fuzztest:googletest_fixture_adapter", "@fuzztest//fuzztest:init_fuzztest", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -424,7 +424,7 @@ cc_library( deps = [ "@abseil-cpp//absl/strings", "@googletest//:gtest", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -459,7 +459,7 @@ cc_library( hdrs = ["parse_text_proto.h"], deps = [ "@abseil-cpp//absl/log:check", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -469,7 +469,7 @@ cc_library( deps = [ ":gmock", "@abseil-cpp//absl/log:check", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -495,7 +495,7 @@ cc_library( ":timer", "@abseil-cpp//absl/status", "@abseil-cpp//absl/status:statusor", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -504,7 +504,7 @@ cc_library( hdrs = ["proto_enum_utils.h"], deps = [ "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -523,7 +523,7 @@ cc_library( ":logging", "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", "@zlib", ], ) diff --git a/ortools/bop/BUILD.bazel b/ortools/bop/BUILD.bazel index fcab0d1ee3..2e9bcc42d0 100644 --- a/ortools/bop/BUILD.bazel +++ b/ortools/bop/BUILD.bazel @@ -119,7 +119,7 @@ cc_library( "//ortools/util:stats", "//ortools/util:time_limit", "@abseil-cpp//absl/random", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -149,7 +149,7 @@ cc_library( "//ortools/util:time_limit", "@abseil-cpp//absl/random", "@abseil-cpp//absl/cleanup", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -258,7 +258,7 @@ cc_library( "//ortools/base:threadpool", "//ortools/util:bitset", "//ortools/util:time_limit", - "@protobuf//:protobuf", + "@protobuf", "//ortools/util:stats", ], ) @@ -291,6 +291,6 @@ cc_library( "//ortools/util:bitset", "//ortools/util:stats", "//ortools/util:time_limit", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/graph/BUILD.bazel b/ortools/graph/BUILD.bazel index 9c04dee929..d8d0a5c07d 100644 --- a/ortools/graph/BUILD.bazel +++ b/ortools/graph/BUILD.bazel @@ -467,7 +467,7 @@ cc_test( "//ortools/base:gmock_main", "//ortools/base:path", "//ortools/util:file_util", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/linear_solver/proto_solver/BUILD.bazel b/ortools/linear_solver/proto_solver/BUILD.bazel index 3693aa44d6..8b01c79af5 100644 --- a/ortools/linear_solver/proto_solver/BUILD.bazel +++ b/ortools/linear_solver/proto_solver/BUILD.bazel @@ -20,7 +20,7 @@ cc_library( deps = [ "//ortools/port:proto_utils", "@abseil-cpp//absl/log:check", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/lp_data/BUILD.bazel b/ortools/lp_data/BUILD.bazel index 84b4b74471..6e3ad9bd97 100644 --- a/ortools/lp_data/BUILD.bazel +++ b/ortools/lp_data/BUILD.bazel @@ -250,7 +250,7 @@ cc_library( "//ortools/linear_solver:linear_solver_cc_proto", "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/strings", - "@re2//:re2", + "@re2", ], ) diff --git a/ortools/math_opt/core/BUILD.bazel b/ortools/math_opt/core/BUILD.bazel index a914190703..bdd9db9758 100644 --- a/ortools/math_opt/core/BUILD.bazel +++ b/ortools/math_opt/core/BUILD.bazel @@ -51,7 +51,7 @@ cc_library( "//ortools/math_opt:sparse_containers_cc_proto", "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -228,7 +228,7 @@ cc_library( "@abseil-cpp//absl/algorithm:container", "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/container:flat_hash_set", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/math_opt/cpp/BUILD.bazel b/ortools/math_opt/cpp/BUILD.bazel index 22bbe52c84..2a62a12df6 100644 --- a/ortools/math_opt/cpp/BUILD.bazel +++ b/ortools/math_opt/cpp/BUILD.bazel @@ -63,7 +63,7 @@ cc_library( "@abseil-cpp//absl/status", "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -296,7 +296,7 @@ cc_library( "@abseil-cpp//absl/status", "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/time", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -326,7 +326,7 @@ cc_library( "@abseil-cpp//absl/strings", "@abseil-cpp//absl/synchronization", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/math_opt/elemental/BUILD.bazel b/ortools/math_opt/elemental/BUILD.bazel index 039c7eafc8..2ebdec571a 100644 --- a/ortools/math_opt/elemental/BUILD.bazel +++ b/ortools/math_opt/elemental/BUILD.bazel @@ -78,7 +78,7 @@ cc_library( "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:string_view", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/math_opt/solvers/BUILD.bazel b/ortools/math_opt/solvers/BUILD.bazel index d01605400e..1c4a899094 100644 --- a/ortools/math_opt/solvers/BUILD.bazel +++ b/ortools/math_opt/solvers/BUILD.bazel @@ -66,7 +66,7 @@ cc_library( "@abseil-cpp//absl/strings", "@abseil-cpp//absl/time", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", "@scip", ], alwayslink = 1, @@ -187,7 +187,7 @@ cc_library( "@abseil-cpp//absl/strings", "@abseil-cpp//absl/time", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], alwayslink = 1, ) diff --git a/ortools/math_opt/storage/BUILD.bazel b/ortools/math_opt/storage/BUILD.bazel index 17878bd805..50b2b98e7c 100644 --- a/ortools/math_opt/storage/BUILD.bazel +++ b/ortools/math_opt/storage/BUILD.bazel @@ -130,7 +130,7 @@ cc_library( "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/strings:string_view", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -170,7 +170,7 @@ cc_library( "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/container:flat_hash_set", "@abseil-cpp//absl/log:check", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/math_opt/validators/BUILD.bazel b/ortools/math_opt/validators/BUILD.bazel index f2e725a7a8..f9b4cb4ac4 100644 --- a/ortools/math_opt/validators/BUILD.bazel +++ b/ortools/math_opt/validators/BUILD.bazel @@ -122,7 +122,7 @@ cc_library( "//ortools/math_opt/core:model_summary", "//ortools/port:proto_utils", "@abseil-cpp//absl/status", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -184,7 +184,7 @@ cc_library( "@abseil-cpp//absl/container:flat_hash_set", "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -205,7 +205,7 @@ cc_library( "//ortools/util:status_macros", "@abseil-cpp//absl/status", "@abseil-cpp//absl/time", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/pdlp/BUILD.bazel b/ortools/pdlp/BUILD.bazel index 233b229c81..7a19ebc39a 100644 --- a/ortools/pdlp/BUILD.bazel +++ b/ortools/pdlp/BUILD.bazel @@ -149,8 +149,8 @@ cc_library( "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", "@abseil-cpp//absl/time", - "@protobuf//:protobuf", "@eigen", + "@protobuf", ], ) diff --git a/ortools/port/BUILD.bazel b/ortools/port/BUILD.bazel index 59dffc25bb..20219982d7 100644 --- a/ortools/port/BUILD.bazel +++ b/ortools/port/BUILD.bazel @@ -32,7 +32,7 @@ cc_library( "//ortools/util:parse_proto", "@abseil-cpp//absl/log", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/routing/parsers/BUILD.bazel b/ortools/routing/parsers/BUILD.bazel index a4eded7e02..0ba5fb6889 100644 --- a/ortools/routing/parsers/BUILD.bazel +++ b/ortools/routing/parsers/BUILD.bazel @@ -60,7 +60,7 @@ cc_library( "//ortools/base:zipfile", "//ortools/util:filelineiter", "@abseil-cpp//absl/strings", - "@re2//:re2", + "@re2", ], ) @@ -239,7 +239,7 @@ cc_library( "//ortools/util:filelineiter", "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/strings", - "@re2//:re2", + "@re2", ], ) diff --git a/ortools/sat/BUILD.bazel b/ortools/sat/BUILD.bazel index e7094dc654..06106c2ad1 100644 --- a/ortools/sat/BUILD.bazel +++ b/ortools/sat/BUILD.bazel @@ -149,7 +149,7 @@ cc_library( "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -236,7 +236,7 @@ cc_library( "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -496,7 +496,7 @@ cc_test( ":parameters_validation", ":sat_parameters_cc_proto", "//ortools/base:gmock_main", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -632,7 +632,7 @@ cc_library( "@abseil-cpp//absl/synchronization", "@abseil-cpp//absl/time", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -760,7 +760,7 @@ cc_library( "@abseil-cpp//absl/synchronization", "@abseil-cpp//absl/time", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -1114,7 +1114,7 @@ cc_library( "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -1230,7 +1230,7 @@ cc_library( "@abseil-cpp//absl/meta:type_traits", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -2554,7 +2554,7 @@ cc_library( "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/meta:type_traits", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -3154,7 +3154,7 @@ cc_library( "@abseil-cpp//absl/random:distributions", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -3996,7 +3996,7 @@ cc_binary( "@abseil-cpp//absl/log:flags", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -4072,7 +4072,7 @@ cc_library( "@abseil-cpp//absl/status", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/types:span", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/sat/samples/code_samples.bzl b/ortools/sat/samples/code_samples.bzl index a1b1d3ce3f..e613b56ffd 100644 --- a/ortools/sat/samples/code_samples.bzl +++ b/ortools/sat/samples/code_samples.bzl @@ -13,9 +13,9 @@ """Helper macro to compile and test code samples.""" -load("@rules_go//go:def.bzl", "go_test") load("@pip_deps//:requirements.bzl", "requirement") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test") +load("@rules_go//go:def.bzl", "go_test") load("@rules_java//java:defs.bzl", "java_test") load("@rules_python//python:defs.bzl", "py_binary", "py_test") diff --git a/ortools/scheduling/BUILD.bazel b/ortools/scheduling/BUILD.bazel index 4a3394ef61..e8503bcc37 100644 --- a/ortools/scheduling/BUILD.bazel +++ b/ortools/scheduling/BUILD.bazel @@ -41,7 +41,7 @@ cc_library( "//ortools/base:path", "//ortools/util:filelineiter", "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], ) diff --git a/ortools/util/BUILD.bazel b/ortools/util/BUILD.bazel index 43ecadd813..b12e21b60a 100644 --- a/ortools/util/BUILD.bazel +++ b/ortools/util/BUILD.bazel @@ -289,7 +289,7 @@ cc_library( # "//net/proto2/io/public:io", # "//net/proto2/public", # "//net/proto2/util/public:json", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -398,7 +398,7 @@ cc_library( "@abseil-cpp//absl/status:statusor", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", - "@protobuf//:protobuf", + "@protobuf", ], ) @@ -522,7 +522,7 @@ cc_library( hdrs = ["parse_proto.h"], deps = [ "@abseil-cpp//absl/strings", - "@protobuf//:protobuf", + "@protobuf", ], )