xcodeproj/pbxproj/object/build/phase/
script.rs1use crate::pbxproj::*;
2
3#[derive(Debug, derive_new::new)]
7pub struct PBXShellScriptBuildPhase<'a> {
8 pub name: Option<&'a String>,
10 pub input_paths: Vec<&'a String>,
12 pub output_paths: Vec<&'a String>,
14 pub shell_path: Option<&'a String>,
16 pub shell_script: Option<&'a String>,
18 pub show_env_vars_in_log: bool,
20 pub always_out_of_date: bool,
22 pub dependency_file: Option<&'a String>,
24}
25
26impl<'a> AsPBXObject<'a> for PBXShellScriptBuildPhase<'a> {
27 fn as_pbx_object(
28 _id: String,
29 value: &'a PBXHashMap,
30 _objects: &'a PBXObjectCollection,
31 ) -> anyhow::Result<Self>
32 where
33 Self: Sized + 'a,
34 {
35 Ok(Self {
36 name: value.get_string("name"),
37 input_paths: value.try_get_vec("inputPaths")?.as_vec_strings(),
38 output_paths: value.try_get_vec("outputPaths")?.as_vec_strings(),
39 shell_path: value.get_string("shellPath"),
40 shell_script: value.get_string("shellScript"),
41 show_env_vars_in_log: value
42 .get_number("runOnlyForDeploymentPostprocessing")
43 .map(|v| v == &1)
44 .unwrap_or_else(|| true),
45 always_out_of_date: value
46 .get_number("alwaysOutOfDate")
47 .map(|v| v == &1)
48 .unwrap_or_else(|| false),
49 dependency_file: value.get_string("dependencyFile"),
50 })
51 }
52}