Ract toml (.ract)

.ractRact编译器的配置文件,它使用toml格式。该文件能够让Ract辨别当前项目类型和编译对象。

配置示例

GenUI
Makepad Project
Makepad Workspace
.ract
1target = "gen_ui"
2members = [{ source = "start", target = "src_gen_0" }]

配置说明

keyvalue typedescription
targetFrameworkType项目类型
membersOption<Vec<Member>>项目成员
compilesOption<Vec<usize>>需要编译的项目,如果未设置,则编译成员中的第一个项目

.ract源码

1/// # RactToml
2/// each project has a .ract file to point the project kind and help ract to compile the project
3///
4/// **try support makepad and gen_ui**
5/// ## Example
6/// ```toml
7/// target = "gen_ui"
8/// members = [
9///    { source = "./hello", target = "./hello_makepad" },
10/// ]
11/// compiles = [0]
12/// ```
13#[derive(Debug, Clone)]
14pub struct RactToml {
15    /// target of the project
16    pub target: FrameworkType,
17    /// members of the project
18    pub members: Option<Vec<Member>>,
19    /// projects to compile, if not set, compile the first project in the members
20    /// - if compiles length is 0, not compile any project
21    /// - if compiles length is 1, compile the project in the members by index
22    /// - if compiles length is more than 1, use multiple threads to compile the projects
23    pub compiles: Option<Vec<usize>>,
24}