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");
}
}
网友评论