Skip to content

Commit

Permalink
Update buildifier setup instructions. (#672)
Browse files Browse the repository at this point in the history
The previous instructions don't work with new versions of bazel like
0.28.0.
  • Loading branch information
g-easy authored and vladmos committed Jul 22, 2019
1 parent 4553d0b commit 7ad239a
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions buildifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,47 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
http_archive(
name = "io_bazel_rules_go",
sha256 = "f87fa87475ea107b3c69196f39c82b7bbf58fe27c62a338684c20ca17d1d8613",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.16.2/rules_go-0.16.2.tar.gz",
sha256 = "9fb16af4d4836c8222142e54c9efa0bb5fc562ffc893ce2abeac3e25daead144",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains()

http_archive(
name = "com_github_bazelbuild_buildtools",
strip_prefix = "buildtools-<commit hash>",
url = "https://github.com/bazelbuild/buildtools/archive/<commit hash>.zip",
name = "bazel_gazelle",
sha256 = "be9296bfd64882e3c08e3283c58fcb461fa6dd3c171764fcc4cf322f60615a9b",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
],
)

load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

go_rules_dependencies()
gazelle_dependencies()

go_register_toolchains()
http_archive(
name = "com_google_protobuf",
strip_prefix = "protobuf-master",
urls = ["https://github.com/protocolbuffers/protobuf/archive/master.zip"],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

buildifier_dependencies()
http_archive(
name = "com_github_bazelbuild_buildtools",
strip_prefix = "buildtools-master",
url = "https://github.com/bazelbuild/buildtools/archive/master.zip",
)
```

`BUILD.bazel` typically in the workspace root:
Expand Down

0 comments on commit 7ad239a

Please sign in to comment.