Skip to content

Commit

Permalink
Use the Go Jsonnet port instead of the C++ port
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Harris committed Jul 2, 2019
1 parent 67b2484 commit d121631
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
Empty file added BUILD
Empty file.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ external repositories for Jsonnet:
```python
http_archive(
name = "io_bazel_rules_jsonnet",
# TODO: Update this to reflect a later release.
sha256 = "59bf1edb53bc6b5adb804fbfabd796a019200d4ef4dd5cc7bdee03acc7686806",
strip_prefix = "rules_jsonnet-0.1.0",
urls = ["https://github.com/bazelbuild/rules_jsonnet/archive/0.1.0.tar.gz"],
)
load("@io_bazel_rules_jsonnet//jsonnet:jsonnet.bzl", "jsonnet_repositories")

jsonnet_repositories()

load("@jsonnet_go//bazel:repositories.bzl", "jsonnet_go_repositories")

jsonnet_go_repositories()

load("@jsonnet_go//bazel:deps.bzl", "jsonnet_go_dependencies")

jsonnet_go_dependencies()
```

<a name="#jsonnet_library"></a>
Expand Down
8 changes: 8 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ load("//jsonnet:jsonnet.bzl", "jsonnet_repositories")

jsonnet_repositories()

load("@jsonnet_go//bazel:repositories.bzl", "jsonnet_go_repositories")

jsonnet_go_repositories()

load("@jsonnet_go//bazel:deps.bzl", "jsonnet_go_dependencies")

jsonnet_go_dependencies()

# Used for documenting Jsonnet rules.
# TODO: Move this to docs/WORKSPACE when recursive repositories are enabled.
git_repository(
Expand Down
1 change: 0 additions & 1 deletion examples/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_jsonnet//jsonnet:jsonnet.bzl",
"jsonnet_library",
"jsonnet_to_json",
"jsonnet_to_json_test",
)

Expand Down
3 changes: 2 additions & 1 deletion examples/invalid.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
RUNTIME ERROR: Foo.
../examples/invalid.jsonnet:15:1-13
../examples/invalid.jsonnet:15:1-13 $
During evaluation
17 changes: 8 additions & 9 deletions jsonnet/jsonnet.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

"""Jsonnet Rules
Expand Down Expand Up @@ -403,7 +403,7 @@ _jsonnet_common_attrs = {
),
"imports": attr.string_list(),
"jsonnet": attr.label(
default = Label("@jsonnet//cmd:jsonnet"),
default = Label("@jsonnet_go//cmd/jsonnet"),
cfg = "host",
executable = True,
allow_single_file = True,
Expand Down Expand Up @@ -788,11 +788,10 @@ Example:

def jsonnet_repositories():
"""Adds the external dependencies needed for the Jsonnet rules."""
http_archive(
name = "jsonnet",
sha256 = "f6f0c4ea333f3423f1a7237a8a107c589354c38be8a2a438198f9f7c69b77596",
strip_prefix = "jsonnet-0.13.0",
urls = [
"https://github.com/google/jsonnet/archive/v0.13.0.tar.gz",
],
git_repository(
name = "jsonnet_go",
# TODO: Update this once google/go-jsonnet#292 lands.
remote = "https://github.com/seh/go-jsonnet",
commit = "d66e58738f9ee529e34772ccd0e265a1c4b251f2",
init_submodules = True,
)

0 comments on commit d121631

Please sign in to comment.