File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ pub use object::*;
77pub use value:: * ;
88
99use anyhow:: Result ;
10- use std:: path:: { Path , PathBuf } ;
10+ use std:: {
11+ collections:: HashMap ,
12+ path:: { Path , PathBuf } ,
13+ } ;
1114use tap:: Pipe ;
1215
1316/// `Main` Representation of project.pbxproj file
@@ -76,6 +79,14 @@ impl PBXRootObject {
7679 pub fn objects_mut ( & mut self ) -> & mut PBXObjectCollection {
7780 & mut self . objects
7881 }
82+
83+ /// Get a hashmap of targets and their platform
84+ pub fn targets_platform ( & self ) -> HashMap < String , PBXTargetPlatform > {
85+ self . targets ( )
86+ . into_iter ( )
87+ . flat_map ( |t| Some ( ( t. name ?. to_string ( ) , t. platfrom ( & self . objects ) ) ) )
88+ . collect :: < HashMap < _ , _ > > ( )
89+ }
7990}
8091
8192impl TryFrom < PBXHashMap > for PBXRootObject {
You can’t perform that action at this time.
0 commit comments