Unity Xcode API获取项目所有非arc文件

作者: 2b75747cf703 | 来源:发表于2017-01-09 13:39 被阅读88次
                var pbxProject = new PBXProject();
                pbxProject.ReadFromFile("project.pbxproj");
    
                var pbxProjectData = pbxProject.GetFieldValue("m_Data");
                var buildFiles = pbxProjectData.GetFieldValue("buildFiles").Invoke("GetEntries") as IEnumerable;
    
                var fileRefGuidToProjectPathMap = pbxProjectData.GetFieldValue<Dictionary<string, string>>("m_FileRefGuidToProjectPathMap");
    
                var path = BabySystem.babyFrameWorkPath + "Editor/配置/-fno-objc-arc.txt";
    
                File.WriteAllText(path, "");
    
                foreach (var buildFile in buildFiles)
                {
                    var buildFileData = buildFile.GetPropertyValue("Value");
                    if (buildFileData.GetFieldValue<string>("compileFlags") == "-fno-objc-arc")
                    {
                        var fileRef = buildFileData.GetFieldValue<string>("fileRef");
    
                        var projectPath = fileRefGuidToProjectPathMap[fileRef];
    
                        File.AppendAllText(path, projectPath + "\n");
                    }
                }
    

    相关文章

      网友评论

        本文标题:Unity Xcode API获取项目所有非arc文件

        本文链接:https://www.haomeiwen.com/subject/ukhvvttx.html