AirConsole / airconsole-unity-plugin

A plugin for Unity to develop for AirConsole
http://developers.airconsole.com/#/guides/unity
GNU Lesser General Public License v3.0
69 stars 19 forks source link

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

Open joemicmc opened 6 years ago

joemicmc commented 6 years ago

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 commented 6 years ago

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);