Created
September 13, 2015 08:48
-
-
Save liortal53/2f516b0aa5aae178c2c5 to your computer and use it in GitHub Desktop.
Workaround for removing UnityEngine.xml that is included for iOS builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
/// <summary> | |
/// Helper class for removing UnityEngine.xml that is included in iOS builds (bug) | |
/// </summary> | |
public static class UnityEngineDocsRemover | |
{ | |
[PostProcessBuild] | |
public static void RemoveDocsFromBuild(BuildTarget buildTarget, string pathToBuiltProject) | |
{ | |
if (buildTarget == BuildTarget.iOS) | |
{ | |
var xmlDocumentationFiles = Directory.GetFiles(pathToBuiltProject, "UnityEngine.xml", SearchOption.AllDirectories); | |
foreach (var xmlDoc in xmlDocumentationFiles) | |
{ | |
UnityEngine.Debug.Log("Removing: " + xmlDoc); | |
File.Delete(xmlDoc); | |
} | |
} | |
} | |
} |
Oh, sorry I forgot I had to create a folder named "Editor" and put the script there.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UnityEditor does not exist after building the game. Test before sharing.