angular-cli/tools/ng_cli_schema_generator.bzl
Charles Lyding e402c2358c build: adjust BUILD file external comment markers
Improvements to the syncing process allow for reduced usage of the comment markers.
2022-08-31 08:37:19 -04:00

45 lines
1.1 KiB
Python

# Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license
def _cli_json_schema_interface_impl(ctx):
args = [
ctx.files.src[0].path,
ctx.outputs.json.path,
]
ctx.actions.run(
inputs = ctx.files.src + ctx.files.data,
executable = ctx.executable._binary,
outputs = [ctx.outputs.json],
arguments = args,
)
return [DefaultInfo()]
cli_json_schema = rule(
_cli_json_schema_interface_impl,
attrs = {
"src": attr.label(
allow_files = [".json"],
mandatory = True,
),
"out": attr.string(
mandatory = True,
),
"data": attr.label_list(
allow_files = [".json"],
mandatory = True,
),
"_binary": attr.label(
default = Label("//tools:ng_cli_schema"),
executable = True,
cfg = "exec",
),
},
outputs = {
"json": "%{out}",
},
)