private static void removeCompatibilityLibraryFromProject(XCProject project)
{
string folderPath = Path.Combine(Application.dataPath, "Fyber/iOS/fyber-sdk-compat-lib");
if (Directory.Exists(folderPath))
{
Debug.Log(folderPath + " exists. Deleting it");
Directory.Delete(folderPath, true);
}
string libPath = Path.Combine(project.projectRootPath, "Libraries/Fyber/iOS/fyber-sdk-compat-lib");
if (Directory.Exists(libPath))
{
Debug.Log(libPath + " exists. Deleting it");
Directory.Delete(libPath, true);
}
#if UNITY_5
var compatGroup = "Libraries/Fyber/iOS/fyber-sdk-compat-lib";
string[] filesToRemove = { "FYBBannerSize.h", "FYBBannerView.h", "libFyberSDKCompat.a" };
UnityEditor.iOS.Xcode.PBXProject pbxProject = new UnityEditor.iOS.Xcode.PBXProject();
string pbxprojPath = UnityEditor.iOS.Xcode.PBXProject.GetPBXProjectPath(project.projectRootPath);
pbxProject.ReadFromFile(pbxprojPath);
foreach (string file in filesToRemove)
{
var fileToRemove = compatGroup + "/" + file;
if (pbxProject.ContainsFileByProjectPath(fileToRemove))
{
string guid = pbxProject.FindFileGuidByProjectPath(fileToRemove);
pbxProject.RemoveFile(guid);
}
}
pbxProject.WriteToFile(pbxprojPath);
#endif // UNITY_5
}