easy-install 1.3.11

easy-install
Documentation
// https://github.com/axodotdev/cargo-dist/blob/main/cargo-dist-schema/src/lib.rs

use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
pub(crate) type RelPath = String;
pub(crate) type ArtifactId = String;
pub(crate) type TripleName = String;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct DistManifest {
    #[serde(default)]
    #[serde(skip_serializing_if = "BTreeMap::is_empty")]
    pub(crate) artifacts: BTreeMap<ArtifactId, Artifact>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct Artifact {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub(crate) kind: Option<ArtifactId>,

    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub(crate) name: Option<ArtifactId>,
    #[serde(skip_serializing_if = "Vec::is_empty")]
    #[serde(default)]
    pub(crate) target_triples: Vec<TripleName>,
    /// Assets included in the bundle (like executables and READMEs)
    #[serde(skip_serializing_if = "Vec::is_empty")]
    #[serde(default)]
    pub(crate) assets: Vec<Asset>,
}
/// An asset contained in an artifact (executable, license, etc.)
#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct Asset {
    /// The executable_name name of the asset
    #[serde(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub(crate) executable_name: Option<String>,

    /// The high-level name of the asset
    #[serde(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub(crate) name: Option<String>,
    /// The path of the asset relative to the root of the artifact
    #[serde(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub(crate) path: Option<RelPath>,
    /// The kind of asset this is
    #[serde(flatten)]
    pub(crate) kind: AssetKind,
}

/// An artifact included in a Distributable
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "kind")]
#[non_exhaustive]
pub(crate) enum AssetKind {
    /// An executable artifact
    #[serde(rename = "executable")]
    Executable(ExecutableAsset),
    /// A C dynamic library
    #[serde(rename = "c_dynamic_library")]
    CDynamicLibrary(DynamicLibraryAsset),
    /// A C static library
    #[serde(rename = "c_static_library")]
    CStaticLibrary(StaticLibraryAsset),
    /// A README file
    #[serde(rename = "readme")]
    Readme,
    /// A LICENSE file
    #[serde(rename = "license")]
    License,
    /// A CHANGELOG or RELEASES file
    #[serde(rename = "changelog")]
    Changelog,
    /// Unknown to this version of cargo-dist-schema
    ///
    /// This is a fallback for forward/backward-compat
    #[serde(other)]
    #[serde(rename = "unknown")]
    Unknown,
}

/// An executable artifact (exe/binary)
#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct ExecutableAsset {
    /// The name of the Artifact containing symbols for this executable
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub(crate) symbols_artifact: Option<ArtifactId>,
}

/// A C dynamic library artifact (so/dylib/dll)
#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct DynamicLibraryAsset {
    /// The name of the Artifact containing symbols for this library
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub(crate) symbols_artifact: Option<ArtifactId>,
}

/// A C static library artifact (a/lib)
#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct StaticLibraryAsset {
    /// The name of the Artifact containing symbols for this library
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub(crate) symbols_artifact: Option<ArtifactId>,
}