Skip to content

Commit

Permalink
bazel migrate to bzlmod,bazel version > 7 (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
20083017 authored Dec 10, 2024
1 parent cb224a8 commit 4490d48
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
1 change: 0 additions & 1 deletion .bazeliskrc

This file was deleted.

4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

# Enable Bzlmod for every Bazel command
common --enable_bzlmod

# Must be first. Enables build:windows, build:linux, build:macos, build:freebsd, build:openbsd
build --enable_platform_specific_config
###############################################################################
Expand Down
8 changes: 8 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################

bazel_dep(name = "rules_cc", version = "0.0.16")
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ bazel build ylt # Please make sure bazel in you bin path.
bazel build coro_http_example # Or replace in anyone you want to build and test.
# Actually you might take it in other project in prefix @com_alibaba_yalangtinglibs, like
bazel build @com_alibaba_yalangtinglibs://ylt

bazel version > 7
bazel build ylt --enable_bzlmod
```

You can see the test/example/benchmark executable file in `./build/output/`.
Expand Down
7 changes: 7 additions & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is a WORKSPACE file used by bzlmod in combination with MODULE.bazel.
# It's used for a gradual migration and it should be empty.
# Don't remove this file. If the file doesn't exist, bzlmod falls back to WORKSPACE file.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

workspace(name = "com_alibaba_yalantinglibs")

0 comments on commit 4490d48

Please sign in to comment.