Exemple #1
0
        public bool Load(string projectPath)
        {
            if (string.IsNullOrEmpty(projectPath))
            {
                Debug.LogError("EgoXproject: Must have a Xcode project path");
                return(false);
            }

            //make sure we have a full path and not a relative path
            projectPath = Path.GetFullPath(projectPath);

            if (!LocatePBXProjFile(projectPath, out _pxbProjPath))
            {
                Debug.LogError("EgoXproject: Path must be to a valid Xcode project");
                return(false);
            }

            _projectPath = projectPath;
            var backup = CreateBackup();

            _pbxproj = new PBXProj();

            if (!_pbxproj.Load(_pxbProjPath))
            {
                RemoveBackup(backup);
                Debug.LogError("EgoXproject: Failed to load the Xcode project file - " + _pbxproj.ErrorMessage + ". Path: " + _pxbProjPath);
                return(false);
            }

            return(true);
        }
Exemple #2
0
    static void LoadAndSaveCopy()
    {
        var fileName = EditorUtility.OpenFilePanel("Open PBX File", "", "pbxproj");

        if (string.IsNullOrEmpty(fileName))
        {
            return;
        }

        PBXProj proj = new PBXProj();

        if (proj.Load(fileName))
        {
            Debug.Log("OK");
            File.Copy(fileName, fileName + ".orig");

            if (proj.Save())
            {
                File.Move(fileName, fileName + ".copy");
                File.Move(fileName + ".orig", fileName);
            }

            //proj
        }
        else
        {
            Debug.Log("Failed to load");
        }
    }
Exemple #3
0
        PBXProj LoadCopyOfPBXProjFile(string fileName)
        {
            CleanUpCopy();
            string originalFile = Path.Combine(_testFilesPath, fileName);
            string testFileCopy = Path.Combine(_testFilesPath, TEST_COPY_FILE_NAME);

            File.Copy(originalFile, testFileCopy);
            var  pbx     = new PBXProj();
            bool success = pbx.Load(testFileCopy);

            Assert.IsTrue(success);
            return(pbx);
        }
Exemple #4
0
    static void LoadProj()
    {
        var fileName = EditorUtility.OpenFilePanel("Open PBX File", "", "pbxproj");

        if (string.IsNullOrEmpty(fileName))
        {
            return;
        }

        PBXProj proj = new PBXProj();

        if (proj.Load(fileName))
        {
            Debug.Log("OK");
            //proj
        }
        else
        {
            Debug.Log("Failed to load");
        }
    }