Skip to content

Commit ceaff54

Browse files
authored
fix(2.x): alias DirectoryPath to bazel_lib (#1219)
The goal is to make libraries such as rules_js not have to depend on both v2 and v3 for backward compatibility.
1 parent 3713621 commit ceaff54

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

lib/private/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ bzl_library(
9696
name = "directory_path",
9797
srcs = ["directory_path.bzl"],
9898
visibility = ["//lib:__subpackages__"],
99-
deps = ["//lib:utils"],
99+
deps = [
100+
"//lib:utils",
101+
"@bazel_lib//lib:directory_path",
102+
],
100103
)
101104

102105
#keep

lib/private/directory_path.bzl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
with a path nested within that directory
33
"""
44

5+
load("@bazel_lib//lib:directory_path.bzl", _DirectoryPathInfo = "DirectoryPathInfo")
56
load("//lib:utils.bzl", _to_label = "to_label")
67

7-
DirectoryPathInfo = provider(
8-
doc = "Joins a label pointing to a TreeArtifact with a path nested within that directory.",
9-
fields = {
10-
"directory": "a TreeArtifact (ctx.actions.declare_directory)",
11-
"path": "path relative to the directory",
12-
},
13-
)
8+
# Alias the modern bazel_lib v3 providers to ease migration of rulesets to v3.
9+
DirectoryPathInfo = _DirectoryPathInfo
1410

1511
def _directory_path(ctx):
1612
if not ctx.file.directory.is_directory:

0 commit comments

Comments
 (0)