-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMODULE.bazel
More file actions
168 lines (144 loc) · 5.26 KB
/
Copy pathMODULE.bazel
File metadata and controls
168 lines (144 loc) · 5.26 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
"""
The project's root module.
This declares what dependencies the entire project relies upon, and binds them to their version.
"""
module(
name = "bite-sized-bazel",
version = "1.0",
)
# Dependencies
## Rules used to compile Java code and produce executables/JARs
bazel_dep(
name = "rules_java",
version = "8.12.0",
)
## Rules to download dependencies from Maven Central
bazel_dep(
name = "rules_jvm_external",
version = "6.8",
)
## Aliases local uses of `maven` to the rules defined by `rules_jvm_external`
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
# Defines the dependencies and source repositories we'd like to install from
maven.install(
# The artifacts we've installed from Maven central
artifacts = [
"com.google.code.gson:gson:2.13.2", # JSON Encoding
"junit:junit:4.13.2", # Java Testing
"org.clojure:clojure:1.12.3", # The Clojure Programming Language
"cheshire:cheshire:6.1.0", # Clojure JSON Encoding
],
# Installs the source JAR alongside the artifact JAR
fetch_sources = True,
# Makes rules_jvm_external aware of other Bazel modules locally, or in the source code of dependencies
known_contributing_modules = [
"bite-sized-bazel",
"protobuf",
],
# The file where rules_jvm_external stores how transitive dependencies were resolved
lock_file = "//:maven_install.json",
# The list of Maven repositories and mirrors we'll download dependencies from
# This will be inspected and attempted in a top-down order
repositories = [
"https://repo1.maven.org/maven2",
"https://maven-central.storage-download.googleapis.com/maven2/",
"https://repo.clojars.org",
],
)
# Make Bazel aware of the artifacts and targets from Maven
use_repo(maven, "maven")
## Rules to run Python code as a binary
bazel_dep(
name = "rules_python",
version = "1.6.1",
)
# Alias local uses of `pip` to the rules defined by `rules_jvm_external`
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
# Parse the requirements lockfile generated by the top-level BUILD file
pip.parse(
download_only = True,
hub_name = "pypi",
python_version = "3.11",
requirements_lock = "//:requirements_lock.txt",
)
# Make Bazel aware of the artifacts and targets from PIP
use_repo(pip, "pypi")
bazel_dep(name = "platforms", version = "1.0.0")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "babashka_osx",
build_file_content = """exports_files(["bb"])""",
sha256 = "b02f906697b1ede016e96a3b340ea40e52380eef52307abc8a114210bfe89c44",
type = "tar.gz",
url = "https://github.com/babashka/babashka/releases/download/v1.12.209/babashka-1.12.209-macos-amd64.tar.gz",
)
http_archive(
name = "babashka_linux",
build_file_content = """exports_files(["bb"])""",
sha256 = "177c18b6ca00c1708070007a53777ef4c9ffe0bbaa2c66c1426312db645eeba9",
type = "tar.gz",
url = "https://github.com/babashka/babashka/releases/download/v1.12.209/babashka-1.12.209-linux-aarch64-static.tar.gz",
)
http_archive(
name = "babashka_windows",
build_file_content = """exports_files(["bb"])""",
sha256 = "bc9f2ecae2ffa198e0ca06a194ca6a58c11daf94c123af8429ee3d1f24017bf0",
type = "zip",
url = "https://github.com/babashka/babashka/releases/download/v1.12.209/babashka-1.12.209-windows-amd64.zip",
)
jvm_import_external = use_repo_rule("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_import_external")
jvm_import_external(
name = "clojure_core",
artifact_sha256 = "cb2a1a3db1c2cd76ef4fa4a545d5a65f10b1b48b7f7672f0a109f5476f057166",
artifact_urls =
[
"https://repo1.maven.org/maven2/org/clojure/clojure/1.12.3/clojure-1.12.3.jar",
],
rule_name = "java_import",
)
# Required by the compiler
jvm_import_external(
name = "clojure_spec_alpha",
artifact_sha256 = "94cd99b6ea639641f37af4860a643b6ed399ee5a8be5d717cff0b663c8d75077",
artifact_urls =
[
"https://repo1.maven.org/maven2/org/clojure/spec.alpha/0.5.238/spec.alpha-0.5.238.jar",
],
rule_name = "java_import",
)
# Required by the compiler
jvm_import_external(
name = "clojure_core_specs",
artifact_sha256 = "eb73ac08cf49ba840c88ba67beef11336ca554333d9408808d78946e0feb9ddb",
artifact_urls =
[
"https://repo1.maven.org/maven2/org/clojure/core.specs.alpha/0.4.74/core.specs.alpha-0.4.74.jar",
],
rule_name = "java_import",
)
# Required by the custom library creation code
jvm_import_external(
name = "clojure_tools_cli",
artifact_sha256 = "7f100dc125c744e8038524d286ec22a18bfed14c42e7e1b66500e8c3d432c151",
artifact_urls =
[
"https://repo1.maven.org/maven2/org/clojure/tools.cli/1.2.245/tools.cli-1.2.245.jar",
],
rule_name = "java_import",
)
register_toolchains(
"//toolchains/babashka:bb_osx_toolchain",
"//toolchains/babashka:bb_linux_toolchain",
"//toolchains/babashka:bb_windows_toolchain",
"//toolchains/clojure:clojure_jvm_toolchain",
)
## Rules to generate API documentation for Starlark
bazel_dep(
name = "stardoc",
version = "0.8.0",
)
## Supporting utility rules
bazel_dep(
name = "bazel_skylib",
version = "1.8.1",
)