forked from AnySoftKeyboard/AnySoftKeyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
110 lines (96 loc) · 4.8 KB
/
MODULE.bazel
File metadata and controls
110 lines (96 loc) · 4.8 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
"Declare dependencies for bzlmod, see https://bazel.build/build/bzlmod"
# We declare all of the direct dependencies of all of the code in this
# workspace. A single version of each of these is declared, implying that all of
# the code will use the same version of all of these tools and libraries listed.
# For bzlmod dependencies, this implements the "single version policy".
bazel_dep(name = "aspect_bazel_lib", version = "2.9.4")
bazel_dep(name = "rules_nodejs", version = "6.3.5")
bazel_dep(name = "aspect_rules_js", version = "2.1.2")
bazel_dep(name = "aspect_rules_ts", version = "3.6.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "aspect_rules_esbuild", version = "0.21.0")
bazel_dep(name = "rules_multitool", version = "1.3.0")
bazel_dep(name = "rules_java", version = "8.6.3")
bazel_dep(name = "contrib_rules_jvm", version = "0.28.0")
bazel_dep(name = "rules_jvm_external", version = "6.7")
# PATCHES
single_version_override(
module_name = "rules_nodejs",
patch_strip = 1,
patches = [
"//tools/repo_patches:rules_nodejs_pr_3802.patch",
],
version = "6.3.5",
)
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
multitool.hub(lockfile = "//tools:multitool.lock.json")
use_repo(multitool, "multitool")
register_toolchains("@multitool//toolchains:all")
#########################
# JavaScript and TypeScript
# https://github.com/aspect-build/rules_js/tree/main/e2e/bzlmod
# https://github.com/aspect-build/rules_ts/tree/main/e2e/bzlmod
# In keeping with the single version policy, in this example, the NPM ecosystem
# dependencies are specified at the top level rather than in each sub-project.
# However, it is possible to have multiple different sets of NPM dependencies
# across a workspace.
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(
name = "nodejs",
node_version_from_nvmrc = "//:.nvmrc",
# calculate SHA256 with curl https://nodejs.org/dist/v{version}/{filename} | shasum -a 256
# `curl https://nodejs.org/dist/v23.11.0/node-v23.11.0-darwin-arm64.tar.gz | shasum -a 256`
node_versions = {
"23.11.0-darwin_arm64": ("node-v23.11.0-darwin-arm64.tar.gz", "node-v23.11.0-darwin-arm64", "635990b46610238e3c008cd01480c296e0c2bfe7ec59ea9a8cd789d5ac621bb0"),
"23.11.0-darwin_amd64": ("node-v23.11.0-darwin-x64.tar.gz", "node-v23.11.0-darwin-x64", "a5782655748d4602c1ee1ee62732e0a16d29d3e4faac844db395b0fbb1c9dab8"),
"23.11.0-linux_arm64": ("node-v23.11.0-linux-arm64.tar.xz", "node-v23.11.0-linux-arm64", "85915f885fe7eab2be4a6e3de840cb83db4fc53749274d31383a0e1721a883c6"),
"23.11.0-linux_amd64": ("node-v23.11.0-linux-x64.tar.xz", "node-v23.11.0-linux-x64", "fa9ae28d8796a6cfb7057397e1eea30ca1c61002b42b8897f354563a254e7cf5"),
"18.20.8-darwin_arm64": ("node-v18.20.8-darwin-arm64.tar.gz", "node-v18.20.8-darwin-arm64", "bae4965d29d29bd32f96364eefbe3bca576a03e917ddbb70b9330d75f2cacd76"),
"18.20.8-darwin_amd64": ("node-v18.20.8-darwin-x64.tar.gz", "node-v18.20.8-darwin-x64", "ed2554677188f4afc0d050ecd8bd56effb2572d6518f8da6d40321ede6698509"),
"18.20.8-linux_arm64": ("node-v18.20.8-linux-arm64.tar.xz", "node-v18.20.8-linux-arm64", "224e569dbe7b0ea4628ce383d9d482494b57ee040566583f1c54072c86d1116b"),
"18.20.8-linux_amd64": ("node-v18.20.8-linux-x64.tar.xz", "node-v18.20.8-linux-x64", "5467ee62d6af1411d46b6a10e3fb5cacc92734dbcef465fea14e7b90993001c9"),
},
)
use_repo(
node,
"nodejs_toolchains",
)
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
# Allows developers to get a local node_modules tree, using
# bazel run -- @pnpm//:pnpm --dir $PWD install
use_repo(pnpm, "pnpm")
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
)
use_repo(npm, "npm")
rules_ts_ext = use_extension(
"@aspect_rules_ts//ts:extensions.bzl",
"ext",
)
rules_ts_ext.deps(
ts_integrity = "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
# This keeps the TypeScript version in-sync with the editor, which is typically best.
ts_version_from = "//:package.json",
)
use_repo(rules_ts_ext, "npm_typescript")
bazel_dep(name = "aspect_rules_lint", version = "1.0.7")
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "maven",
artifacts = [
"org.junit.jupiter:junit-jupiter-api:5.8.2",
"org.junit.jupiter:junit-jupiter-engine:5.8.2",
"org.junit.platform:junit-platform-launcher:1.8.2",
"org.junit.platform:junit-platform-reporting:1.8.2",
],
fetch_sources = True,
lock_file = "//:maven_install.json",
)
use_repo(
maven,
"maven",
)