Skip to content

Commit d51339c

Browse files
authored
refactor: use $execpath instead of deprecated $location (#18961)
See https://docs.bazel.build/versions/master/be/make-variables.html#predefined_label_variables: "This is legacy pre-Starlark behavior and not recommended unless you really know what it does for a particular rule."
1 parent 8a71288 commit d51339c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/components-examples/BUILD.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ genrule(
120120
],
121121
cmd = """
122122
# Create source file manifest
123-
echo "$(locations //src/components-examples:example-source-files)" \
124-
> $(location _example_module.MF)
123+
echo "$(execpaths //src/components-examples:example-source-files)" \
124+
> $(execpath _example_module.MF)
125125
126126
# Run the bazel entry-point for generating the example module.
127-
./$(location //tools/example-module:bazel-bin) \
128-
"$(location _example_module.MF)" \
129-
"$(location example-module.ts)" \
127+
./$(execpath //tools/example-module:bazel-bin) \
128+
"$(execpath _example_module.MF)" \
129+
"$(execpath example-module.ts)" \
130130
"$$PWD/src/components-examples"
131131
""",
132132
output_to_bindir = True,

src/material/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ scss_bundle(
2626
name = "theming_bundle",
2727
outs = ["_theming.scss"],
2828
args = [
29-
"--entryFile=$(location //src/material/core:theming/_all-theme.scss)",
30-
"--outFile=$(location :_theming.scss)",
29+
"--entryFile=$(execpath //src/material/core:theming/_all-theme.scss)",
30+
"--outFile=$(execpath :_theming.scss)",
3131
],
3232
data = CDK_SCSS_LIBS + MATERIAL_SCSS_LIBS + [
3333
"//src/material/core:theming/_all-theme.scss",

tools/defaults.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], tags = [], **k
227227
outs = ["%s.js" % css_id],
228228
output_to_bindir = True,
229229
cmd = """
230-
files=($(locations %s))
230+
files=($(execpaths %s))
231231
# Escape all double-quotes so that the content can be safely inlined into the
232232
# JS template. Note that it needs to be escaped a second time because the string
233233
# will be evaluated first in Bash and will then be stored in the JS output.

0 commit comments

Comments
 (0)