1- # TODO: Investigate bzlmod and use it where possible.
2-
1+ """Rules/toolchains for devinfra with Bazel."""
32module (
43 name = "devinfra" ,
5- )
4+ )
5+
6+ register_toolchains (
7+ "//bazel/git-toolchain:git_linux_toolchain" ,
8+ "//bazel/git-toolchain:git_macos_x86_toolchain" ,
9+ "//bazel/git-toolchain:git_macos_arm64_toolchain" ,
10+ )
11+
12+ bazel_dep (name = "yq.bzl" , version = "0.2.0" )
13+ bazel_dep (name = "tar.bzl" , version = "0.5.1" )
14+ bazel_dep (name = "aspect_bazel_lib" , version = "2.19.3" )
15+ bazel_dep (name = "bazel_skylib" , version = "1.8.1" )
16+ bazel_dep (name = "aspect_rules_js" , version = "2.4.2" )
17+ bazel_dep (name = "rules_pkg" , version = "1.1.0" )
18+ bazel_dep (name = "aspect_rules_jasmine" , version = "2.0.0" )
19+ bazel_dep (name = "platforms" , version = "1.0.0" )
20+ bazel_dep (name = "aspect_rules_esbuild" , version = "0.22.1" )
21+ bazel_dep (name = "aspect_rules_ts" , version = "3.6.3" )
22+ bazel_dep (name = "rules_nodejs" , version = "6.5.0" )
23+ bazel_dep (name = "rules_browsers" )
24+ git_override (
25+ module_name = "rules_browsers" ,
26+ commit = "155c3367c0140dc3c8ff0d0ee050f5cc6aa0a643" ,
27+ remote = "https://github.com/devversion/rules_browsers.git" ,
28+ )
29+ bazel_dep (name = "rules_sass" )
30+ git_override (
31+ module_name = "rules_sass" ,
32+ commit = "76078d5e9776a0080dcee496e90b88d8a6179c19" ,
33+ remote = "https://github.com/devversion/rules_sass.git" ,
34+ )
35+
36+ bazel_dep (name = "rules_angular" )
37+ git_override (
38+ module_name = "rules_angular" ,
39+ commit = "a957283cdef0ade1fc6d1d7404f14577cebd3642" ,
40+ remote = "https://github.com/devversion/rules_angular.git" ,
41+ )
42+
43+ yq = use_extension ("@yq.bzl//yq:extensions.bzl" , "yq" )
44+ use_repo (yq , "yq_toolchains" )
45+
46+
47+ rules_ts_ext = use_extension ("@aspect_rules_ts//ts:extensions.bzl" , "ext" )
48+ rules_ts_ext .deps (
49+ # Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity'
50+ ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==" ,
51+ ts_version_from = "//bazel:package.json" ,
52+ )
53+ use_repo (rules_ts_ext , "npm_typescript" )
54+
55+ node = use_extension ("@rules_nodejs//nodejs:extensions.bzl" , "node" )
56+ node .toolchain (
57+ node_repositories = {
58+ "20.19.0-darwin_arm64" : ("node-v20.19.0-darwin-arm64.tar.gz" , "node-v20.19.0-darwin-arm64" , "c016cd1975a264a29dc1b07c6fbe60d5df0a0c2beb4113c0450e3d998d1a0d9c" ),
59+ "20.19.0-darwin_amd64" : ("node-v20.19.0-darwin-x64.tar.gz" , "node-v20.19.0-darwin-x64" , "a8554af97d6491fdbdabe63d3a1cfb9571228d25a3ad9aed2df856facb131b20" ),
60+ "20.19.0-linux_arm64" : ("node-v20.19.0-linux-arm64.tar.xz" , "node-v20.19.0-linux-arm64" , "dbe339e55eb393955a213e6b872066880bb9feceaa494f4d44c7aac205ec2ab9" ),
61+ "20.19.0-linux_ppc64le" : ("node-v20.19.0-linux-ppc64le.tar.xz" , "node-v20.19.0-linux-ppc64le" , "84937108f005679e60b486ed8e801cebfe923f02b76d8e710463d32f82181f65" ),
62+ "20.19.0-linux_s390x" : ("node-v20.19.0-linux-s390x.tar.xz" , "node-v20.19.0-linux-s390x" , "11f8ee99d792a83bba7b29911e0229dd6cd5e88987d7416346067db1cc76d89a" ),
63+ "20.19.0-linux_amd64" : ("node-v20.19.0-linux-x64.tar.xz" , "node-v20.19.0-linux-x64" , "b4e336584d62abefad31baecff7af167268be9bb7dd11f1297112e6eed3ca0d5" ),
64+ "20.19.0-windows_amd64" : ("node-v20.19.0-win-x64.zip" , "node-v20.19.0-win-x64" , "be72284c7bc62de07d5a9fd0ae196879842c085f11f7f2b60bf8864c0c9d6a4f" ),
65+ },
66+ node_version = "20.19.0" ,
67+ )
68+ use_repo (node , "nodejs_toolchains" )
69+
70+
71+ rules_angular = use_extension ("@rules_angular//setup:extensions.bzl" , "rules_angular" )
72+ rules_angular .setup (
73+ name = "dev_infra_rules_angular_configurable_deps" ,
74+ angular_compiler_cli = "//:node_modules/@angular/compiler-cli" ,
75+ typescript = "//:node_modules/typescript-local" ,
76+ )
77+ use_repo (rules_angular , ** {"rules_angular_configurable_deps" :"dev_infra_rules_angular_configurable_deps" })
78+
79+
80+ npm = use_extension ("@aspect_rules_js//npm:extensions.bzl" , "npm" )
81+
82+ npm .npm_translate_lock (
83+ name = "devinfra_npm" ,
84+ data = [
85+ "@devinfra//:package.json" ,
86+ "@devinfra//bazel:package.json" ,
87+ "@devinfra//.github/local-actions/branch-manager:package.json" ,
88+ "@devinfra//.github/local-actions/labels-sync:package.json" ,
89+ "@devinfra//.github/local-actions/lock-closed:package.json" ,
90+ "@devinfra//github-actions/google-internal-tests:package.json" ,
91+ "@devinfra//github-actions/pull-request-labeling:package.json" ,
92+ "@devinfra//github-actions/unified-status-check:package.json" ,
93+ "@devinfra//github-actions/previews/pack-and-upload-artifact:package.json" ,
94+ "@devinfra//github-actions/previews/upload-artifacts-to-firebase:package.json" ,
95+ "@devinfra//github-actions/post-approval-changes:package.json" ,
96+ "@devinfra//github-actions/branch-manager:package.json" ,
97+ "@devinfra//github-actions/saucelabs:package.json" ,
98+ "@devinfra//github-actions/browserstack:package.json" ,
99+ "@devinfra//github-actions/bazel/configure-remote:package.json" ,
100+ "@devinfra//github-actions/org-file-sync:package.json" ,
101+ "@devinfra//github-actions/feature-request:package.json" ,
102+ "@devinfra//ng-dev:package.json" ,
103+ "@devinfra//bazel/spec-bundling/test:package.json" ,
104+ "@devinfra//:pnpm-workspace.yaml" ,
105+ ],
106+ pnpm_lock = "@devinfra//:pnpm-lock.yaml" ,
107+ npmrc = "@devinfra//:.npmrc" ,
108+ )
109+ use_repo (npm , "devinfra_npm" )
0 commit comments