Skip to main content

compile_with_output_path

Function compile_with_output_path 

Source
pub fn compile_with_output_path(
    input_slint_file_path: impl AsRef<Path>,
    output_rust_file_path: impl AsRef<Path>,
    config: CompilerConfiguration,
) -> Result<Vec<PathBuf>, CompileError>
Expand description

Similar to compile_with_config, but meant to be used independently of cargo.

Will compile the input file and write the result in the given output file.

Both input and output paths should be absolute.

Doesn’t print any cargo messages.

If the input path is a directory, Slint loads the project file (slint-project.json) inside that directory. The project file provides the settings that config does not specify. It must contain a main entry, which specifies the .slint file the compiler loads.

Returns a list of all input files that were used to generate the output file. (dependencies)