-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧑💻 tidy up trdelnik code, as a lot of stuff was implemented on multi…
…ple places and multiple times, add program stubs kind of automatic generenerating logic and fuzzer with token example
- Loading branch information
lukacan
authored and
lukacan
committed
Nov 24, 2023
1 parent
2cb87b1
commit 7c406e5
Showing
35 changed files
with
1,844 additions
and
2,022 deletions.
There are no files selected for viewing
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,12 +1,24 @@ | ||
use anyhow::Error; | ||
use anyhow::{bail, Error}; | ||
use fehler::throws; | ||
use trdelnik_client::*; | ||
|
||
use crate::discover; | ||
|
||
pub const TRDELNIK_TOML: &str = "Trdelnik.toml"; | ||
|
||
#[throws] | ||
pub async fn build(root: String) { | ||
let commander = Commander::with_root(root); | ||
commander.create_program_client_crate().await?; | ||
commander.build_programs().await?; | ||
commander.generate_program_client_deps().await?; | ||
commander.generate_program_client_lib_rs().await?; | ||
pub async fn build(root: Option<String>) { | ||
let root = match root { | ||
Some(r) => r, | ||
_ => { | ||
let root = discover(TRDELNIK_TOML)?; | ||
if let Some(r) = root { | ||
r | ||
} else { | ||
bail!("It does not seem that Trdelnik is initialized because the Trdelnik.toml file was not found in any parent directory!"); | ||
} | ||
} | ||
}; | ||
let mut builder = WorkspaceBuilder::new_with_root(root); | ||
builder.build().await?; | ||
} |
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,9 +1,17 @@ | ||
use anyhow::Error; | ||
use anyhow::{bail, Error}; | ||
use fehler::throws; | ||
use trdelnik_client::Cleaner; | ||
use trdelnik_client::WorkspaceBuilder; | ||
|
||
use crate::discover; | ||
pub const TRDELNIK_TOML: &str = "Trdelnik.toml"; | ||
|
||
#[throws] | ||
pub async fn clean() { | ||
let cleaner = Cleaner::new(); | ||
cleaner.clean_target().await?; | ||
let root = if let Some(r) = discover(TRDELNIK_TOML)? { | ||
r | ||
} else { | ||
bail!("It does not seem that Trdelnik is initialized because the Trdelnik.toml file was not found in any parent directory!"); | ||
}; | ||
let builder = WorkspaceBuilder::new_with_root(root); | ||
builder.clean().await?; | ||
} |
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
Oops, something went wrong.