Skip to content

Commit 9bffde4

Browse files
committed
Rename the expand_header_template template_rule.
1 parent 72f1ba0 commit 9bffde4

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

third_party/common.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# and replaces them with the corresponding values.
44
#
55
# Typical usage:
6-
# load("/tools/build_rules/expand_header_template", "expand_header_template")
7-
# expand_header_template(
6+
# load("/tools/build_rules/template_rule", "expand_header_template")
7+
# template_rule(
88
# name = "ExpandMyTemplate",
99
# src = "my.template",
1010
# out = "my.txt",
@@ -20,14 +20,14 @@
2020
# out: The destination of the expanded file
2121
# substitutions: A dictionary mapping strings to their substitutions
2222

23-
def expand_header_template_impl(ctx):
23+
def template_rule_impl(ctx):
2424
ctx.template_action(
2525
template = ctx.file.src,
2626
output = ctx.outputs.out,
2727
substitutions = ctx.attr.substitutions,
2828
)
2929

30-
expand_header_template = rule(
30+
template_rule = rule(
3131
attrs = {
3232
"src": attr.label(
3333
mandatory = True,
@@ -39,5 +39,5 @@ expand_header_template = rule(
3939
},
4040
# output_to_genfiles is required for header files.
4141
output_to_genfiles = True,
42-
implementation = expand_header_template_impl,
42+
implementation = template_rule_impl,
4343
)

third_party/jpeg/jpeg.BUILD

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ licenses(["notice"]) # custom notice-style license, see LICENSE.md
55

66
exports_files(["LICENSE.md"])
77

8-
load("@//third_party:common.bzl", "expand_header_template")
8+
load("@//third_party:common.bzl", "template_rule")
99

1010
libjpegturbo_nocopts = "-[W]error"
1111

@@ -276,7 +276,7 @@ cc_library(
276276
nocopts = libjpegturbo_nocopts,
277277
)
278278

279-
expand_header_template(
279+
template_rule(
280280
name = "jconfig_win",
281281
src = "win/jconfig.h.in",
282282
out = "jconfig_win.h",
@@ -289,7 +289,7 @@ expand_header_template(
289289
},
290290
)
291291

292-
expand_header_template(
292+
template_rule(
293293
name = "jconfigint_win",
294294
src = "win/jconfigint.h.in",
295295
out = "jconfigint_win.h",
@@ -328,21 +328,21 @@ JCONFIG_NOWIN_NOSIMD_SUBSTITUTIONS = JCONFIG_NOWIN_COMMON_SUBSTITUTIONS + {
328328
"#undef WITH_SIMD": "",
329329
}
330330

331-
expand_header_template(
331+
template_rule(
332332
name = "jconfig_nowin_nosimd",
333333
src = "jconfig.h.in",
334334
out = "jconfig_nowin_nosimd.h",
335335
substitutions = JCONFIG_NOWIN_NOSIMD_SUBSTITUTIONS,
336336
)
337337

338-
expand_header_template(
338+
template_rule(
339339
name = "jconfig_nowin_simd",
340340
src = "jconfig.h.in",
341341
out = "jconfig_nowin_simd.h",
342342
substitutions = JCONFIG_NOWIN_SIMD_SUBSTITUTIONS,
343343
)
344344

345-
expand_header_template(
345+
template_rule(
346346
name = "jconfigint_nowin",
347347
src = "jconfigint.h.in",
348348
out = "jconfigint_nowin.h",

third_party/llvm/llvm.BUILD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ load(
1515
)
1616
load(
1717
"@//third_party:common.bzl",
18-
"expand_header_template",
18+
"template_rule",
1919
)
2020

2121
package(default_visibility = ["@//tensorflow/compiler/xla:internal"])
@@ -179,7 +179,7 @@ expand_cmake_vars(
179179
)
180180

181181
# Performs macro expansions on .def.in files
182-
expand_header_template(
182+
template_rule(
183183
name = "targets_def_gen",
184184
src = "include/llvm/Config/Targets.def.in",
185185
out = "include/llvm/Config/Targets.def",
@@ -190,7 +190,7 @@ expand_header_template(
190190
},
191191
)
192192

193-
expand_header_template(
193+
template_rule(
194194
name = "asm_parsers_def_gen",
195195
src = "include/llvm/Config/AsmParsers.def.in",
196196
out = "include/llvm/Config/AsmParsers.def",
@@ -201,7 +201,7 @@ expand_header_template(
201201
},
202202
)
203203

204-
expand_header_template(
204+
template_rule(
205205
name = "asm_printers_def_gen",
206206
src = "include/llvm/Config/AsmPrinters.def.in",
207207
out = "include/llvm/Config/AsmPrinters.def",
@@ -212,7 +212,7 @@ expand_header_template(
212212
},
213213
)
214214

215-
expand_header_template(
215+
template_rule(
216216
name = "disassemblers_def_gen",
217217
src = "include/llvm/Config/Disassemblers.def.in",
218218
out = "include/llvm/Config/Disassemblers.def",

0 commit comments

Comments
 (0)