|
Warning
|
Documentation is woefully outdated. I’m working on it. |
A collection of Bazel tools, mainly for OCaml development using OBazl rules_ocaml.
Start by installing bazelisk.
-
Put this at the root of your project:
common --registry=https://raw.githubusercontent.com/obazl/registry/main/ common --registry=https://bcr.bazel.build
module(
name = "mymodule",
version = "0.1.0",
compatibility_level = 0,
bazel_compatibility = [">=6.0.0"]
)
bazel_dep(name = "tools_obazl", version = "x.y.x", (1)
repo_name = "obazl" (2)
dev_dependency = True)
-
See Releases page for latest version.
-
This makes the repo accessible as
@obazlrather than@tools_obazl.
Now run the following commands:
$ bazel run @obazl//new:workspace
Initializes new workspace.
$ bazel run @obazl//new:workspace
Alias: @obazl//new:ws
Installs:
-
.bazelignore
-
.bazeliskrc
-
.bazelversion
-
.bazelrc
-
.config/gitignore
-
.config/miblrc
-
.config/user.bazelrc
-
BUILD.bazel
-
BUILD.bzl
-
WORKSPACE.bazel
-
WORKSPACE.bzl
-
bzl/BUILD.bazel
-
bzl/host/BUILD.bazel
-
COSWITCH.bzl ???
-
tokenizetokenizes a string. Default separator is whitespace. -
load( "@tools_bazel//tools/functions:strings.bzl", "tokenize") -
tokenize("foo bar") ⇒ ["foo", "bar"]. -
tokenize("foo_bar", sep="_") ⇒ ["foo", "bar"]. -
get_xdg(repo_ctx)returns multival: home, XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_DATA_HOME