-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from webern/clean
twoilter: add build clean command
- Loading branch information
Showing
5 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
schema-version = 1 | ||
release-version = "1.0.0" | ||
|
||
[sdk] | ||
registry = "twoliter.alpha" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use crate::cargo_make::CargoMake; | ||
use crate::project; | ||
use crate::tools; | ||
use anyhow::Result; | ||
use clap::Parser; | ||
use std::path::PathBuf; | ||
|
||
#[derive(Debug, Parser)] | ||
pub(crate) struct BuildClean { | ||
/// Path to Twoliter.toml. Will search for Twoliter.toml when absent. | ||
#[clap(long = "project-path")] | ||
project_path: Option<PathBuf>, | ||
} | ||
|
||
impl BuildClean { | ||
pub(super) async fn run(&self) -> Result<()> { | ||
let project = project::load_or_find_project(self.project_path.clone()).await?; | ||
let toolsdir = project.project_dir().join("build/tools"); | ||
tools::install_tools(&toolsdir).await?; | ||
let makefile_path = toolsdir.join("Makefile.toml"); | ||
|
||
CargoMake::new(&project)? | ||
.env("TWOLITER_TOOLS_DIR", toolsdir.display().to_string()) | ||
.makefile(makefile_path) | ||
.project_dir(project.project_dir()) | ||
.exec("clean") | ||
.await?; | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
mod build; | ||
mod build_clean; | ||
mod debug; | ||
mod make; | ||
|
||
|