forked from Calsign/gazelle_rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE
82 lines (58 loc) · 2.28 KB
/
WORKSPACE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
workspace(name = "gazelle_rust")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# versions of dependencies
load(":deps_versions.bzl", "versions")
# Go/Gazelle
http_archive(
name = "io_bazel_rules_go",
sha256 = versions.RULES_GO_SHA256,
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v{0}/rules_go-v{0}.zip".format(versions.RULES_GO_VERSION),
"https://github.com/bazelbuild/rules_go/releases/download/v{0}/rules_go-v{0}.zip".format(versions.RULES_GO_VERSION),
],
)
http_archive(
name = "bazel_gazelle",
patches = [
# this patch is needed for unused crate detection
"//patches:bazel-gazelle.patch",
],
sha256 = versions.GAZELLE_SHA256,
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v{0}/bazel-gazelle-v{0}.tar.gz".format(versions.GAZELLE_VERSION),
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v{0}/bazel-gazelle-v{0}.tar.gz".format(versions.GAZELLE_VERSION),
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
go_rules_dependencies()
go_register_toolchains(
nogo = "@//:nogo",
version = versions.GO_VERSION,
)
gazelle_dependencies()
# Rust
http_archive(
name = "rules_rust",
sha256 = versions.RULES_RUST_SHA256,
urls = [
"https://github.com/bazelbuild/rules_rust/releases/download/{0}/rules_rust-v{0}.tar.gz".format(versions.RULES_RUST_VERSION),
],
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
rules_rust_dependencies()
rust_register_toolchains(
edition = "2021",
versions = [versions.RUST_VERSION],
)
# rust-analyzer support
# run the following command to generate rust-project.json:
# bazel run @rules_rust//tools/rust_analyzer:gen_rust_project
load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies")
rust_analyzer_dependencies()
# gazelle_rust dependencies
load("//:deps1.bzl", "gazelle_rust_dependencies1")
gazelle_rust_dependencies1()
load("//:deps2.bzl", "gazelle_rust_dependencies2")
gazelle_rust_dependencies2()
# gazelle:repository_macro go_deps.bzl%go_dependencies