예제 #1
0
        public static bool ChangePBProject(string pathToBuiltProject, ChangePBProjectStep step)
        {
            string projPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);

            if (!File.Exists(projPath))
            {
                Debug.LogError("[MSLDPostProcess][iOS][ChangePBProject]:projPath Not exists. projPath:" + projPath);
                return(false);
            }

            PBXProject proj = new PBXProject();

            proj.ReadFromFile(projPath);

            if (proj == null)
            {
                Debug.LogError("[MSLDPostProcess][iOS][ChangePBProject]:PBXProject is null. projPath:" + projPath);
                return(false);
            }

            string target = proj.TargetGuidByName(PBXProject.GetUnityTargetName());

            if (step != null)
            {
                if (step(proj, target))
                {
                    proj.WriteToFile(projPath);
                }
                else
                {
                    Debug.LogError("[MSLDPostProcess][iOS][ChangePBProject]:  step false");
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
        //// 添加Frameworks
        //public static bool AddFrameworks(string role, string URLName, string schemes)
        //{
        //    return true;
        //}

        //// 添加Embed Frameworks
        //public static bool AddEmbedFramework()
        //{
        //    return true;
        //}

        // 添加动态库
        public static void AddTbdToProject(PBXProject proj, string targetGuid, string tbd)
        {
            string fileGuid = proj.AddFile("usr/lib/" + tbd, "Frameworks/" + tbd, PBXSourceTree.Sdk);

            proj.AddFileToBuild(targetGuid, fileGuid);
        }