-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMODULE.bazel
More file actions
211 lines (191 loc) · 8.43 KB
/
Copy pathMODULE.bazel
File metadata and controls
211 lines (191 loc) · 8.43 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
"Bazel dependencies"
module(
name = "rules_flutter",
# NOTE:
# version = "",
#
# Always leave version unset or set to "" (the default). The default value
# can prevent issues when the module is used via non-registry overrides
# (e.g. https://github.com/bazel-contrib/rules_go/issues/4380).
#
# The publish.yaml GitHub Action sets the version in the registry to the
# release version by patching this MODULE.bazel file in the pull request to
# the BCR.
#
# For more info, see this Slack thread:
# https://bazelbuild.slack.com/archives/CA31HN1T3/p1750406404452179
# NOTE:
# compatibility_level = 0,
#
# Bumping compatibility_level too frequently is discouraged because it's
# very disruptive: as soon as a module is requested at two different
# compatibility levels in the dependency tree, users will see an error.
#
# As such, the compatibility_level (1) should be bumped *only* when the
# breaking change affects most use cases and isn't easy to migrate and/or
# work-around, and (2) *in the same commit* that introduces an incompatible
# (breaking) change.
)
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "package_metadata", version = "0.0.10")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_cc", version = "0.2.19")
bazel_dep(name = "apple_support", version = "2.5.4")
bazel_dep(name = "rules_apple", version = "4.5.3")
bazel_dep(name = "rules_swift", version = "3.6.1")
bazel_dep(name = "rules_android", version = "0.7.2")
bazel_dep(name = "rules_kotlin", version = "2.3.20")
bazel_dep(name = "rules_java", version = "9.6.1")
bazel_dep(name = "rules_jvm_external", version = "7.0")
bazel_dep(name = "rules_dart", version = "0.4.6")
bazel_dep(name = "rules_python", version = "2.0.0")
bazel_dep(name = "yaml.bzl", version = "0.1.2")
# Provides the copy_to_directory toolchain that rules_dart's source-set
# co-location (colocate_packages) uses to assemble a package's hand-written +
# generated files into one directory for the kernel compile.
bazel_dep(name = "bazel_lib", version = "3.3.1")
bazel_dep(name = "rules_multitool", version = "1.11.1", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "8.5.1.2", dev_dependency = True)
bazel_dep(name = "bazelrc-preset.bzl", version = "1.9.2")
# Register the apple_cc CC toolchain explicitly so rules_swift's
# xcode_swift_toolchain resolves to a CC toolchain with a valid apple target
# triple (rather than the generic rules_cc local_config_cc, whose target_gnu_system_name
# is "local" and causes "Invalid target triple" in rules_swift autoconfig).
# apple_support's MODULE.bazel auto-registers these toolchains, but in a deep
# dep graph with rules_android + rules_cc they can be ordered after the generic
# local_config_cc; the explicit registration here puts apple_cc first for
# darwin hosts. e2e workspaces with a leaner dep graph don't need this.
apple_cc_configure = use_extension(
"@apple_support//crosstool:setup.bzl",
"apple_cc_configure_extension",
)
use_repo(apple_cc_configure, "local_config_apple_cc_toolchains")
register_toolchains("@local_config_apple_cc_toolchains//:all")
flutter = use_extension("//flutter:extensions.bzl", "flutter")
flutter.toolchain(flutter_version = "3.44.1")
use_repo(flutter, "flutter_macos_engine", "flutter_toolchains", "flutter_web_sdk")
register_toolchains("@flutter_toolchains//:all")
# AndroidX dependencies the Flutter Android embedding (flutter.jar) requires
# at runtime, mirroring the dependency list of Flutter's official
# io.flutter:flutter_embedding_* Maven POM, plus androidx.annotation needed to
# compile the runner Kotlin sources. Uses the "rules_android_maven" repo name
# so rules_jvm_external merges these artifacts with rules_android's own maven
# deps in downstream workspaces — user modules inherit them and only declare
# artifacts their own code uses.
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "rules_android_maven",
artifacts = [
"androidx.annotation:annotation:1.9.1",
"androidx.core:core:1.17.0",
"androidx.exifinterface:exifinterface:1.4.1",
"androidx.fragment:fragment:1.8.9",
"androidx.lifecycle:lifecycle-common:2.10.0",
"androidx.lifecycle:lifecycle-runtime:2.10.0",
# androidx.lifecycle is an atomic version group (siblings depend on
# exact [version] ranges), so the members fragment pulls in
# transitively must be pinned to the same version for coursier to
# resolve.
"androidx.lifecycle:lifecycle-livedata:2.10.0",
"androidx.lifecycle:lifecycle-livedata-core:2.10.0",
"androidx.lifecycle:lifecycle-viewmodel:2.10.0",
"androidx.lifecycle:lifecycle-viewmodel-savedstate:2.10.0",
"androidx.tracing:tracing:1.2.0",
"androidx.window:window:1.3.0",
"androidx.window:window-java:1.3.0",
"com.getkeepsafe.relinker:relinker:1.4.5",
# The bundled `ext/jni` overlay's Java support classes implement
# kotlin.coroutines.Continuation (PortContinuation returns
# Dispatchers.getIO()), so every workspace using a jnigen-based
# plugin needs these on the plugin's compile classpath and in the
# APK dex.
"org.jetbrains.kotlin:kotlin-stdlib:2.1.20",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0",
],
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
# lifecycle-runtime pulls in androidx.profileinstaller, whose
# AbstractResolvableFuture implements com.google.guava's ListenableFuture and
# runs in every app shortly after launch. In workspaces where guava is also
# resolved (rules_android's tooling depends on it), coursier would otherwise
# select guava's empty "9999.0" listenablefuture placeholder, leaving the
# interface undefined in the APK dex and crashing the profile installer with
# NoClassDefFoundError. Force the real jar.
maven.artifact(
name = "rules_android_maven",
artifact = "listenablefuture",
force_version = True,
group = "com.google.guava",
version = "1.0",
)
use_repo(maven, "rules_android_maven")
multitool = use_extension(
"@rules_multitool//multitool:extension.bzl",
"multitool",
dev_dependency = True,
)
multitool.hub(lockfile = "//:multitool.lock.json")
use_repo(multitool, "multitool")
# Dev tool pub dependencies (args, vm_service, watcher, path).
flutter.pub(
name = "dev_tool_deps",
lock = "//tools/dev_tool:pubspec.lock",
)
use_repo(flutter, "dev_tool_deps")
# Python toolchain + pymobiledevice3 for iOS device screenshots.
python = use_extension(
"@rules_python//python/extensions:python.bzl",
"python",
)
python.toolchain(python_version = "3.11")
python.toolchain(python_version = "3.13")
pip = use_extension(
"@rules_python//python/extensions:pip.bzl",
"pip",
)
# pymobiledevice3 talks to iOS devices over USB/network from any host, so the
# screenshot tooling targets every platform; the Windows desktop-capture tooling
# below is Windows-only. target_platforms controls which platforms' wheels are
# selectable (see the rules_python pip.parse docs).
#
# NOTE: the recorded lock facts are still host-specific (a Windows host resolves
# pywin32-ctypes transitively; Linux/macOS do not). MODULE.bazel.lock is
# generated to match CI's runner (ubuntu-latest); building the root module's
# @pip targets on Windows may need `--lockfile_mode=update`. CI only builds
# @pip on ubuntu, and published consumers don't inherit this lock.
_IOS_PLATFORMS = [
"linux_aarch64",
"linux_x86_64",
"osx_aarch64",
"osx_x86_64",
"windows_x86_64",
]
pip.parse(
hub_name = "pip",
python_version = "3.11",
requirements_lock = "//tools/ios_screenshot:requirements_lock.txt",
target_platforms = _IOS_PLATFORMS,
)
pip.parse(
hub_name = "pip",
python_version = "3.13",
requirements_lock = "//tools/ios_screenshot:requirements_lock.txt",
target_platforms = _IOS_PLATFORMS,
)
# dxcam captures the local Windows display, so this tooling is Windows-only.
pip.parse(
hub_name = "windows_pip",
python_version = "3.11",
requirements_lock = "//tools/windows_screenshot:requirements_lock.txt",
target_platforms = ["windows_x86_64"],
)
pip.parse(
hub_name = "windows_pip",
python_version = "3.13",
requirements_lock = "//tools/windows_screenshot:requirements_lock.txt",
target_platforms = ["windows_x86_64"],
)
use_repo(pip, "pip", "windows_pip")