This is the multi-page printable view of this section. Click here to print.
Bazel rules
- 1: al_drawio_run_binary
- 2: al_genrule
- 3: al_hugo_binary
- 4: al_hugo_run_binary
- 5: al_hugo_site
- 6: al_remove_directories
- 7: al_template_files
- 8: al_toml_data
- 9: al_unpack_archives
- 10: al_write_script
1 - al_drawio_run_binary
al_drawio_run_binary
load("@com-alwaldend-git-src//bzl/rules:al_drawio_run_binary.bzl", "al_drawio_run_binary") al_drawio_run_binary(name, srcs, out, arguments, cmd_timeout)
Run drawio a a build action
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | Sources | List of labels | optional | [] |
out | Output | Label; nonconfigurable | required | |
arguments | Arguments, location statements are expanded | List of strings | required | |
cmd_timeout | Drawio command timeout | String | optional | "1m" |
2 - al_genrule
al_genrule_executable
load("@com-alwaldend-git-src//bzl/rules:al_genrule.bzl", "al_genrule_executable") al_genrule_executable(name, srcs, data, outs, cmd, set_flags, shell, tools, worker)
Build executable using shell worker
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | Sources, will not be added to runfiles | List of labels | optional | [] |
data | Data, will be added to runfiles | List of labels | optional | [] |
outs | Outputs | List of labels; nonconfigurable | required | |
cmd | Script to execute | String | required | |
set_flags | set flags | List of strings | optional | ["-eux"] |
shell | shell to use | String | optional | "/bin/sh" |
tools | Tools, will be added to runfiles | List of labels | optional | [] |
worker | Worker binary | Label | optional | "@com-alwaldend-git-src//go/bazel-shell-worker" |
al_genrule_regular
load("@com-alwaldend-git-src//bzl/rules:al_genrule.bzl", "al_genrule_regular") al_genrule_regular(name, srcs, data, outs, cmd, set_flags, shell, tools, worker)
Build shell worker rule
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | Sources, will not be added to runfiles | List of labels | optional | [] |
data | Data, will be added to runfiles | List of labels | optional | [] |
outs | Outputs | List of labels; nonconfigurable | required | |
cmd | Script to execute | String | required | |
set_flags | set flags | List of strings | optional | ["-eux"] |
shell | shell to use | String | optional | "/bin/sh" |
tools | Tools, will be added to runfiles | List of labels | optional | [] |
worker | Worker binary | Label | optional | "@com-alwaldend-git-src//go/bazel-shell-worker" |
al_genrule_test
load("@com-alwaldend-git-src//bzl/rules:al_genrule.bzl", "al_genrule_test") al_genrule_test(name, srcs, data, outs, cmd, set_flags, shell, tools, worker)
Test using shell worker
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | Sources, will not be added to runfiles | List of labels | optional | [] |
data | Data, will be added to runfiles | List of labels | optional | [] |
outs | Outputs | List of labels; nonconfigurable | required | |
cmd | Script to execute | String | required | |
set_flags | set flags | List of strings | optional | ["-eux"] |
shell | shell to use | String | optional | "/bin/sh" |
tools | Tools, will be added to runfiles | List of labels | optional | [] |
worker | Worker binary | Label | optional | "@com-alwaldend-git-src//go/bazel-shell-worker" |
3 - al_hugo_binary
al_hugo_binary
load("@com-alwaldend-git-src//bzl/rules:al_hugo_binary.bzl", "al_hugo_binary") al_hugo_binary(name, arguments, site)
Run a hugo command
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
arguments | Hugo arguments | List of strings | required | |
site | Hugo site | Label | required |
4 - al_hugo_run_binary
al_hugo_run_binary
load("@com-alwaldend-git-src//bzl/rules:al_hugo_run_binary.bzl", "al_hugo_run_binary") al_hugo_run_binary(name, arguments, site)
Run hugo binary as a build action
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
arguments | Hugo arguments | List of strings | required | |
site | Hugo site | Label | required |
5 - al_hugo_site
al_hugo_site
load("@com-alwaldend-git-src//bzl/rules:al_hugo_site.bzl", "al_hugo_site") al_hugo_site(name, configs, content, env, hugo_data, hugo_layouts, postcss, themes, tools)
Define a hugo site
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
configs | Hugo configs | List of labels | required | |
content | Hugo content | Label | required | |
env | Hugo environment variables (support location statements, support make variables, support shell commands) | Dictionary: String -> String | optional | {} |
hugo_data | Hugo data | Label | required | |
hugo_layouts | Hugo layouts | Label | required | |
postcss | Postcss target | Label | required | |
themes | Hugo themes | Label | required | |
tools | Tools that should be available for the build | List of labels | optional | [] |
6 - al_remove_directories
al_remove_directories
load("@com-alwaldend-git-src//bzl/rules:al_remove_directories.bzl", "al_remove_directories") al_remove_directories(name, srcs)
Remove directory files from DefaultInfo
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | Sources to remove directories from | List of labels | optional | [] |
7 - al_template_files
al_template_files
load("@com-alwaldend-git-src//bzl/rules:al_template_files.bzl", "al_template_files") al_template_files(name, srcs, data, outs, templater)
Load data files, then template the template and write the output
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | Template files | List of labels | required | |
data | Data files | List of labels | required | |
outs | Output files | List of labels; nonconfigurable | required | |
templater | Templater to use | Label | optional | "@com-alwaldend-git-src//go/template-files" |
8 - al_toml_data
al_toml_data
load("@com-alwaldend-git-src//bzl/rules:al_toml_data.bzl", "al_toml_data") al_toml_data(name, deps, srcs, tomlv)
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
deps | Toml data targets | List of labels | optional | [] |
srcs | Toml files | List of labels | optional | [] |
tomlv | Tomlv target to use for validation | Label | optional | "@com-alwaldend-git-src//tools:tomlv" |
9 - al_unpack_archives
al_unpack_archives
load("@com-alwaldend-git-src//bzl/rules:al_unpack_archives.bzl", "al_unpack_archives") al_unpack_archives(name, srcs, out)
Unpack several archives using tar into a directory
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | - | List of labels | required | |
out | - | String | optional | "" |
10 - al_write_script
al_write_script
load("@com-alwaldend-git-src//bzl/rules:al_write_script.bzl", "al_write_script") al_write_script(name, out, content, make_vars, set_flags, shebang)
Write a script and make it executable
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
out | Output file | Label; nonconfigurable | required | |
content | Script content | String | required | |
make_vars | Additional make vars | Dictionary: String -> String | optional | {} |
set_flags | Flags to pass to set | List of strings | optional | ["-eu"] |
shebang | Sheband to use | String | optional | "#!/usr/bin/env sh" |