Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of "go-jsonnet" Bazel repository as an external dependency #292

Merged

Conversation

seh
Copy link
Contributor

@seh seh commented Jul 2, 2019

In order to rely on the go-jsonnet Bazel repository as an external dependency from other Bazel projects, until it becomes possible to load a WORKSPACE file, it's necessary to first declare the repositories on which this repository depends (rules_go and gazelle), and then to load file from those two repositories and call macros to initialize them.

Expose two files to handle these steps:

  • bazel/repositories.bzl .
    Defines the jsonnet_go_repositories macro.
  • bazel/deps.bzl .
    Defines the jsonnet_go_dependencies macro.

Use these files and the macros they define within this repository's WORKSPACE file, as a dependent repository would do in its WORKSPACE file.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 77.343% when pulling d66e587 on seh:hoist-bazel-dependencies-into-functions into 8cd516f on google:master.

@sbarzowski
Copy link
Collaborator

I don't get the full Bazelology, but it looks reasonable.

@sbarzowski sbarzowski merged commit 4996d46 into google:master Jul 4, 2019
seh referenced this pull request in davidzchen/cue Jan 13, 2020
Generated with the following commands:

```sh
bazel run //:gazelle -- update-repos -from_file=go.mod
bazel run //:gazelle
```

Tested by successfully building the `cue` binary:

```sh
bazel build //cmd/cue
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants