Fix small typo (#19993)
[google-protobuf.git] / MODULE.bazel
blob088a7d65cb344e6e3755b3c29aa3753c47730462
1 # TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
2 # https://github.com/protocolbuffers/protobuf/issues/14313
4 module(
5     name = "protobuf",
6     version = "30.0-dev",  # Automatically updated on release
7     compatibility_level = 1,
8     repo_name = "com_google_protobuf",
11 # LOWER BOUND dependency versions.
12 # Bzlmod follows MVS:
13 # https://bazel.build/versions/6.0.0/build/bzlmod#version-resolution
14 # Thus the highest version in their module graph is resolved.
15 bazel_dep(name = "abseil-cpp", version = "20240722.0", repo_name = "com_google_absl")
16 bazel_dep(name = "bazel_skylib", version = "1.7.1")
17 bazel_dep(name = "jsoncpp", version = "1.9.6")
18 bazel_dep(name = "apple_support", version = "1.15.1", repo_name = "build_bazel_apple_support")
19 bazel_dep(name = "rules_cc", version = "0.0.17")
20 bazel_dep(name = "rules_fuzzing", version = "0.5.2")
21 bazel_dep(name = "rules_java", version = "8.6.1")
22 bazel_dep(name = "rules_jvm_external", version = "6.3")
23 bazel_dep(name = "rules_kotlin", version = "1.9.6")
24 bazel_dep(name = "rules_license", version = "1.0.0")
25 bazel_dep(name = "rules_pkg", version = "1.0.1")
26 bazel_dep(name = "rules_python", version = "1.0.0")
27 bazel_dep(name = "rules_rust", version = "0.51.0")
28 bazel_dep(name = "platforms", version = "0.0.8")
29 bazel_dep(name = "zlib", version = "1.3.1")
30 bazel_dep(name = "bazel_features", version = "1.23.0", repo_name = "proto_bazel_features")
31 bazel_dep(
32     name = "rules_shell",
33     version = "0.2.0",
36 # Proto toolchains
37 register_toolchains("//bazel/private/toolchains:all")
39 SUPPORTED_PYTHON_VERSIONS = [
40     "3.9",
41     "3.10",
42     "3.11",
43     "3.12",
46 python = use_extension("@rules_python//python/extensions:python.bzl", "python")
49     python.toolchain(
50         is_default = python_version == SUPPORTED_PYTHON_VERSIONS[-1],
51         python_version = python_version,
52     )
53     for python_version in SUPPORTED_PYTHON_VERSIONS
56 use_repo(
57     python,
58     system_python = "python_{}".format(SUPPORTED_PYTHON_VERSIONS[-1].replace(".", "_")),
61 pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
64     pip.parse(
65         hub_name = "protobuf_pip_deps",
66         python_version = python_version,
67         requirements_lock = "//python:requirements.txt",
68     )
69     for python_version in SUPPORTED_PYTHON_VERSIONS
72 use_repo(pip, "protobuf_pip_deps")
74 crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate", dev_dependency = True)
75 crate.spec(
76     package = "googletest",
77     version = ">0.0.0",
79 crate.spec(
80     package = "paste",
81     version = ">=1",
83 crate.from_specs()
84 use_repo(crate, crate_index = "crates")
86 maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven", dev_dependency = True)
87 maven.install(
88     name = "protobuf_maven",
89     artifacts = [
90         "com.google.caliper:caliper:1.0-beta-3",
91         "com.google.code.findbugs:jsr305:3.0.2",
92         "com.google.code.gson:gson:2.8.9",
93         "com.google.errorprone:error_prone_annotations:2.5.1",
94         "com.google.j2objc:j2objc-annotations:2.8",
95         "com.google.guava:guava:32.0.1-jre",
96         "com.google.guava:guava-testlib:32.0.1-jre",
97         "com.google.testparameterinjector:test-parameter-injector:1.18",
98         "com.google.truth:truth:1.1.2",
99         "junit:junit:4.13.2",
100         "org.mockito:mockito-core:4.3.1",
101         "biz.aQute.bnd:biz.aQute.bndlib:6.4.0",
102         "info.picocli:picocli:4.6.3",
103     ],
104     repositories = [
105         "https://repo1.maven.org/maven2",
106         "https://repo.maven.apache.org/maven2",
107     ],
109 use_repo(maven, "protobuf_maven")
111 # Development dependencies
112 bazel_dep(name = "googletest", version = "1.14.0", dev_dependency = True, repo_name = "com_google_googletest")
113 bazel_dep(name = "rules_buf", version = "0.3.0", dev_dependency = True)
114 bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
115 bazel_dep(
116     name = "abseil-py",
117     version = "2.1.0",
118     dev_dependency = True,
119     repo_name = "com_google_absl_py",
122 # rules_proto are needed for @com_google_protobuf_v25.0 used in //compatibility/... tests
123 bazel_dep(name = "rules_proto", version = "4.0.0", dev_dependency = True)