swift-package 0.1.1

Cargo plugin and library for building Apple Swift Packages
Documentation
use camino_fs::Utf8PathBuf;

xflags::xflags! {
    src "./src/conf/args.rs"

    /// Compile a package into a cross-platform Apple XCFramework
    cmd swift-package {

        /// Do not print cargo log messages
        optional --quiet

        /// Package to build (see `cargo help pkgid`)
        optional -p, --package package: String

        /// Use verbose output (-v -v very verbose/build.rs output)
        repeated -v, --verbose

        /// Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
        optional --unstable-flags unstable_flags: String

        /// Build artifacts in release mode, with optimizations
        optional -r, --release

        /// Build artifacts with the specified profile
        optional --profile profile: String

        /// Space or comma separated list of features to activate
        repeated -f, --features features: String

        /// Activate all available features
        optional --all-features

        /// Do not activate the `default` feature
        optional --no-default-features

        /// Directory for all generated artifacts
        optional --target-dir target_dir: Utf8PathBuf

        /// Path to Cargo.toml.
        optional --manifest-path manifest_path: Utf8PathBuf

    }
}

// generated start
// The following code is generated by `xflags` macro.
// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
#[derive(Debug)]
pub struct SwiftPackage {
    pub quiet: bool,
    pub package: Option<String>,
    pub verbose: u32,
    pub unstable_flags: Option<String>,
    pub release: bool,
    pub profile: Option<String>,
    pub features: Vec<String>,
    pub all_features: bool,
    pub no_default_features: bool,
    pub target_dir: Option<Utf8PathBuf>,
    pub manifest_path: Option<Utf8PathBuf>,
}

impl SwiftPackage {
    #[allow(dead_code)]
    pub fn from_env_or_exit() -> Self {
        Self::from_env_or_exit_()
    }

    #[allow(dead_code)]
    pub fn from_env() -> xflags::Result<Self> {
        Self::from_env_()
    }

    #[allow(dead_code)]
    pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> {
        Self::from_vec_(args)
    }
}
// generated end