Exemplo n.º 1
0
        public void AddFrameworkFromCustomPath(string absolutePath)
        {
            //添加自定义路径的framework
            string frameworkReferencePath = UtilsPath.GetRelativePath(xcodePath, absolutePath);
            string fileName           = Path.GetFileName(absolutePath);
            string path               = PBXPath.GetDirectory(frameworkReferencePath) + "/**";
            string frameworkReference = pbxProj.AddFile(frameworkReferencePath, "Frameworks/" + fileName, PBXSourceTree.Group);

            pbxProj.AddFileToBuild(targetGuid, frameworkReference);
            pbxProj.AddBuildProperty(targetGuid, "FRAMEWORK_SEARCH_PATHS", path);
        }
Exemplo n.º 2
0
        public void AddDynamicFrameworkFromCustomPath(string absolutePath)
        {
            //添加自定义路径的EmbeddedFramework

            pbxProj.SetBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks");

            string frameworkReferencePath = UtilsPath.GetRelativePath(xcodePath, absolutePath);
            string path               = PBXPath.GetDirectory(frameworkReferencePath) + "/**";
            string fileName           = Path.GetFileName(absolutePath);
            string frameworkReference = pbxProj.AddFile(frameworkReferencePath, "Frameworks/" + fileName, PBXSourceTree.Group);

            pbxProj.AddFileToBuild(targetGuid, frameworkReference);

            pbxProj.AddDynamicFrameworkToProject(targetGuid, frameworkReferencePath, "Frameworks/" + fileName);

            pbxProj.AddBuildProperty(targetGuid, "FRAMEWORK_SEARCH_PATHS", path);
        }