ferroui_static_view_locator_build
module · ferroui-static-view-locator-build · v0.5.0
module ferroui_static_view_locator_build
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(..)].
Contents
diagnostics— moduleoptions— moduleDiagnostic— structSeverity— enumResolutionMode— enumGeneratorOptions— structReplacementRule— structOUTPUT_DIRECTORY— constantGeneratedFile— structOutcome— structStaticViewLocatorBuild— struct
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.