swift_package/conf/
args.rs

1use camino_fs::Utf8PathBuf;
2
3xflags::xflags! {
4    src "./src/conf/args.rs"
5
6    /// Compile a package into a cross-platform Apple XCFramework
7    cmd swift-package {
8
9        /// Do not print cargo log messages
10        optional --quiet
11
12        /// Package to build (see `cargo help pkgid`)
13        optional -p, --package package: String
14
15        /// Use verbose output (-v -v very verbose/build.rs output)
16        repeated -v, --verbose
17
18        /// Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
19        optional --unstable-flags unstable_flags: String
20
21        /// Build artifacts in release mode, with optimizations
22        optional -r, --release
23
24        /// Build artifacts with the specified profile
25        optional --profile profile: String
26
27        /// Space or comma separated list of features to activate
28        repeated -f, --features features: String
29
30        /// Activate all available features
31        optional --all-features
32
33        /// Do not activate the `default` feature
34        optional --no-default-features
35
36        /// Directory for all generated artifacts
37        optional --target-dir target_dir: Utf8PathBuf
38
39        /// Path to Cargo.toml.
40        optional --manifest-path manifest_path: Utf8PathBuf
41
42    }
43}
44
45// generated start
46// The following code is generated by `xflags` macro.
47// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
48#[derive(Debug)]
49pub struct SwiftPackage {
50    pub quiet: bool,
51    pub package: Option<String>,
52    pub verbose: u32,
53    pub unstable_flags: Option<String>,
54    pub release: bool,
55    pub profile: Option<String>,
56    pub features: Vec<String>,
57    pub all_features: bool,
58    pub no_default_features: bool,
59    pub target_dir: Option<Utf8PathBuf>,
60    pub manifest_path: Option<Utf8PathBuf>,
61}
62
63impl SwiftPackage {
64    #[allow(dead_code)]
65    pub fn from_env_or_exit() -> Self {
66        Self::from_env_or_exit_()
67    }
68
69    #[allow(dead_code)]
70    pub fn from_env() -> xflags::Result<Self> {
71        Self::from_env_()
72    }
73
74    #[allow(dead_code)]
75    pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> {
76        Self::from_vec_(args)
77    }
78}
79// generated end