run_tool.bzl 610 B

123456789101112131415161718
  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. """Supports running a tool from the install filegroup."""
  5. load("@rules_python//python:defs.bzl", "py_binary")
  6. def run_tool(name, tool, data, env):
  7. # TODO: Fix the driver file discovery in order to allow symlinks.
  8. py_binary(
  9. name = name,
  10. main = "run_tool.py",
  11. srcs = ["run_tool.py"],
  12. args = ["$(location {})".format(tool)],
  13. data = [tool] + data,
  14. env = env,
  15. )