Skip to content

Commit

Permalink
Add Rust crate to print lisp rust source
Browse files Browse the repository at this point in the history
  • Loading branch information
declantsien committed Mar 25, 2024
1 parent c0552a2 commit 0a95755
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 3 deletions.
152 changes: 149 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions crates/lisp-source/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "lisp-source"
description = "Print lisp rust source files"
version = "0.1.0"
edition = "2021"

[dependencies]
clap = { version = "4.1", features = ["derive"] }

[dependencies.cargo-files-core]
git = "https://github.com/declantsien/cargo-files.git"
rev = "f062a2cd5560dcbd2451090813093506bdb45aa0"
19 changes: 19 additions & 0 deletions crates/lisp-source/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use cargo_files_core::{get_target_files, get_targets, Error};
use std::path::PathBuf;

fn main() -> Result<(), Error> {
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("..")
.join("..")
.join("Cargo.toml");
let targets = get_targets(Some(&path))?;
for target in targets {
println!("target {target:?}");
let files = get_target_files(&target)?;
for file in files {
println!("{}", file.display());
}
}

Ok(())
}

0 comments on commit 0a95755

Please sign in to comment.