Related to #1547: use dioxus-cli within a workspace (wildcard-members, real package names) (#1642)

* Related to #1547: use `dioxus-cli` within a workspace

Although the `dx` CLI allows to specify a package name to chose from workspace members,
it does not support workspace members specified as glob-wildcards.
Neither it respects the effective package name, specified in the crate's `Cargo.toml`.

This PR addresses that issue:
- upon `dx build ...`, if the `--bin` CLI-argument is provided, treat the current dir as a workspace;
- search through the workspace's `members`: resolve each of them with `glob`;
- assume that any workspace member has a `Cargo.toml` in it (cargo does it, so it's okay);
- read said manifest, and check the package name in it;
- if found — there we have our sought package.

* Use cargo-metadata to find out the workspace structure

* glob is unused
This commit is contained in:
Raman Hafiyatulin authored and GitHub committed 2023-11-15 15:14:16 -06:00
1 parent 62719c309a
commit 098689083d
2 files changed
+31 -39

No files matched your search

+3
View File
@@ -29,6 +29,9 @@ pub enum Error {
#[error("Cargo Error: {0}")]
CargoError(String),
#[error("Couldn't retrieve cargo metadata")]
CargoMetadata(#[source] cargo_metadata::Error),
#[error("{0}")]
CustomError(String),