예제 #1
0
        public void AddResourceFile()
        {
            var pbx       = LoadCopyOfOriginal();
            var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.pdf");
            var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);

            Assert.IsNotNull(fileEntry);
            Assert.IsTrue(fileEntry is FileEntry);
            pbx.AddFileOrFolder(fileEntry);
            pbx.Save();
            CompareFiles("AddResourceFile.pbxproj", pbx.SavePath);
        }
예제 #2
0
        public void AddCustomStaticLibraryEntry()
        {
            var pbx       = LoadCopyOfOriginal();
            var path      = Path.Combine(Application.dataPath, "Sample Data/Frameworks/test.a");
            var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);

            Assert.IsNotNull(fileEntry);
            Assert.IsTrue(fileEntry is StaticLibraryEntry);
            (fileEntry as StaticLibraryEntry).Link = LinkType.Optional;
            pbx.AddFileOrFolder(fileEntry);
            pbx.Save();
            CompareFiles("AddCustomStaticLibrary.pbxproj", pbx.SavePath);
        }
예제 #3
0
        public void AddCustomFrameworkEntry()
        {
            var rootPath  = Path.Combine(Application.dataPath, "Sample Data/Frameworks");
            var fwPath    = Path.Combine(rootPath, "MyTest.framework");
            var pbx       = LoadCopyOfOriginal();
            var fileEntry = FileAndFolderEntryFactory.Create(fwPath, AddMethod.Link);

            Assert.IsNotNull(fileEntry);
            Assert.IsTrue(fileEntry is FrameworkEntry);
            pbx.AddFileOrFolder(fileEntry);
            pbx.Save();
            CompareFiles("AddCustomFramework.pbxproj", pbx.SavePath);
        }
예제 #4
0
        public void AddSourceFile()
        {
            //TODO add compile flags
            var pbx = LoadCopyOfOriginal();

            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.m");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is SourceFileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.mm");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is SourceFileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.h");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is FileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.hpp");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is FileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.swift");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is SourceFileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.asm");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is SourceFileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.cpp");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is SourceFileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.cc");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is SourceFileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.c");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is SourceFileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.cxx");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is SourceFileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            {
                var path      = Path.Combine(Application.dataPath, "Sample Data/Files/test.hxx");
                var fileEntry = FileAndFolderEntryFactory.Create(path, AddMethod.Link);
                Assert.IsNotNull(fileEntry);
                Assert.IsTrue(fileEntry is FileEntry);
                pbx.AddFileOrFolder(fileEntry);
            }
            pbx.Save();
            CompareFiles("AddSourceFile.pbxproj", pbx.SavePath);
        }