Skip to content

vectorgrp/bazel-rules

Vector Bazel Repository

A comprehensive Bazel monorepo for developing, building, and managing custom Bazel rules and modules used across Vector projects. This repository provides a streamlined workflow for creating custom modules, packaging them into archives, uploading to artifact registries, and maintaining a central module registry.

Consumption of Vector Bazel rules

To consume the rules defined in this repository, you need to register the custom Bazel Central Registry (BCR) located in this repository.

Configuration Steps:

  1. Update .bazelrc: Add the following flag to your project's .bazelrc file to point Bazel to the raw content of the registry directory.

    common --registry=https://raw.githubusercontent.com/vectorgrp/bazel-rules/main/vector-bazel-central-registry
  2. Add Dependencies: In your MODULE.bazel file, declare the dependencies you need using bazel_dep.

    bazel_dep(name = "rules_common", version = "0.2.0")

Project Overview

This repository is structured around three main development areas:

Core Components

  • bcr-modules/ - Custom Bazel module development and packaging

    • Contains module definitions, build configurations, and upload targets
    • Uses extensive Bazel macros for automated archive building and registry management
    • Recommended to use VS Code's Bazel Targets extension for managing build targets
  • rules/ - Custom Bazel rules development

    • Houses custom rule definitions and implementations
    • Used for developing reusable build logic across projects
  • vector-bazel-central-registry/ - Module registry management

    • Maintains the central registry of all custom modules
    • Automatically updated via Bazel targets - do not edit manually
    • Updates performed via: bazel run //bcr-modules/modules/<module_name>:<module_name>.add_to_repo

Supporting Infrastructure

  • tools/ - Custom scripts for module management and automation
  • docs/ - Comprehensive documentation and guides
  • .github/ - CI/CD configuration with GitHub Actions workflows

Repository Structure

├── bcr-modules/                    # Module development and packaging
│   ├── macros/                     # Bazel macros for module automation
│   │   ├── add_module_macro.bzl    # Registry integration macro
│   │   ├── module_macro.bzl        # Module packaging macro
│   │   └── upload_macro.bzl        # Upload automation macro
│   ├── modules/                    # Individual module definitions
│   │   ├── rules_common/           # Example module
│   │   │   ├── 0.2.0/              # Version-specific configuration
│   │   │   ├── BUILD.bazel         # Module build definition
│   │   │   └── *.MODULE.bazel      # Module dependencies
│   │   └── [other modules]/
│   ├── rules/                      # Module build rules
│   └── BUILD.bazel.tpl             # Default BUILD file template
├── vector-bazel-central-registry/  # Central module registry
├── tools/                          # Management scripts
├── docs/                           # Documentation and guides
└── .github/                        # CI/CD configuration

About

Vector Bazel Rules and Toolchains

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •