//only used for upgrading from version 1 to 2 public static BaseFileEntry CreateFromObsolete(PListDictionary dic) { string path = dic.StringValue("Path"); var fileType = PBXFileTypeHelper.FileTypeFromFileName(path); if (PBXFileTypeHelper.IsSourceCodeFile(fileType)) { var entry = CreateSourceEntry(dic); return(entry); } else if (PBXFileTypeHelper.IsFramework(fileType)) { return(CreateFrameworkEntry(dic)); } else if (PBXFileTypeHelper.IsLibrary(fileType)) { return(CreateStaticLibraryEntry(dic)); } else if (PBXFileTypeHelper.IsContainer(fileType)) { return(CreateFileEntry(dic)); } else if (dic.ContainsKey("Files") || dic.ContainsKey("Folders")) { return(CreateFolderEntry(dic)); } else { return(CreateFileEntry(dic)); } }
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); } } }
public static BaseFileEntry Create(string path, AddMethod addMethod) { var fileType = PBXFileTypeHelper.FileTypeFromFileName(path); if (!IsValidFileOrFolder(path)) { return(null); } if (PBXFileTypeHelper.IsSourceCodeFile(fileType)) { return(CreateSourceEntry(path, addMethod, "")); } else if (PBXFileTypeHelper.IsFramework(fileType)) { return(CreateFrameworkEntry(path, addMethod, LinkType.Required, false)); } else if (PBXFileTypeHelper.IsLibrary(fileType)) { return(CreateStaticLibraryEntry(path, addMethod, LinkType.Required)); } else if (Directory.Exists(path) && !PBXFileTypeHelper.IsContainer(fileType)) { return(CreateFolderEntry(path, addMethod)); } else { return(CreateFileEntry(path, addMethod)); } }