-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bazel: Cleanup workspace/dependencies
Signed-off-by: Ryan Northey <[email protected]>
- Loading branch information
Showing
6 changed files
with
126 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,16 @@ | ||
workspace(name = "aptly") | ||
|
||
load("//:deps.bzl", "dependencies") | ||
load(":archive.bzl", "load_archives") | ||
load_archives() | ||
|
||
load("//:deps.bzl", "dependencies") | ||
dependencies() | ||
|
||
load("//:deps-go.bzl", "aptly_dependencies", "go_dependencies") | ||
|
||
go_dependencies() | ||
|
||
|
||
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") | ||
|
||
py_repositories() | ||
|
||
python_register_toolchains( | ||
name = "python_3_11", | ||
# Available versions are listed in @rules_python//python:versions.bzl. | ||
# We recommend using the same version your team is already standardized on. | ||
python_version = "3.11", | ||
) | ||
|
||
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") | ||
|
||
rules_proto_dependencies() | ||
|
||
load("@rules_proto//proto:setup.bzl", "rules_proto_setup") | ||
|
||
rules_proto_setup() | ||
|
||
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") | ||
|
||
rules_proto_toolchains() | ||
|
||
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") | ||
|
||
protobuf_deps() | ||
|
||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") | ||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | ||
|
||
go_rules_dependencies() | ||
|
||
go_register_toolchains(version = "1.22.4") | ||
load("//:setup.bzl", "setup") | ||
setup() | ||
|
||
gazelle_dependencies(go_repository_default_config = "//:WORKSPACE") | ||
load("//:toolchains.bzl", "toolchains") | ||
toolchains() | ||
|
||
# gazelle:repo bazel_gazelle | ||
# gazelle:repository_macro deps-go.bzl%go_dependencies | ||
aptly_dependencies() | ||
go_dependencies() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") | ||
load("//:versions.bzl", "VERSIONS") | ||
|
||
def load_github_archives(): | ||
for k, v in VERSIONS.items(): | ||
if type(v) == type("") or v.get("type") != "github_archive": | ||
continue | ||
kwargs = dict(name = k, **v) | ||
http_archive( | ||
**{ | ||
k: ( | ||
(v.format(**kwargs) if not k.startswith("patch") else v) | ||
if type(v) == "string" | ||
else [ | ||
_v.format(**kwargs) if not k.startswith("patch") else _v | ||
for _v in v | ||
] | ||
) | ||
for k, v in kwargs.items() | ||
if k not in ["repo", "type", "version"] | ||
} | ||
) | ||
|
||
def load_archives(): | ||
load_github_archives() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
load("@rules_proto//proto:setup.bzl", "rules_proto_setup") | ||
|
||
def setup(): | ||
rules_proto_setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") | ||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | ||
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") | ||
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") | ||
|
||
def toolchains(): | ||
py_repositories() | ||
python_register_toolchains( | ||
name = "python3_12", | ||
# Available versions are listed in @rules_python//python:versions.bzl. | ||
# We recommend using the same version your team is already standardized on. | ||
python_version = "3.12", | ||
) | ||
rules_proto_toolchains() | ||
go_rules_dependencies() | ||
go_register_toolchains(version = "1.22.4") | ||
gazelle_dependencies(go_repository_default_config = "//:WORKSPACE") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
VERSIONS = { | ||
"python": "3.12", | ||
"aspect_bazel_lib": { | ||
"type": "github_archive", | ||
"repo": "aspect-build/bazel-lib", | ||
"version": "2.7.9", | ||
"sha256": "ccb66940aff9dfded4b03b929c83803f386807ef5ea4960404dfa8a7715cb74f", | ||
"urls": ["https://github.com/{repo}/archive/v{version}.tar.gz"], | ||
"strip_prefix": "bazel-lib-{version}", | ||
}, | ||
"bazel_gazelle": { | ||
"type": "github_archive", | ||
"repo": "bazelbuild/bazel-gazelle", | ||
"version": "0.37.0", | ||
"sha256": "d76bf7a60fd8b050444090dfa2837a4eaf9829e1165618ee35dceca5cbdf58d5", | ||
"urls": ["https://github.com/{repo}/releases/download/bazel-gazelle-v{version}.tar.gz"], | ||
}, | ||
"com_google_protobuf": { | ||
"type": "github_archive", | ||
"repo": "protocolbuffers/protobuf", | ||
"version": "26.1", | ||
"sha256": "4fc5ff1b2c339fb86cd3a25f0b5311478ab081e65ad258c6789359cd84d421f8", | ||
"urls": ["https://github.com/{repo}/releases/download/v{version}/protobuf-{version}.tar.gz"], | ||
"strip_prefix": "protobuf-{version}", | ||
}, | ||
"envoy": { | ||
"type": "github_archive", | ||
"repo": "envoyproxy/envoy", | ||
"version": "fea66c359069991e88bdfa4e0f2883c90cc39aef", | ||
"sha256": "96294f4b491c676b650ddeb07c7986ec7e48b5ae5a75c4adebbb9a58741a2fb1", | ||
"urls": ["https://github.com/{repo}/archive/{version}.tar.gz"], | ||
"strip_prefix": "envoy-{version}", | ||
}, | ||
"envoy_toolshed": { | ||
"type": "github_archive", | ||
"repo": "envoyproxy/toolshed", | ||
"version": "0.1.4", | ||
"sha256": "7ddfd251a89518b97c4eb8064a7d37454bbd998bf29e4cd3ad8f44227b5ca7b3", | ||
"urls": ["https://github.com/{repo}/archive/bazel-v{version}.tar.gz"], | ||
"strip_prefix": "toolshed-bazel-v{version}/bazel", | ||
}, | ||
"rules_proto": { | ||
"type": "github_archive", | ||
"repo": "bazelbuild/rules_proto", | ||
"version": "6.0.2", | ||
"sha256": "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", | ||
"urls": ["https://github.com/{repo}/archive/refs/tags/{version}.tar.gz"], | ||
"strip_prefix": "rules_proto-{version}", | ||
}, | ||
"rules_python": { | ||
"type": "github_archive", | ||
"repo": "bazelbuild/rules_python", | ||
"version": "0.32.2", | ||
"sha256": "4912ced70dc1a2a8e4b86cec233b192ca053e82bc72d877b98e126156e8f228d", | ||
"urls": ["https://github.com/{repo}/archive/{version}.tar.gz"], | ||
"strip_prefix": "rules_python-{version}", | ||
}, | ||
|
||
|
||
} |