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

makes buf version configurable #10

Merged
merged 4 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ stardoc(
],
)

alias(
name = "generate_deps",
actual = "//buf/internal/cmd/generate_deps:generate_deps",
)

buildifier(
name = "buildifier",
)
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("//buf:repositories.bzl", "rules_buf_dependencies", "rules_buf_toolchains")

rules_buf_dependencies()

rules_buf_toolchains()
rules_buf_toolchains(version = "v1.0.0-rc12")

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")

Expand Down
2 changes: 1 addition & 1 deletion buf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bzl_library(
srcs = ["repositories.bzl"],
deps = [
"//buf/internal:dependencies",
"//tools:toolchain",
"//buf/internal:toolchain",
"@bazel_tools//tools/build_defs/repo:http.bzl",
"@bazel_tools//tools/build_defs/repo:utils.bzl",
],
Expand Down
10 changes: 10 additions & 0 deletions buf/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ bzl_library(
name = "dependencies",
srcs = ["dependencies.bzl"],
)

bzl_library(
name = "toolchain",
srcs = [
"toolchain.bzl",
],
deps = [
"@bazel_tools//tools/build_defs/repo:utils.bzl",
],
)
14 changes: 0 additions & 14 deletions buf/internal/cmd/generate_deps/BUILD.bazel

This file was deleted.

73 changes: 0 additions & 73 deletions buf/internal/cmd/generate_deps/main.go

This file was deleted.

99 changes: 7 additions & 92 deletions buf/internal/dependencies.bzl
Original file line number Diff line number Diff line change
@@ -1,97 +1,7 @@
"""rules_buf dependencies"""

buf_toolchains_dependencies = {
"buf-osx-arm64": {
"sha256": "af48c127fac69c443d29db423735e74da7c36237d6054d980582e10f1fe1c258",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/buf-Darwin-arm64"],
"executable": True,
},
"buf-osx-x86_64": {
"sha256": "53cf0d2e175d2556948b6dddf9f5c2a76893926513252165690b581279c5821f",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/buf-Darwin-x86_64"],
"executable": True,
},
"buf-linux-aarch64": {
"sha256": "62b9a21769971ff38a25583da3282cb82d8dbe0021eee7e2b0c062abafd22bcc",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/buf-Linux-aarch64"],
"executable": True,
},
"buf-linux-x86_64": {
"sha256": "50c1c65222c55e84251180d9c038962865fb0049653125a2f4fb522f043117b2",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/buf-Linux-x86_64"],
"executable": True,
},
"buf-windows-arm64": {
"sha256": "2008148e20b4025d1b9ea43b523026cc0d6cdec25d4eeb3f8fcd958be049a74f",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/buf-Windows-arm64.exe"],
"executable": True,
},
"buf-windows-x86_64": {
"sha256": "0d41c6b062e3dc1f96a649114c2076e763dd6275661e40a66caf6d4316f21706",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/buf-Windows-x86_64.exe"],
"executable": True,
},
"protoc-gen-buf-breaking-osx-arm64": {
"sha256": "ae7b256062abb59904c0a5f6ee627e32307c36e328d247d1836087d67fdcf906",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-breaking-Darwin-arm64"],
"executable": True,
},
"protoc-gen-buf-breaking-osx-x86_64": {
"sha256": "597630e7519894fe24a976685455437ca3850019d41d9c973e21ffaea96cb944",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-breaking-Darwin-x86_64"],
"executable": True,
},
"protoc-gen-buf-breaking-linux-aarch64": {
"sha256": "297aa090e3c2aa335dd70e0a30517236dc0d43f88f2d2c2aa2f83c4d2b2fb9d5",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-breaking-Linux-aarch64"],
"executable": True,
},
"protoc-gen-buf-breaking-linux-x86_64": {
"sha256": "a845d8acc57a800ce166344050436b12695f87c8750283eea91ea7e339a502e2",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-breaking-Linux-x86_64"],
"executable": True,
},
"protoc-gen-buf-breaking-windows-arm64": {
"sha256": "6e372f4d609a53f47e6ad8883c4fbf1c31e74b83122de45a38d43abbecc7c748",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-breaking-Windows-arm64.exe"],
"executable": True,
},
"protoc-gen-buf-breaking-windows-x86_64": {
"sha256": "f7e6139932e28b3e3fd5837f2f94c13678b978ebfdc1c84d72dc94fdf9dc29c4",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-breaking-Windows-x86_64.exe"],
"executable": True,
},
"protoc-gen-buf-lint-osx-arm64": {
"sha256": "612c1f3967b10f34f9bb112331e473ecbcd44458bcf438a01bc0826cfbb66086",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-lint-Darwin-arm64"],
"executable": True,
},
"protoc-gen-buf-lint-osx-x86_64": {
"sha256": "3960ba4111f05e85c5c1d772fdb00da1aa14eac16f2bfdeede6db2c66805b9a9",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-lint-Darwin-x86_64"],
"executable": True,
},
"protoc-gen-buf-lint-linux-aarch64": {
"sha256": "45165de7e24c3d2298b343e868eefde8f5f25435477e0645caacf464221982c7",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-lint-Linux-aarch64"],
"executable": True,
},
"protoc-gen-buf-lint-linux-x86_64": {
"sha256": "9e8a92491477fec00c6414231b35f78099f3f5b6e674a3812f59461af8af0b3c",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-lint-Linux-x86_64"],
"executable": True,
},
"protoc-gen-buf-lint-windows-arm64": {
"sha256": "f758dfddd12dd9124d4b70c63f8ad1b841a1c28866af6f9be258a00b5063a211",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-lint-Windows-arm64.exe"],
"executable": True,
},
"protoc-gen-buf-lint-windows-x86_64": {
"sha256": "8cfb5a8d19571738b20a83a067f6b44e63c6747413b6a4d6b408118e079fbfe0",
"urls": ["https://github.com/bufbuild/buf/releases/download/v1.0.0-rc11/protoc-gen-buf-lint-Windows-x86_64.exe"],
"executable": True,
},
}
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

bazel_dependencies = {
"bazel_skylib": {
Expand All @@ -110,3 +20,8 @@ bazel_dependencies = {
],
},
}

def rules_buf_dependencies():
"""Utility method to load all dependencies of `rules_buf`."""
for name in bazel_dependencies:
maybe(http_archive, name, **bazel_dependencies[name])
Loading