BuildProcessorUtil.cs 709 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.IO;
  3. using UnityEditor.Build;
  4. namespace HybridCLR.Editor.BuildProcessors
  5. {
  6. public static class BuildProcessorUtil
  7. {
  8. public static string GetXcodeProjectFile(string pathToBuiltProject)
  9. {
  10. foreach (string dir in Directory.GetDirectories(pathToBuiltProject, "*.xcodeproj", SearchOption.TopDirectoryOnly))
  11. {
  12. string pbxprojFile = $"{dir}/project.pbxproj";
  13. if (File.Exists(pbxprojFile))
  14. {
  15. return pbxprojFile;
  16. }
  17. }
  18. throw new BuildFailedException($"can't find xxxx.xcodeproj/project.pbxproj in {pathToBuiltProject}");
  19. }
  20. }
  21. }