Public API re-exports
load("@rules_pkl//pkl:defs.bzl", "pkl_codegen_java_toolchain") pkl_codegen_java_toolchain(name, cli)
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
cli | - | Label | optional | "@rules_pkl//pkl:pkl_codegen_java_cli" |
load("@rules_pkl//pkl:defs.bzl", "pkl_doc_toolchain") pkl_doc_toolchain(name, cli)
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
cli | - | Label | optional | "@rules_pkl//pkl:pkl_doc_cli" |
load("@rules_pkl//pkl:defs.bzl", "pkl_eval") pkl_eval(name, deps, srcs, data, outs, entrypoints, expression, format, multiple_outputs, properties)
Evaluate Pkl module(s).
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
deps | Other targets to include in the pkl module path when building this configuration. Must be pkl_* targets. |
List of labels | optional | [] |
srcs | The Pkl source files to be evaluated. | List of labels | optional | [] |
data | Files to make available in the filesystem when building this configuration. These can be accessed by relative path. | List of labels | optional | [] |
outs | Names of the output files to generate. Defaults to <rule name>.<format> . If the format attribute is unset, use <rule name>.pcf . Expects a single file if multiple_outputs is not set to True . |
List of labels | optional | [] |
entrypoints | The pkl file to use as an entry point (needs to be part of the srcs). Typically a single file. | List of labels | optional | [] |
expression | A pkl expression to evaluate within the module. Note that the format attribute does not affect how this renders. |
String | optional | "" |
format | The format of the generated file to pass when calling pkl . See https://pkl-lang.org/main/current/pkl-cli/index.html#command-eval. |
String | optional | "" |
multiple_outputs | Whether to expect to render multiple file outputs. If outs is specified then individual generated files will be exposed. Otherwise, a single directory, with the name of the target, containing all generated files will be exposed. (see https://pkl-lang.org/main/current/pkl-cli/index.html#command-eval). |
Boolean | optional | False |
properties | Dictionary of name value pairs used to pass in Pkl external properties. See the Pkl docs: https://pkl-lang.org/main/current/pkl-cli/index.html#command-eval | Dictionary: String -> String | optional | {} |
load("@rules_pkl//pkl:defs.bzl", "pkl_library") pkl_library(name, deps, srcs, data)
Collect Pkl sources together so they can be used by other rules_pkl
rules.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
deps | Other targets to include in the pkl module path when building this library. Must be pkl_* targets. | List of labels | optional | [] |
srcs | The Pkl source files to include in this library. | List of labels | required | |
data | Files to make available in the filesystem when building this library target. These can be accessed by relative path. | List of labels | optional | [] |
load("@rules_pkl//pkl:defs.bzl", "pkl_package") pkl_package(name, srcs, extra_flags, project, strip_prefix)
Prepares a Pkl project to be published as a package as per the pkl project package
command, using Bazel.
You should have at most one pkl_package
rule per pkl_project
repo rule.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
srcs | - | List of labels | optional | [] |
extra_flags | - | List of strings | optional | [] |
project | - | Label | required | |
strip_prefix | Strip a directory prefix from the srcs. | String | optional | "" |
load("@rules_pkl//pkl:defs.bzl", "pkl_test") pkl_test(name, deps, srcs, data, outs, entrypoints, expression, format, multiple_outputs, properties)
Create a Pkl test that can be run with Bazel.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
deps | Other targets to include in the pkl module path when building this configuration. Must be pkl_* targets. |
List of labels | optional | [] |
srcs | The Pkl source files to be evaluated. | List of labels | optional | [] |
data | Files to make available in the filesystem when building this configuration. These can be accessed by relative path. | List of labels | optional | [] |
outs | Names of the output files to generate. Defaults to <rule name>.<format> . If the format attribute is unset, use <rule name>.pcf . Expects a single file if multiple_outputs is not set to True . |
List of labels | optional | [] |
entrypoints | The pkl file to use as an entry point (needs to be part of the srcs). Typically a single file. | List of labels | optional | [] |
expression | A pkl expression to evaluate within the module. Note that the format attribute does not affect how this renders. |
String | optional | "" |
format | The format of the generated file to pass when calling pkl . See https://pkl-lang.org/main/current/pkl-cli/index.html#command-eval. |
String | optional | "" |
multiple_outputs | Whether to expect to render multiple file outputs. If outs is specified then individual generated files will be exposed. Otherwise, a single directory, with the name of the target, containing all generated files will be exposed. (see https://pkl-lang.org/main/current/pkl-cli/index.html#command-eval). |
Boolean | optional | False |
properties | Dictionary of name value pairs used to pass in Pkl external properties. See the Pkl docs: https://pkl-lang.org/main/current/pkl-cli/index.html#command-eval | Dictionary: String -> String | optional | {} |
load("@rules_pkl//pkl:defs.bzl", "pkl_toolchain") pkl_toolchain(name, cli)
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
cli | - | Label | optional | None |
load("@rules_pkl//pkl:defs.bzl", "pkl_doc") pkl_doc(name, srcs, kwargs)
Generate documentation website for Pkl files.
PARAMETERS
Name | Description | Default Value |
---|---|---|
name | A unique name for this target. | none |
srcs | The Pkl source files to be documented. | none |
kwargs | Further keyword arguments. E.g. visibility. | none |
load("@rules_pkl//pkl:defs.bzl", "pkl_java_library") pkl_java_library(name, srcs, module_path, generate_getters, deps, tags, kwargs)
Create a compiled JAR of Java source files generated from Pkl source files.
PARAMETERS
load("@rules_pkl//pkl:defs.bzl", "pkl_test_suite") pkl_test_suite(name, srcs, deps, tags, visibility, size, test_suffix, kwargs)
Create a suite of Pkl tests from the provided files.
Given the list of srcs
, this macro will generate:
- A
pkl_test
target (with visibility:private) persrc
that ends withtest_suffix
- A
pkl_library
that accumulates any files that don't matchtest_suffix
- A
native.test_suite
that accumulates all of thepkl_test
targets
PARAMETERS