Previously these deserialized into strings (via cargo-metadata
), now uses custom enums so we have stronger types!
V2NPEIA6ZXW2FE24IQBPLUICWIGMW7R2K7MNXUUKMOAAQWSQ36WQC
const CARGO_CUSOTM_PROFILE: [&str; 2] = ["--config", r#"profile.depwiz.inherits="dev""#];
const CARGO_CUSTOM_PROFILE: [&str; 2] = ["--config", r#"profile.depwiz.inherits="dev""#];
/// See https://doc.rust-lang.org/nightly/nightly-rustc/cargo/util/machine_message/struct.TimingInfo.html#method.reason
/// This should always be "timing-info"
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
enum Reason {
TimingInfo,
}
/// See https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/enum.TargetKind.html
/// and https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/enum.TargetKind.html#impl-Serialize-for-TargetKind
/// This is different to the original enum as `CrateType` has been manually flattened into this enum,
/// so some information is lost in favour of simplicity
// TODO: fix this limitation, make `TargetKind` match cargo's definition
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
enum TargetKind {
Lib,
Bin,
Test,
Bench,
ExampleLib,
ExampleBin,
CustomBuild,
Rlib,
Dylib,
Cdylib,
Staticlib,
ProcMacro,
}
/// See https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/manifest/struct.TargetInner.html
#[derive(Clone, Debug, Serialize, Deserialize)]
struct Target {
kind: Vec<TargetKind>,
name: String,
src_path: Utf8PathBuf,
edition: Edition,
doc: bool,
doctest: bool,
test: bool,
}