lux_cli/
build.rs

1use clap::Args;
2use eyre::Result;
3use lux_lib::{
4    config::Config,
5    operations::{self},
6    project::Project,
7};
8
9#[derive(Args, Default)]
10pub struct Build {
11    /// Ignore the project's lockfile and don't create one.
12    #[arg(long)]
13    no_lock: bool,
14
15    /// Build only the dependencies
16    #[arg(long)]
17    only_deps: bool,
18}
19
20pub async fn build(data: Build, config: Config) -> Result<()> {
21    let project = Project::current_or_err()?;
22    operations::BuildProject::new(&project, &config)
23        .no_lock(data.no_lock)
24        .only_deps(data.only_deps)
25        .build()
26        .await?;
27    Ok(())
28}