diff --git a/Cargo.lock b/Cargo.lock index 6d6e517e02c..9df1c5f7ec5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,6 +115,54 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.81" @@ -486,6 +534,18 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-files-core" +version = "0.1.1" +source = "git+https://github.com/declantsien/cargo-files.git?rev=f062a2cd5560dcbd2451090813093506bdb45aa0#f062a2cd5560dcbd2451090813093506bdb45aa0" +dependencies = [ + "cargo_metadata 0.18.1", + "dunce", + "proc-macro2", + "syn 2.0.53", + "thiserror", +] + [[package]] name = "cargo-platform" version = "0.1.7" @@ -509,6 +569,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cargo_toml" version = "0.19.2" @@ -607,6 +681,46 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "4.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.0", +] + +[[package]] +name = "clap_derive" +version = "4.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + [[package]] name = "clipboard-win" version = "5.3.0" @@ -682,6 +796,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "colors" version = "0.1.0" @@ -876,7 +996,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 2.0.53", ] @@ -955,6 +1075,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + [[package]] name = "either" version = "1.10.0" @@ -2260,6 +2386,14 @@ dependencies = [ "syn 2.0.53", ] +[[package]] +name = "lisp-source" +version = "0.1.0" +dependencies = [ + "cargo-files-core", + "clap", +] + [[package]] name = "lisp-util" version = "0.1.0" @@ -3592,6 +3726,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "subtle" version = "2.5.0" @@ -4096,7 +4236,7 @@ dependencies = [ "anyhow", "askama", "camino", - "cargo_metadata", + "cargo_metadata 0.15.4", "fs-err", "glob", "goblin", @@ -4186,7 +4326,7 @@ checksum = "118448debffcb676ddbe8c5305fb933ab7e0123753e659a71dc4a693f8d9f23c" dependencies = [ "anyhow", "camino", - "cargo_metadata", + "cargo_metadata 0.15.4", "fs-err", "once_cell", ] @@ -4220,6 +4360,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "1.8.0" diff --git a/crates/lisp-source/Cargo.toml b/crates/lisp-source/Cargo.toml new file mode 100644 index 00000000000..ba70cd0a17d --- /dev/null +++ b/crates/lisp-source/Cargo.toml @@ -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" diff --git a/crates/lisp-source/src/main.rs b/crates/lisp-source/src/main.rs new file mode 100644 index 00000000000..151f2c8c696 --- /dev/null +++ b/crates/lisp-source/src/main.rs @@ -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(()) +}