diff options
author | 2016-03-15 19:45:50 +0000 | |
---|---|---|
committer | 2016-03-15 20:30:55 +0000 | |
commit | d2ae1ca3dfa92d2e1df60cefe9a9c461e12bc966 (patch) | |
tree | b4f8a9453eb44cd2cfd53c4b45cc368d0f07d14e /tools | |
parent | 73476e9bd5323b12c947dfeee3647d3eca765f79 (diff) |
Enable overriding jsonnet binaries and stdlib for Jsonnet rules.
RELNOTES: Enable overriding jsonnet binaries and stdlib for Jsonnet rules.
--
MOS_MIGRATED_REVID=117267276
Diffstat (limited to 'tools')
-rw-r--r-- | tools/build_defs/jsonnet/jsonnet.bzl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/build_defs/jsonnet/jsonnet.bzl b/tools/build_defs/jsonnet/jsonnet.bzl index cdd6890810..dcb308bf87 100644 --- a/tools/build_defs/jsonnet/jsonnet.bzl +++ b/tools/build_defs/jsonnet/jsonnet.bzl @@ -50,8 +50,8 @@ def _jsonnet_library_impl(ctx): def _jsonnet_toolchain(ctx): return struct( - jsonnet_path = ctx.file._jsonnet.path, - imports = ["-J %s" % ctx.file._std.dirname]) + jsonnet_path = ctx.file.jsonnet.path, + imports = ["-J %s" % ctx.file.std.dirname]) def _jsonnet_to_json_impl(ctx): """Implementation of the jsonnet_to_json rule.""" @@ -93,7 +93,7 @@ def _jsonnet_to_json_impl(ctx): command += [ctx.file.src.path, "-o", compiled_json.path] compile_inputs = ( - [ctx.file.src, ctx.file._jsonnet, ctx.file._std] + + [ctx.file.src, ctx.file.jsonnet, ctx.file.std] + list(depinfo.transitive_sources)) ctx.action( @@ -155,7 +155,7 @@ def _jsonnet_to_json_test_impl(ctx): jsonnet_vars = ctx.attr.vars jsonnet_code_vars = ctx.attr.code_vars jsonnet_command = " ".join( - ["OUTPUT=$(%s" % ctx.file._jsonnet.short_path] + + ["OUTPUT=$(%s" % ctx.file.jsonnet.short_path] + ["-J %s/%s" % (ctx.label.package, im) for im in ctx.attr.imports] + ["-J %s" % im for im in depinfo.imports] + toolchain.imports + @@ -180,7 +180,7 @@ def _jsonnet_to_json_test_impl(ctx): executable = True); test_inputs = ( - [ctx.file.src, ctx.file._jsonnet, ctx.file._std] + + [ctx.file.src, ctx.file.jsonnet, ctx.file.std] + golden_files + list(depinfo.transitive_sources)) @@ -191,11 +191,11 @@ _jsonnet_common_attrs = { "deps": attr.label_list(providers = ["transitive_jsonnet_files"], allow_files = False), "imports": attr.string_list(), - "_jsonnet": attr.label( + "jsonnet": attr.label( default = Label("@bazel_tools//tools/build_defs/jsonnet:jsonnet"), executable = True, single_file = True), - "_std": attr.label( + "std": attr.label( default = Label("@bazel_tools//tools/build_defs/jsonnet:std"), single_file = True), } |