public void AddFrameworkOrLibrary(string path, AddMethod addMethod, LinkType linkType) { path = ProjectUtil.MakePathRelativeToProject(path); if (_entries.FindIndex(o => o.Path == path) < 0) { BaseFileEntry entry = null; var fileType = PBXFileTypeHelper.FileTypeFromFileName(path); if (PBXFileTypeHelper.IsFrameworkOrLibrary(fileType)) { entry = FileAndFolderEntryFactory.CreateFrameworkEntry(path, addMethod, linkType, false); } else { Debug.LogWarning("EgoXproject: File is not a known Framework or library file type. Adding as a regular file: " + path); entry = FileAndFolderEntryFactory.Create(path, addMethod); } if (entry == null) { Debug.LogError("EgoXproject: Could not add file. Either it does not exist or is on Ignore List: " + path); } else { _entries.Add(entry); } } }
public FilesAndFolderChanges(PListDictionary dic) { if (dic == null) { return; } var entries = dic.ArrayValue(ENTRIES_KEY); if (entries == null) { return; } for (int ii = 0; ii < entries.Count; ++ii) { var entryDic = entries.DictionaryValue(ii); if (entryDic == null) { continue; } var entry = FileAndFolderEntryFactory.Create(entryDic); if (entry != null) { _entries.Add(entry); } } }
public void AddSourceFile(string path, AddMethod addMethod, string compilerFlags = "") { path = ProjectUtil.MakePathRelativeToProject(path); if (_entries.FindIndex(o => o.Path == path) < 0) { BaseFileEntry entry = null; var fileType = PBXFileTypeHelper.FileTypeFromFileName(path); if (PBXFileTypeHelper.IsSourceCodeFile(fileType)) { entry = FileAndFolderEntryFactory.CreateSourceEntry(path, addMethod, compilerFlags); } else { Debug.LogWarning("EgoXproject: File is not a known source file type. Adding as a regular file: " + path); entry = FileAndFolderEntryFactory.Create(path, addMethod); } if (entry == null) { Debug.LogError("EgoXproject: Could not add file. Either it does not exist or is on Ignore List: " + path); } else { _entries.Add(entry); } } }
void AddEntry(string path, AddMethod addMethod = AddMethod.Link) { path = ProjectUtil.MakePathRelativeToProject(path); if (_entries.FindIndex(o => o.Path == path) > -1) { return; } var entry = FileAndFolderEntryFactory.Create(path, addMethod); if (entry != null) { _entries.Add(entry); } }
public FolderEntry(PListDictionary dic) : base(dic) { var entryDics = dic.ArrayValue(ENTRIES_KEY); if (entryDics != null) { foreach (var entryDic in entryDics) { var entry = FileAndFolderEntryFactory.Create(entryDic as PListDictionary); AddEntry(entry); } } else { //Try and load old keys var files = dic.ArrayValue("Files"); if (files != null) { for (int ii = 0; ii < files.Count; ii++) { var entry = FileAndFolderEntryFactory.CreateFromObsolete(files.DictionaryValue(ii)); if (entry != null) { AddEntry(entry); } } } var folders = dic.ArrayValue("Folders"); if (folders != null) { for (int ii = 0; ii < folders.Count; ii++) { var entry = FileAndFolderEntryFactory.CreateFromObsolete(folders.DictionaryValue(ii)); if (entry != null) { AddEntry(entry); } } } } }
public void AddFileOrFolder(string path, AddMethod addMethod = AddMethod.Link) { path = ProjectUtil.MakePathRelativeToProject(path); if (_entries.FindIndex(o => o.Path == path) < 0) { var entry = FileAndFolderEntryFactory.Create(path, addMethod); if (entry == null) { Debug.LogError("EgoXproject: Could not add file. Either does not exist or is on Ignore List: " + path); } else { _entries.Add(entry); } } }
void Populate() { bool populated = _entries.Count > 0; var files = Directory.GetFiles(Path); foreach (var f in files) { if (!FileAndFolderEntryFactory.IsValidFileOrFolder(f)) { continue; } var rel = ProjectUtil.MakePathRelativeToProject(f); AddEntry(FileAndFolderEntryFactory.Create(rel, Add)); } var folders = Directory.GetDirectories(Path); foreach (var f in folders) { if (!FileAndFolderEntryFactory.IsValidFileOrFolder(f)) { continue; } var rel = ProjectUtil.MakePathRelativeToProject(f); int index = -1; if (populated) { index = _entries.FindIndex(o => o.Path == rel); } if (index < 0) { AddEntry(FileAndFolderEntryFactory.Create(rel, Add)); } else if (_entries[index] is FolderEntry) { var subfe = _entries[index] as FolderEntry; subfe.Populate(); } } }