Expand description
ferroui-static-view-locator-build
The generator of ferroui-static-view-locator, run by the build script of a crate that
declares view locators: a port of the source generator of StaticViewLocator
(https://github.com/wieslawsoltes/StaticViewLocator, StaticViewLocatorGenerator). The plan,
the mapping of every feature and the deviations are in docs/porting/static-view-locator.md.
ⓘ
// build.rs
fn main() {
ferroui_static_view_locator_build::StaticViewLocatorBuild::from_env()
.view_model_namespace_prefixes(["crate::view_models"])
.run();
}[build-dependencies]
ferroui-static-view-locator-build = "0.4"§What a run does
- Reads the
.xamlmetamodels of the dependencies (DEP_<LINKS>_XAMLMETA): the base classes of the views (UserControl,Windowand the classes derived from them in other crates) and, withinclude_referenced_crates, their view models. - Scans the sources of the crate with the scanner of the framework (
ferroui-build-scan): the classes, their base classes and constructors, the paths of the modules. - Reads the items of the sources: the types, the
implblocks, the visibility of the modules and the structs with#[static_view_locator]. - For each locator, maps its view models to their views and writes
$OUT_DIR/static_view_locator/<name>.rs, which#[static_view_locator]includes. - Prints the diagnostics (an error fails the build) and
cargo::rerun-if-changedfor every file it read.
The options of the reference’s MSBuild properties are the setters of
StaticViewLocatorBuild; the options of its attribute are the options of
#[static_view_locator(..)].
Re-exports§
pub use diagnostics::Diagnostic;pub use diagnostics::Severity;pub use options::GeneratorOptions;pub use options::ReplacementRule;
Modules§
- diagnostics
- The diagnostics of the generator (
DiagnosticDescriptors ofStaticViewLocatorGenerator.Adapters.cs). - options
- The options of the generator for a crate (the MSBuild properties
StaticViewLocator*of the reference,GeneratorOptions), set by the build script.
Structs§
- Generated
File - A generated file.
- Outcome
- What a run did.
- Static
View Locator Build - The generator of the locators of a crate, run by its build script.
Enums§
- Resolution
Mode - The fallback precedence of the generated adapters (
ViewResolutionMode).
Constants§
- OUTPUT_
DIRECTORY - The directory below
OUT_DIRthe generated files are written to;#[static_view_locator]includes them from there.