generated from tweag/project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure crate layout for testing purposes
- Loading branch information
Erin van der Veen
committed
Jan 16, 2024
1 parent
483abc2
commit b7cf437
Showing
23 changed files
with
1,227 additions
and
599 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,14 +1,21 @@ | ||
[package] | ||
[workspace.package] | ||
name = "genealogos" | ||
description = "Converts Nix-tracing tool output into CycloneDX" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Tweag I/O"] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[workspace] | ||
members = ["genealogos", "genealogos-cli"] | ||
|
||
[dependencies] | ||
[workspace.dependencies] | ||
clap = { version = "4.4.14", features = ["derive"] } | ||
log = "0.4" | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde-cyclonedx = "0.8" | ||
serde_json = "1.0" | ||
uuid = { version = "1.6", features = ["v4"] } | ||
|
||
env_logger = "0.10" | ||
predicates = "3.1" | ||
test-log = "0.2" |
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,14 @@ | ||
[package] | ||
name = "genealogos-cli" | ||
description.workspace = true | ||
version.workspace = true | ||
edition.workspace = true | ||
authors.workspace = true | ||
|
||
[[bin]] | ||
name = "genealogos" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
clap = { workspace = true } | ||
genealogos = { path = "../genealogos" } |
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,25 @@ | ||
use std::fs::File; | ||
use std::io::{self, BufRead}; | ||
use std::path::PathBuf; | ||
|
||
use clap::Parser; | ||
|
||
use genealogos::genealogos; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command(author, version, about, long_about = None)] | ||
struct Args { | ||
file: PathBuf, | ||
} | ||
|
||
fn main() -> Result<(), io::Error> { | ||
let args = Args::parse(); | ||
|
||
let file = File::open(args.file)?; | ||
|
||
let json_out = genealogos(io::BufReader::new(file).lines().flatten()); | ||
|
||
println!("{}", json_out); | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "genealogos" | ||
description.workspace = true | ||
version.workspace = true | ||
edition.workspace = true | ||
authors.workspace = true | ||
|
||
[dependencies] | ||
clap = { workspace = true } | ||
log = { workspace = true } | ||
serde = { workspace = true } | ||
serde-cyclonedx = { workspace = true } | ||
serde_json = { workspace = true } | ||
uuid = { workspace = true } | ||
|
||
[dev-dependencies] | ||
env_logger = { workspace = true } | ||
predicates = { workspace = true } | ||
test-log = { workspace = true } |
Oops, something went wrong.