diff --git a/tools/workspace/BUILD.bazel b/tools/workspace/BUILD.bazel index 959a7c429d97..c12609a9a3d0 100644 --- a/tools/workspace/BUILD.bazel +++ b/tools/workspace/BUILD.bazel @@ -43,6 +43,15 @@ drake_py_binary( ], ) +drake_py_binary( + name = "vendor_cxx", + srcs = ["vendor_cxx.py"], + visibility = [ + "@yaml_cpp_internal//:__pkg__", + ], + deps = [":module_py"], +) + drake_py_binary( name = "cmake_configure_file", srcs = ["cmake_configure_file.py"], diff --git a/tools/workspace/yaml_cpp_internal/vendor_cxx.py b/tools/workspace/vendor_cxx.py similarity index 100% rename from tools/workspace/yaml_cpp_internal/vendor_cxx.py rename to tools/workspace/vendor_cxx.py diff --git a/tools/workspace/yaml_cpp_internal/BUILD.bazel b/tools/workspace/yaml_cpp_internal/BUILD.bazel index f245e8a3c434..7198e3bb9b53 100644 --- a/tools/workspace/yaml_cpp_internal/BUILD.bazel +++ b/tools/workspace/yaml_cpp_internal/BUILD.bazel @@ -1,15 +1,5 @@ # -*- python -*- -load( - "@drake//tools/skylark:drake_py.bzl", - "drake_py_binary", -) load("//tools/lint:lint.bzl", "add_lint_tests") -drake_py_binary( - name = "vendor_cxx", - srcs = ["vendor_cxx.py"], - visibility = ["@yaml_cpp_internal//:__pkg__"], -) - add_lint_tests() diff --git a/tools/workspace/yaml_cpp_internal/package.BUILD.bazel b/tools/workspace/yaml_cpp_internal/package.BUILD.bazel index dc9824aa6c25..1d489e1bcf77 100644 --- a/tools/workspace/yaml_cpp_internal/package.BUILD.bazel +++ b/tools/workspace/yaml_cpp_internal/package.BUILD.bazel @@ -35,17 +35,17 @@ _VENDORED_SRCS = [ ] genrule( - name = "foo", + name = "vendoring", srcs = _HDRS + _SRCS, outs = _VENDORED_HDRS + _VENDORED_SRCS, cmd = " ".join([ - "$(execpath @drake//tools/workspace/yaml_cpp_internal:vendor_cxx)", + "$(execpath @drake//tools/workspace:vendor_cxx)", "--edit-include=yaml-cpp/:drake-yaml-cpp/", ] + [ "$(execpath {}):$(execpath {})".format(old, new) for old, new in zip(_HDRS, _VENDORED_HDRS) + zip(_SRCS, _VENDORED_SRCS) ]), - tools = ["@drake//tools/workspace/yaml_cpp_internal:vendor_cxx"], + tools = ["@drake//tools/workspace:vendor_cxx"], ) cc_library(