1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Build command arguments
use clap::{Args, Subcommand, ValueEnum};
/// Build subcommands
#[derive(Subcommand, Debug)]
pub enum BuildCommand {
/// Build robot nodes (runs on the robot hardware)
Robot(BuildTargetArgs),
/// Build remote nodes (runs in the cloud/remote server)
Remote(BuildTargetArgs),
/// Build rl nodes (runs a trained RL policy in production, excludes the simulator)
Rl(BuildTargetArgs),
}
/// Version bump type
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum VersionBump {
/// Bump patch version (0.1.0 -> 0.1.1)
Patch,
/// Bump minor version (0.1.0 -> 0.2.0)
Minor,
/// Bump major version (0.1.0 -> 1.0.0)
Major,
}
/// Common arguments for build targets. Always builds the release profile, so there is no
/// `--release`/`-r` flag here.
#[derive(Args, Debug, Clone)]
pub struct BuildTargetArgs {
/// Optional target architecture for cross-compilation (cargo only). Overrides/narrows to
/// just this one triple even if `mecha10.json`'s `targets.robot.platforms`/
/// `targets.remote.platforms` (LAB-2152) configures multiple - when this flag is absent,
/// every triple listed there is built.
#[arg(short, long)]
pub target: Option<String>,
/// Bump version before building (patch, minor, major)
#[arg(long, value_enum, conflicts_with = "version")]
pub bump: Option<VersionBump>,
/// Set specific version before building (e.g., 1.2.3)
#[arg(long, conflicts_with = "bump")]
pub version: Option<String>,
/// Build with dev environment (default is production for builds)
#[arg(long)]
pub dev: bool,
/// Skip interactive prompts (e.g. the already-published-version bump prompt) - just warn and
/// proceed. Matches `mecha10 init`'s `--non-interactive` convention, for use in CI/scripts.
#[arg(long)]
pub non_interactive: bool,
}