Skip to main content

numi_core/
lib.rs

1mod context;
2mod generation_cache;
3mod input_filters;
4mod output;
5mod parse_cache;
6pub mod parse_files;
7mod parse_fonts;
8mod parse_l10n;
9mod parse_xcassets;
10mod pipeline;
11mod render;
12
13pub use output::WriteOutcome;
14pub use pipeline::{
15    CheckOptions, CheckReport, DumpContextReport, GenerateError, GenerateOptions, GenerateProgress,
16    GenerateReport, HookPhase, HookReport, JobReport, check, check_loaded_config,
17    check_loaded_config_with_options, dump_context, generate, generate_loaded_config,
18    generate_loaded_config_with_progress, generate_with_options,
19    generate_with_options_and_progress,
20};
21
22#[cfg(test)]
23mod publish_invariants {
24    #[test]
25    fn builtin_templates_are_embedded_from_within_the_crate() {
26        let render_rs = include_str!("render.rs");
27
28        for needle in [
29            "include_str!(\"../templates/swift/swiftui-assets.jinja\")",
30            "include_str!(\"../templates/swift/l10n.jinja\")",
31            "include_str!(\"../templates/swift/files.jinja\")",
32            "include_str!(\"../templates/objc/assets.jinja\")",
33            "include_str!(\"../templates/objc/l10n.jinja\")",
34            "include_str!(\"../templates/objc/files.jinja\")",
35        ] {
36            assert!(
37                render_rs.contains(needle),
38                "expected render.rs to contain {needle}"
39            );
40        }
41
42        assert!(
43            !render_rs.contains("../../../templates/"),
44            "render.rs should not reference templates outside the crate root"
45        );
46    }
47}