void RefreshMapsForGroupChildren(string projectPath, PBXGroup parent) { if (projectPath == null) projectPath = ""; else projectPath += "/"; var children = new List<string>(parent.children); foreach (string guid in children) { PBXFileReference fileRef = fileRefs[guid]; if (fileRef != null) { string path = projectPath + fileRef.name; m_ProjectPathToFileRefMap.Add(path, fileRef); m_FileRefGuidToProjectPathMap.Add(fileRef.guid, path); m_RealPathToFileRefMap[fileRef.tree].Add(fileRef.path, fileRef); m_GuidToParentGroupMap.Add(guid, parent); continue; } PBXGroup gr = groups[guid]; if (gr != null) { string path = projectPath + gr.name; m_ProjectPathToGroupMap.Add(path, gr); m_GroupGuidToProjectPathMap.Add(gr.guid, path); m_GuidToParentGroupMap.Add(guid, parent); RefreshMapsForGroupChildren(path, gr); } } }
public static PBXGroup Create(string name) { PBXGroup gr = new PBXGroup(); gr.guid = PBXGUID.Generate(); gr.m_Properties["isa"] = "PBXGroup"; gr.m_Properties["path"] = name; gr.m_Properties["sourceTree"] = "<group>"; gr.m_ListProperties["children"] = new List<string>(); return gr; }
void GroupsAdd(string projectPath, PBXGroup parent, PBXGroup gr) { m_ProjectPathToGroupMap.Add(projectPath, gr); m_GroupGuidToProjectPathMap.Add(gr.guid, projectPath); m_GuidToParentGroupMap.Add(gr.guid, parent); groups.AddEntry(gr); }
private PBXGroup GetPBXGroupChildByName(PBXGroup group, string path) { foreach (string guid in group.children) { var gr = groups[guid]; if (gr != null && gr.name == path) return gr; } return null; }
void FileRefsAdd(string realPath, string projectPath, PBXGroup parent, PBXFileReference fileRef) { fileRefs.AddEntry(fileRef); m_ProjectPathToFileRefMap.Add(projectPath, fileRef); m_FileRefGuidToProjectPathMap.Add(fileRef.guid, projectPath); m_RealPathToFileRefMap[fileRef.tree].Add(realPath, fileRef); // FIXME m_GuidToParentGroupMap.Add(fileRef.guid, parent); }
void RemoveGroupIfEmpty(PBXGroup gr) { if (gr.children.Count == 0 && gr.guid != project.project.mainGroup) { // remove from parent PBXGroup parent = m_GuidToParentGroupMap[gr.guid]; parent.RemoveGUID(gr.guid); RemoveGroupIfEmpty(parent); // remove actual group GroupsRemove(gr.guid); } }
private void RemoveGroupChildrenRecursive(PBXGroup parent) { List<string> children = new List<string>(parent.children); parent.children.Clear(); foreach (string guid in children) { PBXFileReference file = fileRefs[guid]; if (file != null) { foreach (var target in nativeTargets.entry) RemoveFileFromBuild(target.Value.guid, guid); FileRefsRemove(guid); continue; } PBXGroup gr = groups[guid]; if (gr != null) { RemoveGroupChildrenRecursive(gr); GroupsRemove(parent.guid); continue; } } }