bzl 0.5.1

MBO Works bzl, a Bazel support library

This library provides Bazel Starlark functionality meant to help in maintaining other libraries.

Test

The following libraries are implemented:

Versions

Implements versioning functions that mostly follow Semver.

Comparators correctly respect major, minor and patch components, as well as
Semver compliant 'pre-release' and 'build' components. The pre-release and build
components are split at ".". Comparing pre-release parts works for alphabetical
prefixes and numeric suffixes, so 'alpha', 'beta' and 'rc' as well as numbered
version of those (e.g. 'alpha1' or rc-1') are supported. For pre-releases and
build pieces a single '-' in front of the numeric parts is dropped (e.g. 'rc-1'
becomes 'rc' + '1' while 'alpha--2' becomes 'alpha-' + '2').

The full functionality is exposed as a singele struct containing all functions.

The version parameters support:

Note: Most functions support a skip_build parameter. If True, then any
present build component will be dropped. Conclusively the parameter is True
by default for parsing and False for comparisons since Semver dictates that
that the build component must be ignored for precedence (see
Semver-10).

The functionality has exhaustive tests. If something still works wrong please,
file a bug report or propose a fix.

Example:

my_version = "25.33.42"
min_version = (10, 11, 12)
if _versions.lt(my_version, min_version):
  fail("My version {my_version} is earlier than {min_version}.".format(
    my_version = my_version,
    min_version = min_version,
  ))

Provides:

Paths

Implements file path manipulation functions.

NOTE: These functions do not support Windows drive letter relative paths.

Provides:

Installation

The library is available as a Bazel module (bzlmod) and works on MacOS, Ubuntu
and Windows with Bazel version 7.x and 8.x (Other systems are simply not tested).
However future version may drop Windows support.

For MODULE.bazel

See mboworks/bzl releases to replace the version number.

bazel_dep(name = "mboworks_bzl", version = "0.0.0")

Dependencies