Ract toml (.ract)

.ract is the configuration file of the Ract compiler, which uses the toml format. This file enables Ract to identify the current project type and compilation object.

Configuration Example

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

Configuration description

keyvalue typedescription
targetFrameworkTypeProject type
membersOption<Vec<Member>>Project members
compilesOption<Vec<usize>>Projects to be compiled. If not set, compile the first project in the member

Source Code.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}