euv_cli/bundle/struct.rs
1use super::*;
2
3/// One native deliverable in a resolved build plan.
4#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub struct NativeTarget {
6 /// The platform this deliverable produces.
7 pub platform: NativePlatform,
8 /// The kind of builder this deliverable needs.
9 pub task: NativeTask,
10}
11
12/// The resolved plan for one native build invocation.
13///
14/// The plan names the host it was resolved against, the deliverables that
15/// will be built, and the platforms that were requested but cannot be
16/// built here.
17#[derive(Clone, Data, Debug)]
18pub struct NativePlan {
19 /// The host operating system the plan was resolved against.
20 #[get(pub(crate))]
21 pub host: HostOs,
22 /// The host architecture the plan was resolved against.
23 #[get(pub(crate))]
24 pub arch: String,
25 /// The deliverables that will be built, in build order.
26 #[get(pub(crate))]
27 pub targets: Vec<NativeTarget>,
28 /// The platforms that were requested but cannot be built on this host.
29 #[get(pub(crate))]
30 pub unsupported: Vec<NativePlatform>,
31}
32
33/// The native build settings a command line carries.
34///
35/// The flags that select native work live beside the ordinary build
36/// flags, so `euv build` keeps its current behaviour and the native
37/// options only take effect when they are given.
38#[derive(Clone, Data, Debug, Parser)]
39pub struct BuildArgs {
40 /// The ordinary build arguments shared with the run mode.
41 #[command(flatten)]
42 #[get(pub(crate))]
43 pub mode: ModeArgs,
44 /// Build every native deliverable this host can produce.
45 #[arg(long)]
46 #[get(pub(crate), type(copy))]
47 pub all: bool,
48 /// Build only the named native platforms.
49 #[arg(long, value_delimiter = ',')]
50 #[get(pub(crate))]
51 pub platforms: Vec<NativePlatform>,
52 /// The native client project directory, when it is not inside this repository.
53 #[arg(long)]
54 #[get(pub(crate))]
55 pub native_path: Option<PathBuf>,
56 /// Print the resolved native plan and exit without building.
57 #[arg(long)]
58 #[get(pub(crate), type(copy))]
59 pub plan: bool,
60}