airconsole-unity-plugin icon indicating copy to clipboard operation
airconsole-unity-plugin copied to clipboard

PostBuildProcess.cs renames index.html file to screen.html and breaks Unity Cloud Builds

Open joemicmc opened this issue 7 years ago • 1 comments

In our current project with have continuous integration using Unity Cloud Build. Currently the AirConsole plugin runs the following post build process regardless of template used:

https://github.com/AirConsole/airconsole-unity-plugin/blob/master/Assets/AirConsole/scripts/editor/PostBuildProcess.cs

Line 22 File.Move (pathToBuiltProject + "/index.html", pathToBuiltProject + "/screen.html");

As there isn't a way to target the template, this affects builds using the default template which is used by the Unity Cloud Build. If index.html is missing then the build silently fails. Is there a reason the index.html file can't exist alongside screen.html?

To fix this locally in my project I amended line 22 to copy the file:

File.Copy (pathToBuiltProject + "/index.html", pathToBuiltProject + "/screen.html", true);

joemicmc avatar Jan 05 '18 22:01 joemicmc

Also had to correct line 30 as the default template needs .json file:

File.Copy (pathToBuiltProject + "/Build/" + Path.GetFileName(pathToBuiltProject) + ".json", pathToBuiltProject + "/Build/game.json", true);

joemicmc avatar Jan 05 '18 22:01 joemicmc