Compiler Conf (gen_ui.toml)

gen_ui.tomlGenUI项目的配置文件,它为编译器配置具体的项目信息和编译底层以及开发时插件。

配置示例

gen_ui.toml
1[compiler]
2target = "makepad"
3logo = true
4log_level = "info"
5excludes = ["Cargo.toml", "Cargo.lock", "target", ".gen_ui_cache", "gen_ui.toml", ".plugins"]
6
7[makepad]
8
9[makepad.root]
10path = "/Users/shengyifei/projects/gen_ui/made_with_GenUI/quickstart/start/views/root.gen"
11window = { height = "Fill", width = "Fill", flow = "Down", window_size = { inner_size = { x = 1080.0, y = 720.0 } } }
12
13[makepad.dependencies]
14makepad-widgets = { path = "/Users/shengyifei/projects/makepad/makepad/widgets" }
15
16[plugins]

配置说明

keyvalue typedescription
compilerCompilerConf编译基本配置
underlayerCompileUnderlayer编译底层配置(动态类型)
pluginsOption<HashMap<String, PathBuf>>GenUI插件

[compiler]

keyvalue typedescription
targetUnderlayer编译底层
logobool是否显示GenUI Logo
log_levelLogLevel日志级别
excludesExcludes需要被编译器排除的文件和目录

underlayer

makepad
其他暂无

[makepad]

keyvalue typedescription
entryOption<String>入口文件名
rootRootConf入口配置,包含UI入口地址和窗口属性
dependenciesOption<Vec<RustDependence>>Rust依赖项
wasmOption<WasmConf>wasm相关配置(编译同步模式, 暂不支持)

entry

  • Option<String>

[makepad.root]

keyvalue typedescription
pathPathBufUI根入口的地址
windowProp<WindowProps>窗口配置属性

[makepad.dependencies]

这里使用Option<Vec<RustDependence>>类型

[makepad.wasm]

keyvalue typedescription
freshbool是否需要在每次更新后重新编译
portOption<u16>端口 (默认8010)

[plugins]

  • Option<HashMap<String, PathBuf>>: 开发插件条目

这个配置一般由ract add命令自动添加,除非您需要使用自己开发的本地插件,它的写法很统一,指向插件的token.toml所在的目录即可

plugin_name = ".plugins/plugin_name"