Home

Awesome

Bazel Starlib

Build

Bazel Starlib is a collection of projects that contain rulesets and libraries that are useful for the implementation of Bazel projects.

ProjectDescriptionDocumentation
bazeldocGenerate Starlark documentation using Bazel Stardoc. Formerly hosted as bazel-doc.API, How-to
bzlformatFormat Bazel Starlark files using Buildifier, test that the formatted files exist in the workspace directory, and copy formatted files to the workspace directory. Formerly hosted as rules_bzlformat.API, How-to, Examples
bzllibCollection of Starlark libraries.API, How-to
bzlreleaseAutomate and customize the generation of releases using GitHub Actions.API, How-to
bzltidyCollect Bazel actions that keep your source files up-to-date.API, How-to
markdownMaintain markdown files.API, How-to, Examples
shlibCollection of libraries useful when implementing shell binaries, libraries, and tests. Formerly hosted as bazel_shlib.API, How-to
updatesrcCopy files from the Bazel output directories to the workspace directory. Formerly hosted as rules_updatesrcAPI, How-to, Examples

Table of Contents

<!-- MARKDOWN TOC: BEGIN --> <!-- MARKDOWN TOC: END -->

Quickstart

The following provides a quick introduction on how to load this repository into your workspace. For more information on how to use the projects from this repository in your workspace, check out the how-to links above and review the the generated documentation.

MODULE.bazel Snippet

<!-- BEGIN MODULE SNIPPET -->
bazel_dep(name = "cgrindel_bazel_starlib", version = "0.21.0")
<!-- END MODULE SNIPPET -->

Workspace Configuration

<!-- BEGIN WORKSPACE SNIPPET -->
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "cgrindel_bazel_starlib",
    sha256 = "c088657482e86888c9f46f535bdbaf71eaeb35ff9db04912a4ecdccf94cd16d5",
    urls = [
        "https://github.com/cgrindel/bazel-starlib/releases/download/v0.21.0/bazel-starlib.v0.21.0.tar.gz",
    ],
)

load("@cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies")

bazel_starlib_dependencies()

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()
<!-- END WORKSPACE SNIPPET -->

Developer Documentation

To Add a Golang Dependency

Execute the following to update the go module files, resolve the Golang dependencies and update the Bazel build files.

$ bazel run @io_bazel_rules_go//go -- github.com/sweet/go_pkg
$ bazel run //:go_mod_tidy
$ bazel run //:gazelle_update_repos
$ bazel run //:update_build_files

Other Documentation