//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));
            }
        }
Пример #2
0
        public void AddEmbeddedFramework(string path)
        {
            path = ProjectUtil.MakePathRelativeToProject(path);

            if (_entries.FindIndex(o => o.Path == path) < 0)
            {
                BaseFileEntry entry    = null;
                var           fileType = PBXFileTypeHelper.FileTypeFromFileName(path);

                if (PBXFileTypeHelper.IsFramework(fileType))
                {
                    entry = FileAndFolderEntryFactory.CreateFrameworkEntry(path, AddMethod.Copy, LinkType.Required, true);

                    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);
                    }
                }
                else
                {
                    Debug.LogWarning("EgoXproject: File is not a Framework type. Skipping: " + path);
                }
            }
        }
        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));
            }
        }