mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-04 19:52:22 +00:00
Generators can now declare variant axes. Every generated entry is multiplied by each combination of choices, one per axis. A choice sets the axis name to the choice name and inserts its own values, and the entry name is suffixed with the choice names. Generators can also declare exclude rules, which remove generated entries whose values match every glob pattern in a rule. This covers unwanted variant combinations and entries like BLS rescue kernels. Entry matching for default-entry and the bootloader interface now accepts `*` anywhere in the pattern instead of only at the end, so generated entry names can be matched regardless of the kernel version in the middle of the name. The BLS generator gains a pin-names option (default true, the existing behavior). Two BLS generators reading the same directory previously produced entries with identical names; disabling pin-names prefixes them with the generator name instead. Sprout now warns when more than one entry has the same name. * docs(config): note that variants suffix pinned BLS entry names Pinned BLS entry names match the BLS entry ids, but variants still append their choice names, so those entries need a pattern like <id>-* to be selected.
16 lines
631 B
Rust
16 lines
631 B
Rust
use alloc::collections::BTreeMap;
|
|
use alloc::string::String;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
/// A single choice of a variant axis.
|
|
/// See [crate::generators::GeneratorDeclaration::variants] for how variants are applied.
|
|
#[derive(Serialize, Deserialize, Debug, Default, Clone)]
|
|
pub struct VariantChoice {
|
|
/// The name of the choice. This is set as the value of the axis name,
|
|
/// and is appended to the name of each entry the choice applies to.
|
|
pub name: String,
|
|
/// The values to insert into the context of each entry the choice applies to.
|
|
#[serde(default)]
|
|
pub values: BTreeMap<String, String>,
|
|
}
|