// Copy and add a framework (Link Phase) to a PBXProject // // PBXProject project: the project to modify // string target: the target project's GUID // string framework: the path to the framework to add // string projectPath: the path to add the framework in the project, relative to the project root private static void AddFrameworkToProject(PBXProject project, string target, string framework, string buildPath, string projectPath) { Fabric.Internal.Editor.Utils.DirectoryCopy(framework, Path.Combine(buildPath, projectPath), true); string guid = project.AddFile (projectPath, projectPath); project.AddFileToBuild(target, guid); }
protected static void AddLibsToProject(string[] libs, PBXProject project, string target, string buildPath) { #if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 string fabricPluginsFullPath = Path.Combine(Directory.GetCurrentDirectory (), "Assets/" + fabricPluginsPath); foreach (string lib in libs) { string libPathInProject = Path.Combine ("Libraries", Path.GetFileName (lib)); string libFullPathInProject = Path.Combine (buildPath, libPathInProject); if (!File.Exists (libFullPathInProject)) { File.Copy (Path.Combine (fabricPluginsFullPath, lib), libFullPathInProject); string libGUID = project.AddFile (libFullPathInProject, libPathInProject, PBXSourceTree.Absolute); project.AddFileToBuild (target, libGUID); } } #else // Unity 5 and above should already take care of copying and linking non-platform frameworks #endif }
protected static void AddPlatformLibsToProject(string[] libs, PBXProject project, string target) { foreach (string lib in libs) { string libGUID = project.AddFile ("usr/lib/" + lib, "Libraries/" + lib, PBXSourceTree.Sdk); project.AddFileToBuild (target, libGUID); } }