Expand description
The interface every UI target module implements.
A target describes itself and its capabilities, checks the shared IR, generates code and resources, and returns a build plan that the build driver executes. The compiler core only talks to this interface; it never imports a concrete target, and disabling one target leaves the others buildable.
Modules§
- brand_
assets - tvOS application icons. A tvOS app shows a layered icon that tilts
under the focus, made of image stacks in a
.brandassetsfolder of an asset catalog: the home screen icon at 400 × 240 points, the App Store icon at 1280 × 768, and the Top Shelf images shown when the app sits in the top row. A declared.brandassetsfolder ships as it is; from a square PNG (or the Bern logo) this module draws one: the icon on a back layer of its own background color, so the art floats over its ground when the icon tilts. - feature
- Names of IR features a target lists in
TargetDescriptor::features. - glue
- Rust source for generated glue crates.
- icon
- Application icons. Without
[app].iconevery target uses the Bern logo; with it, the declared square PNG.[app.icon]can also give a platform its own icon: another square PNG, or the icon in the platform’s own form (an.icnsfile, an.icofile, an.appiconsetfolder, an Icon Composer.iconfolder for macOS and iOS, a tvOS.brandassetsfolder, an Androidresfolder, an icon theme folder, a folder of page icons), which is shipped as it is. The platform containers (.icoon Windows,.icnson macOS) hold PNG images as they are, so nothing here decodes or scales pixels: the logo ships pre-rendered at every size the platforms ask for, and a declared PNG is used at its own size. Only tvOS’s layered icon is drawn from the square one, incrate::brand_assets. - icon_
set - The Bern icon set: icon names in SF Symbols naming. The Apple targets draw every SF Symbol; the other targets map each name to one of their platform’s own icons, and every one of them draws at least the names listed here. A name a target cannot draw fails its check at the element, so no target shows a placeholder in its place.
- names
- Identifiers generators derive from Bern’s
snake_casenames. Each target escapes the results that are keywords of its own language. - script
- Build-time selection and shared sources of the JavaScript host.
- skill
- The agent skill a build ships beside its command line: a
SKILL.mdthat tells an agent how to reach the running application and lists every command, query, state field and UI action of this build, from the same catalog the command line and the MCP server derive theirs from. - style
- Style overrides of one platform: the rules of
style!that apply to a control kind and variant, merged for a target to draw. - svg
- Shared animated SVG assets and runtime templates for all presenters.
- texts
- Texts every native runtime shows itself, the per-language tables of runtimes that fill Bern’s named placeholders, and the conversion of those placeholders to a platform’s positional format specifiers.
Structs§
- Android
Options - Android capabilities needed by an application’s Rust engine, which cannot be inferred from its UI. Multicast also enables network access.
- Build
Context - Paths and packages a target needs to plan its build.
- Build
Plan - Diagnostic
- A diagnostic pointing back to the developer’s declaration.
- Feature
Report - A feature contract report for one platform: the result of every feature in every applicable size, and the diagnostics they raise.
- Generated
File - Media
Support - The media backend and video presenter a target assembles for
Video. The two are versioned separately from the target and from each other. - Module
Build - The crates of one application module, for the generated glue.
- Registry
- Explicit registry of target modules, assembled by the build host.
- Signing
- How packages are signed, from the environment of
bern package. Certificates stay with the person or the CI service that builds; none of this goes intoBern.toml. - Style
Support - The style effects a target shows for one control kind: outside any state, and in each state.
- Target
Config - Target settings from
[targets.<name>]inBern.toml. - Target
Descriptor - WebExtension
- An application-owned browser adapter. Its
index.jsexports a setup function. - Window
Capabilities - How a target can present
Windowdeclarations.
Enums§
- Build
Step - One step the build driver executes for a target.
- Color
Source - Where a target’s colors come from.
- Framework
- Where the Bern crates come from: the source of the project’s own
berndependency. Generated crates take every Bern crate from it, so the application and the code generated around it share one copy of each. - Run
- How
bern runstarts a built application. - Severity
- Simulated
System - The system a simulator runs, as its runtimes name it.
Constants§
- WINDOWS_
FRONTENDS - The Windows front ends: WinUI 3 on the Windows App Runtime, and the system XAML through XAML Islands, which every Windows 10 and 11 has.
Traits§
- Target
- A UI target module.
Functions§
- archive
- A step that archives
dir, withdiritself as the top folder, intostemplus the extension the build machine’s own tools make:.zipon macOS (ditto) and Windows (tar),.tar.gzon Linux (tar). - check_
common - Check the parts of the IR every target must agree on: IR version, supported components and window presentation requirements.
- default_
ui - Default UI technology per platform.
- dist_
dir - Where packages go:
target/bern/dist/of the workspace. - feature_
report - Evaluate every feature contract for
platform: exemptions apply only to their platform; missing and unproven features are errors (B201, B203), manual guarantees warnings (B206) and exemptions notes (B205). - files_
below - Every file below
dir, as (path, path relative todir), sorted. - package_
architecture - The build machine’s architecture as packages name it:
arm64orx64(x86_64on macOS, where that is the usual name). - toml_
string - A TOML basic string.
- uses_
text_ formats - Whether the application writes numbers, dates or durations in its
texts, or shows enum fields in labels: what
feature::TEXT_FORMATSnames.