BUILD 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. load("@mypy_integration//:mypy.bzl", "mypy_test")
  5. # The filegroups establishing root rules for `genquery` invocations can be
  6. # updated by running:
  7. #
  8. # ```
  9. # ./bazel/check_deps/update_roots.py
  10. # ```
  11. filegroup(
  12. name = "non_test_cc_rules",
  13. data = [
  14. "//executable_semantics",
  15. "//migrate_cpp/cpp_refactoring",
  16. "//toolchain/diagnostics:null_diagnostics",
  17. "//toolchain/driver:carbon",
  18. ],
  19. )
  20. genquery(
  21. name = "non_test_cc_deps.txt",
  22. expression = "kind('cc.* rule', deps(//bazel/check_deps:non_test_cc_rules))",
  23. opts = [
  24. "--notool_deps",
  25. "--noimplicit_deps",
  26. ],
  27. scope = [":non_test_cc_rules"],
  28. )
  29. py_test(
  30. name = "check_non_test_cc_deps",
  31. srcs = ["check_non_test_cc_deps.py"],
  32. data = [":non_test_cc_deps.txt"],
  33. main = "check_non_test_cc_deps.py",
  34. )
  35. mypy_test(
  36. name = "check_non_test_cc_deps_mypy_test",
  37. include_imports = True,
  38. deps = [":check_non_test_cc_deps"],
  39. )
  40. # Note that this script expects to be run directly and not via Bazel as it in
  41. # turn invokes Bazel.
  42. py_binary(
  43. name = "update_roots",
  44. srcs = ["update_roots.py"],
  45. )
  46. mypy_test(
  47. name = "update_roots_mypy_test",
  48. include_imports = True,
  49. deps = [":update_roots"],
  50. )