Skip to content

Commit

Permalink
Add support for bzlmod
Browse files Browse the repository at this point in the history
Signed-off-by: James Wainwright <[email protected]>
  • Loading branch information
jwnrt committed Jun 18, 2024
1 parent a4b413c commit 89f1f10
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bazel-*
MODULE.bazel.lock
11 changes: 11 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

module(
name = "lowrisc_bazel_release",
version = "0.1.0",
)

tools = use_extension("//:extensions.bzl", "tools")
use_repo(tools, "com_github_gh")
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ load("@lowrisc_bazel_release//:deps.bzl", "lowrisc_bazel_release_deps")
lowrisc_bazel_release_deps()
```

Or your `MODULE.bazel`:

```
bazel_dep(name = "lowrisc_bazel_release", version = "0.1.0")
git_override(
module_name = "lowrisc_bazel_release",
remote = "https://github.com/lowRISC/bazel-release",
)
```

### Defining the Release

In a `BUILD` file, instantiate the `release` rule and provide the
Expand Down
6 changes: 6 additions & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

# This file overrides `WORKSPACE.bazel` when bzlmod is active and is
# left intentionally empty.
9 changes: 9 additions & 0 deletions extensions.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("//third_party/github:repos.bzl", "github_tools_repos")

tools = module_extension(
implementation = lambda ctx: github_tools_repos(),
)

0 comments on commit 89f1f10

Please sign in to comment.