diff --git a/multibody/parsing/BUILD.bazel b/multibody/parsing/BUILD.bazel index e4b12c448c6e..361de302a9c3 100644 --- a/multibody/parsing/BUILD.bazel +++ b/multibody/parsing/BUILD.bazel @@ -86,7 +86,7 @@ drake_cc_library( "//geometry:proximity_properties", "//math:geometric_transform", "//multibody/plant", - "@sdformat", + "@sdformat_internal//:sdformat", "@tinyxml2", ], ) @@ -99,7 +99,7 @@ drake_cc_library( visibility = ["//visibility:private"], deps = [ "//common:diagnostic_policy", - "@sdformat", + "@sdformat_internal//:sdformat", ], ) @@ -118,7 +118,7 @@ drake_cc_library( "//geometry:geometry_roles", "//geometry:shape_specification", "//multibody/plant:coulomb_friction", - "@sdformat", + "@sdformat_internal//:sdformat", ], ) @@ -136,7 +136,7 @@ drake_cc_library( ":detail_urdf_parser", ":scoped_names", "//multibody/plant", - "@sdformat", + "@sdformat_internal//:sdformat", ], ) diff --git a/tools/workspace/BUILD.bazel b/tools/workspace/BUILD.bazel index a98e935e13c7..27f05d04e10d 100644 --- a/tools/workspace/BUILD.bazel +++ b/tools/workspace/BUILD.bazel @@ -79,8 +79,8 @@ _DRAKE_EXTERNAL_PACKAGE_INSTALLS = ["@%s//:install" % p for p in [ "fcl", "fmt", "ghc_filesystem", - "ignition_math", - "ignition_utils", + "gz_math_internal", + "gz_utils_internal", "lcm", "meshcat", "meshcat_python", @@ -89,7 +89,7 @@ _DRAKE_EXTERNAL_PACKAGE_INSTALLS = ["@%s//:install" % p for p in [ "petsc", "pybind11", "qhull_internal", - "sdformat", + "sdformat_internal", "spdlog", "tinyobjloader", "usockets", diff --git a/tools/workspace/default.bzl b/tools/workspace/default.bzl index 818e6747e333..3297231bbc26 100644 --- a/tools/workspace/default.bzl +++ b/tools/workspace/default.bzl @@ -37,9 +37,9 @@ load("@drake//tools/workspace/glx:repository.bzl", "glx_repository") load("@drake//tools/workspace/googlebenchmark:repository.bzl", "googlebenchmark_repository") # noqa load("@drake//tools/workspace/gtest:repository.bzl", "gtest_repository") load("@drake//tools/workspace/gurobi:repository.bzl", "gurobi_repository") +load("@drake//tools/workspace/gz_math_internal:repository.bzl", "gz_math_internal_repository") # noqa +load("@drake//tools/workspace/gz_utils_internal:repository.bzl", "gz_utils_internal_repository") # noqa load("@drake//tools/workspace/ibex:repository.bzl", "ibex_repository") -load("@drake//tools/workspace/ignition_math:repository.bzl", "ignition_math_repository") # noqa -load("@drake//tools/workspace/ignition_utils:repository.bzl", "ignition_utils_repository") # noqa load("@drake//tools/workspace/intel_realsense_ros:repository.bzl", "intel_realsense_ros_repository") # noqa load("@drake//tools/workspace/ipopt:repository.bzl", "ipopt_repository") load("@drake//tools/workspace/json:repository.bzl", "json_repository") @@ -80,7 +80,7 @@ load("@drake//tools/workspace/ros_xacro:repository.bzl", "ros_xacro_repository") load("@drake//tools/workspace/rules_pkg:repository.bzl", "rules_pkg_repository") # noqa load("@drake//tools/workspace/rules_python:repository.bzl", "rules_python_repository") # noqa load("@drake//tools/workspace/scs:repository.bzl", "scs_repository") -load("@drake//tools/workspace/sdformat:repository.bzl", "sdformat_repository") +load("@drake//tools/workspace/sdformat_internal:repository.bzl", "sdformat_internal_repository") # noqa load("@drake//tools/workspace/snopt:repository.bzl", "snopt_repository") load("@drake//tools/workspace/spdlog:repository.bzl", "spdlog_repository") load("@drake//tools/workspace/stduuid:repository.bzl", "stduuid_repository") @@ -179,12 +179,24 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): gtest_repository(name = "gtest", mirrors = mirrors) if "gurobi" not in excludes: gurobi_repository(name = "gurobi") + if "gz_math_internal" not in excludes: + gz_math_internal_repository(name = "gz_math_internal", mirrors = mirrors) # noqa + if "gz_utils_internal" not in excludes: + gz_utils_internal_repository(name = "gz_utils_internal", mirrors = mirrors) # noqa if "ibex" not in excludes: ibex_repository(name = "ibex", mirrors = mirrors) if "ignition_math" not in excludes: - ignition_math_repository(name = "ignition_math", mirrors = mirrors) + add_deprecation( + name = "ignition_math", + date = "2022-10-01", + cc_aliases = {"ignition_math": "@gz_math_internal//:gz_math"}, + ) if "ignition_utils" not in excludes: - ignition_utils_repository(name = "ignition_utils", mirrors = mirrors) + add_deprecation( + name = "ignition_utils", + date = "2022-10-01", + cc_aliases = {"ignition_utils": "@gz_utils_internal//:gz_utils"}, + ) if "intel_realsense_ros" not in excludes: intel_realsense_ros_repository(name = "intel_realsense_ros", mirrors = mirrors) # noqa if "ipopt" not in excludes: @@ -272,7 +284,13 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): if "scs" not in excludes: scs_repository(name = "scs", mirrors = mirrors) if "sdformat" not in excludes: - sdformat_repository(name = "sdformat", mirrors = mirrors) + add_deprecation( + name = "sdformat", + date = "2022-10-01", + cc_aliases = {"sdformat": "@sdformat_internal//:sdformat"}, + ) + if "sdformat_internal" not in excludes: + sdformat_internal_repository(name = "sdformat_internal", mirrors = mirrors) # noqa if "snopt" not in excludes: snopt_repository(name = "snopt") if "spdlog" not in excludes: diff --git a/tools/workspace/ignition_math/BUILD.bazel b/tools/workspace/gz_math_internal/BUILD.bazel similarity index 100% rename from tools/workspace/ignition_math/BUILD.bazel rename to tools/workspace/gz_math_internal/BUILD.bazel diff --git a/tools/workspace/ignition_math/package.BUILD.bazel b/tools/workspace/gz_math_internal/package.BUILD.bazel similarity index 99% rename from tools/workspace/ignition_math/package.BUILD.bazel rename to tools/workspace/gz_math_internal/package.BUILD.bazel index 76341dbc9a1f..d2fdf029d7a4 100644 --- a/tools/workspace/ignition_math/package.BUILD.bazel +++ b/tools/workspace/gz_math_internal/package.BUILD.bazel @@ -159,7 +159,7 @@ public_headers = public_headers_no_gen + [ # explicitly listed sources plus private headers. The explicitly listed # hdrs= matches upstream's public headers. cc_library( - name = "ignition_math", + name = "gz_math", srcs = [ "src/Angle.cc", "src/AxisAlignedBox.cc", diff --git a/tools/workspace/ignition_math/repository.bzl b/tools/workspace/gz_math_internal/repository.bzl similarity index 73% rename from tools/workspace/ignition_math/repository.bzl rename to tools/workspace/gz_math_internal/repository.bzl index f73311d54619..9a1d71db46f4 100644 --- a/tools/workspace/ignition_math/repository.bzl +++ b/tools/workspace/gz_math_internal/repository.bzl @@ -2,8 +2,7 @@ load("//tools/workspace:github.bzl", "github_archive") -# TODO(jwnimmer-tri) Rename this to match upstream gz-math. -def ignition_math_repository( +def gz_math_internal_repository( name, mirrors = None): # When updating this commit, also remember to adjust the PROJECT_* @@ -13,6 +12,6 @@ def ignition_math_repository( repository = "gazebosim/gz-math", commit = "ignition-math6_6.10.0", sha256 = "94e853e1dfba97ebec4b6152691a89af1e94660b02f4ecdf04356b763c2848bd", # noqa - build_file = "@drake//tools/workspace/ignition_math:package.BUILD.bazel", # noqa + build_file = "@drake//tools/workspace/gz_math_internal:package.BUILD.bazel", # noqa mirrors = mirrors, ) diff --git a/tools/workspace/ignition_utils/BUILD.bazel b/tools/workspace/gz_utils_internal/BUILD.bazel similarity index 100% rename from tools/workspace/ignition_utils/BUILD.bazel rename to tools/workspace/gz_utils_internal/BUILD.bazel diff --git a/tools/workspace/ignition_utils/package.BUILD.bazel b/tools/workspace/gz_utils_internal/package.BUILD.bazel similarity index 98% rename from tools/workspace/ignition_utils/package.BUILD.bazel rename to tools/workspace/gz_utils_internal/package.BUILD.bazel index 2ce8f04787d8..1a24f95b7cc6 100644 --- a/tools/workspace/ignition_utils/package.BUILD.bazel +++ b/tools/workspace/gz_utils_internal/package.BUILD.bazel @@ -87,7 +87,7 @@ public_headers = public_headers_no_gen + [ ] cc_library( - name = "ignition_utils", + name = "gz_utils", srcs = private_headers, hdrs = public_headers, includes = ["include"], diff --git a/tools/workspace/ignition_utils/repository.bzl b/tools/workspace/gz_utils_internal/repository.bzl similarity index 73% rename from tools/workspace/ignition_utils/repository.bzl rename to tools/workspace/gz_utils_internal/repository.bzl index ed6fcc6d343f..03cd32e5f05a 100644 --- a/tools/workspace/ignition_utils/repository.bzl +++ b/tools/workspace/gz_utils_internal/repository.bzl @@ -2,8 +2,7 @@ load("//tools/workspace:github.bzl", "github_archive") -# TODO(jwnimmer-tri) Rename this to match upstream gz-utils. -def ignition_utils_repository( +def gz_utils_internal_repository( name, mirrors = None): github_archive( @@ -13,6 +12,6 @@ def ignition_utils_repository( # constants in ./package.BUILD.bazel to match the new version number. commit = "ignition-utils1_1.0.0", sha256 = "55d3285692392f9493a35b680f275ec116584baedeef90de57d2b03dfd952d9d", # noqa - build_file = "@drake//tools/workspace/ignition_utils:package.BUILD.bazel", # noqa + build_file = "@drake//tools/workspace/gz_utils_internal:package.BUILD.bazel", # noqa mirrors = mirrors, ) diff --git a/tools/workspace/new_release.py b/tools/workspace/new_release.py index f60846ba4111..4a278a855619 100644 --- a/tools/workspace/new_release.py +++ b/tools/workspace/new_release.py @@ -65,14 +65,14 @@ # (This can be used to pin to a given major or major.minor release series.) _OVERLOOK_RELEASE_REPOSITORIES = { "github3_py": r"^(\d+.)", - "ignition_math": "", - "ignition_utils": "", + "gz_math": "", + "gz_utils": "", "intel_realsense_ros": r"^(\d+\.\d+\.)", "petsc": r"^(v)", "pycodestyle": "", - "qhull": r"^(2)", + "qhull_internal": r"^(2)", "ros_xacro": r"^(\d+\.\d+\.)", - "sdformat": "", + "sdformat_internal": "", } diff --git a/tools/workspace/sdformat/repository.bzl b/tools/workspace/sdformat/repository.bzl deleted file mode 100644 index a01d618447dd..000000000000 --- a/tools/workspace/sdformat/repository.bzl +++ /dev/null @@ -1,21 +0,0 @@ -# -*- python -*- - -load("//tools/workspace:github.bzl", "github_archive") - -def sdformat_repository( - name, - mirrors = None): - github_archive( - name = name, - repository = "gazebosim/sdformat", - commit = "sdformat12_12.5.0", - build_file = "@drake//tools/workspace/sdformat:package.BUILD.bazel", - sha256 = "3896772db68b7ca7b18bbf1945a72206885b03d3f0caf29491be5b53b79a7124", # noqa - patches = [ - "@drake//tools/workspace/sdformat:patches/console.patch", - "@drake//tools/workspace/sdformat:patches/deprecation_unit_testing.patch", # noqa - "@drake//tools/workspace/sdformat:patches/no_global_config.patch", - "@drake//tools/workspace/sdformat:patches/no_urdf.patch", - ], - mirrors = mirrors, - ) diff --git a/tools/workspace/sdformat/BUILD.bazel b/tools/workspace/sdformat_internal/BUILD.bazel similarity index 82% rename from tools/workspace/sdformat/BUILD.bazel rename to tools/workspace/sdformat_internal/BUILD.bazel index d4b739ac34f4..df9c31528512 100644 --- a/tools/workspace/sdformat/BUILD.bazel +++ b/tools/workspace/sdformat_internal/BUILD.bazel @@ -6,7 +6,7 @@ load("//tools/lint:lint.bzl", "add_lint_tests") exports_files( ["embed_sdf.py"], - visibility = ["@sdformat//:__pkg__"], + visibility = ["@sdformat_internal//:__pkg__"], ) drake_cc_binary( @@ -15,7 +15,7 @@ drake_cc_binary( deps = [ "//common:essential", "@gflags", - "@sdformat//:ign_sdf_cmdline", + "@sdformat_internal//:ign_sdf_cmdline", ], ) diff --git a/tools/workspace/sdformat/embed_sdf.py b/tools/workspace/sdformat_internal/embed_sdf.py similarity index 100% rename from tools/workspace/sdformat/embed_sdf.py rename to tools/workspace/sdformat_internal/embed_sdf.py diff --git a/tools/workspace/sdformat/ign_sdf_main.cc b/tools/workspace/sdformat_internal/ign_sdf_main.cc similarity index 100% rename from tools/workspace/sdformat/ign_sdf_main.cc rename to tools/workspace/sdformat_internal/ign_sdf_main.cc diff --git a/tools/workspace/sdformat/package.BUILD.bazel b/tools/workspace/sdformat_internal/package.BUILD.bazel similarity index 98% rename from tools/workspace/sdformat/package.BUILD.bazel rename to tools/workspace/sdformat_internal/package.BUILD.bazel index 8c9aadc7fd56..f1edb8b647cc 100644 --- a/tools/workspace/sdformat/package.BUILD.bazel +++ b/tools/workspace/sdformat_internal/package.BUILD.bazel @@ -134,7 +134,7 @@ genrule( py_binary( name = "embed_sdf", - srcs = ["@drake//tools/workspace/sdformat:embed_sdf.py"], + srcs = ["@drake//tools/workspace/sdformat_internal:embed_sdf.py"], python_version = "PY3", srcs_version = "PY3", ) @@ -241,8 +241,8 @@ cc_library( includes = ["include"], linkstatic = 1, deps = [ - "@ignition_math", - "@ignition_utils", + "@gz_math_internal//:gz_math", + "@gz_utils_internal//:gz_utils", "@tinyxml2", # N.B. It's very unusual to add a dependency from a third-party library # onto Drake, but in this case it's the simplest way to be able to send diff --git a/tools/workspace/sdformat/patches/console.patch b/tools/workspace/sdformat_internal/patches/console.patch similarity index 100% rename from tools/workspace/sdformat/patches/console.patch rename to tools/workspace/sdformat_internal/patches/console.patch diff --git a/tools/workspace/sdformat/patches/deprecation_unit_testing.patch b/tools/workspace/sdformat_internal/patches/deprecation_unit_testing.patch similarity index 100% rename from tools/workspace/sdformat/patches/deprecation_unit_testing.patch rename to tools/workspace/sdformat_internal/patches/deprecation_unit_testing.patch diff --git a/tools/workspace/sdformat/patches/no_global_config.patch b/tools/workspace/sdformat_internal/patches/no_global_config.patch similarity index 100% rename from tools/workspace/sdformat/patches/no_global_config.patch rename to tools/workspace/sdformat_internal/patches/no_global_config.patch diff --git a/tools/workspace/sdformat/patches/no_urdf.patch b/tools/workspace/sdformat_internal/patches/no_urdf.patch similarity index 100% rename from tools/workspace/sdformat/patches/no_urdf.patch rename to tools/workspace/sdformat_internal/patches/no_urdf.patch diff --git a/tools/workspace/sdformat_internal/repository.bzl b/tools/workspace/sdformat_internal/repository.bzl new file mode 100644 index 000000000000..35d98edb2a83 --- /dev/null +++ b/tools/workspace/sdformat_internal/repository.bzl @@ -0,0 +1,21 @@ +# -*- python -*- + +load("//tools/workspace:github.bzl", "github_archive") + +def sdformat_internal_repository( + name, + mirrors = None): + github_archive( + name = name, + repository = "gazebosim/sdformat", + commit = "sdformat12_12.5.0", + build_file = "@drake//tools/workspace/sdformat_internal:package.BUILD.bazel", # noqa + sha256 = "3896772db68b7ca7b18bbf1945a72206885b03d3f0caf29491be5b53b79a7124", # noqa + patches = [ + "@drake//tools/workspace/sdformat_internal:patches/console.patch", + "@drake//tools/workspace/sdformat_internal:patches/deprecation_unit_testing.patch", # noqa + "@drake//tools/workspace/sdformat_internal:patches/no_global_config.patch", # noqa + "@drake//tools/workspace/sdformat_internal:patches/no_urdf.patch", + ], + mirrors = mirrors, + ) diff --git a/tools/workspace/sdformat/test/ign_sdf_test.py b/tools/workspace/sdformat_internal/test/ign_sdf_test.py similarity index 97% rename from tools/workspace/sdformat/test/ign_sdf_test.py rename to tools/workspace/sdformat_internal/test/ign_sdf_test.py index e13e2a7e5491..1bfc0bfecdd6 100644 --- a/tools/workspace/sdformat/test/ign_sdf_test.py +++ b/tools/workspace/sdformat_internal/test/ign_sdf_test.py @@ -57,7 +57,7 @@ class TestIgnSdf(unittest.TestCase): def setUp(self): self.maxDiff = None - self.bin = "tools/workspace/sdformat/ign_sdf" + self.bin = "tools/workspace/sdformat_internal/ign_sdf" self.input_file = os.path.join( os.environ["TEST_TMPDIR"], "example.sdf" )