-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
92 lines (84 loc) · 2.44 KB
/
MODULE.bazel
File metadata and controls
92 lines (84 loc) · 2.44 KB
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
83
84
85
86
87
88
89
90
91
92
module(
name = "rules_elixir",
version = "1.1.0",
)
bazel_dep(
name = "bazel_skylib",
version = "1.7.1",
)
bazel_dep(
name = "rules_erlang",
version = "3.16.0",
)
archive_override(
module_name = "rules_erlang",
integrity = "sha256-Gg1A/QyTHsHarL0EAOLhe2nTHlcnVngJLBZukcGvaOw=",
strip_prefix = "rules_erlang-b4b01911b99944fa0c9efb66bf3d9030ee784fa9/",
url = "https://github.com/discord/rules_erlang/archive/b4b01911b99944fa0c9efb66bf3d9030ee784fa9.tar.gz",
)
# erlang_config is needed so @erlang_config is visible in repos created
# by the elixir_config extension (for wiring the OTP build dependency).
erlang_config = use_extension(
"@rules_erlang//bzlmod:extensions.bzl",
"erlang_config",
)
use_repo(
erlang_config,
"erlang_config",
)
elixir_config = use_extension(
"@rules_elixir//bzlmod:extensions.bzl",
"elixir_config",
)
use_repo(
elixir_config,
"elixir_config",
)
# Use elixir_packages extension to get hex_pm
elixir_packages = use_extension(
"@rules_elixir//bzlmod:extensions.bzl",
"elixir_packages",
)
# These two manually-managed packages are necessary to bootstrap hex
# (configured in `bzlmod/private/elixir_packages.bzl)
# "Why do we build hex if we're not going to use it to manage 3p packages",
# do I hear you ask?
# It turns out that mix depends on hex to determine if missing packages are
# needed, which is the case for dependencies only used at dev or test time. If
# we do not bootstrap hex ourselves and provide it at compile time, mix will
# throw an error upon encountering any dev- or test-only packages that aren't
# explicitly provided as `deps`.
elixir_packages.hex_package(
name = "jason",
build_file_content = """
load("@rules_elixir//:defs.bzl", "elixir_app")
elixir_app(
srcs = glob(["lib/**/*.ex"]),
app_name = "jason",
app_version = "1.4.4",
visibility = ["//visibility:public"],
)
""",
sha256 = "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b",
version = "1.4.4",
)
elixir_packages.hex_package(
name = "decimal",
build_file_content = """
load("@rules_elixir//:defs.bzl", "elixir_app")
elixir_app(
srcs = glob(["lib/**/*.ex"]),
app_name = "decimal",
app_version = "2.3.0",
visibility = ["//visibility:public"],
)
""",
sha256 = "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac",
version = "2.3.0",
)
use_repo(
elixir_packages,
"decimal",
"hex_pm",
"jason",
)