forked from emacs-ng/emacs-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Rust crate to print lisp rust source
- Loading branch information
1 parent
c0552a2
commit 0a95755
Showing
3 changed files
with
180 additions
and
3 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 |
---|---|---|
@@ -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" |
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 @@ | ||
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(()) | ||
} |