Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MODULE.bazel to Starlark language #6279

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6491,6 +6491,7 @@ Starlark:
- BUCK
- BUILD
- BUILD.bazel
- MODULE.bazel
- Tiltfile
- WORKSPACE
- WORKSPACE.bazel
Expand Down
52 changes: 52 additions & 0 deletions samples/Starlark/filenames/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# To build Bazel with Bzlmod: `bazel build --enable_bzlmod //src:bazel_nojdk`.

module(
name = "bazel",
version = "7.0.0-pre",
repo_name = "io_bazel",
)

bazel_dep(name = "rules_license", version = "0.0.3")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
bazel_dep(name = "grpc", version = "1.47.0", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "rules_pkg", version = "0.7.0")
bazel_dep(name = "stardoc", version = "0.5.3", repo_name = "io_bazel_skydoc")
bazel_dep(name = "zstd-jni", version = "1.5.2-3")
bazel_dep(name = "zlib", version = "1.2.13")
bazel_dep(name = "rules_cc", version = "0.0.6")
bazel_dep(name = "rules_java", version = "5.4.1")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
bazel_dep(name = "rules_jvm_external", version = "4.5")
single_version_override(
module_name = "rules_jvm_external",
patch_strip = 1,
patches = ["//third_party:rules_jvm_external.patch"],
)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
# We don't yet specify the maven coordinates in the MODULE.bazel to avoid duplicating information.
# Always respect the maven_install.json file generated by rules_jvm_external from the WORKSPACE file.
# TODO(pcloudy): We should add maven coordinates here when we enable Bzlmod in the default build for Bazel.
lock_file = "//:maven_install.json",
repositories = [
"https://repo1.maven.org/maven2",
],
)
use_repo(maven, "maven")

# TODO(pcloudy): Add remoteapis and googleapis as Bazel modules in the BCR.
bazel_dep(name = "remoteapis", version = "")
bazel_dep(name = "googleapis", version = "")

local_path_override(
module_name = "remoteapis",
path = "./third_party/remoteapis",
)

local_path_override(
module_name = "googleapis",
path = "./third_party/googleapis",
)