xcodeproj/pbxproj/object/build/phase/
file.rs1use crate::pbxproj::*;
2
3#[derive(Default, Debug, derive_new::new, derive_deref_rs::Deref)]
5pub struct PBXBuildFile<'a> {
6 pub id: String,
8 pub settings: Option<&'a PBXValue>,
10 pub platform_filter: Option<&'a String>,
12 #[deref]
14 pub file: Option<PBXFSReference<'a>>,
15 pub product: Option<XCSwiftPackageProductDependency<'a>>,
17 pub build_phase: Option<PBXBuildPhase<'a>>,
19}
20
21impl<'a> AsPBXObject<'a> for PBXBuildFile<'a> {
22 fn as_pbx_object(
23 id: String,
24 value: &'a PBXHashMap,
25 objects: &'a PBXObjectCollection,
26 ) -> anyhow::Result<Self>
27 where
28 Self: Sized + 'a,
29 {
30 Ok(Self {
31 id,
32 settings: value.get_value("settings"),
33 platform_filter: value.get_string("platformFilter"),
34 file: value.get_string("fileRef").and_then(|k| objects.get(k)),
35 product: value.get_string("productRef").and_then(|k| objects.get(k)),
36 build_phase: value
37 .get_string("buildPhaseReference")
38 .and_then(|k| objects.get(k)),
39 })
40 }
41}