maint: hotreload updated to 1.13.7
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using SingularityGroup.HotReload.Editor.Localization;
|
||||
using UnityEditor.Android;
|
||||
using UnityEditor.Build;
|
||||
|
||||
@@ -33,7 +34,7 @@ namespace SingularityGroup.HotReload.Editor {
|
||||
// Unity 2021 or older → put manifest flag in if Unity is making a Development Build
|
||||
var manifestFilePath = FindAndroidManifest(path);
|
||||
if (manifestFilePath == null) {
|
||||
throw new BuildFailedException($"[{CodePatcher.TAG}] Unable to find {manifestFileName}");
|
||||
throw new BuildFailedException(string.Format(Translations.Errors.ExceptionUnableToFindManifest, CodePatcher.TAG, manifestFileName));
|
||||
}
|
||||
SetUsesCleartextTraffic(manifestFilePath);
|
||||
#endif
|
||||
@@ -91,7 +92,7 @@ namespace SingularityGroup.HotReload.Editor {
|
||||
return manifestFilePath;
|
||||
}
|
||||
|
||||
Log.Info("Did not find {0} at {1}, searching for manifest file inside {2}", manifestFileName, manifestFilePath, dir.FullName);
|
||||
Log.Info(Translations.Errors.InfoManifestSearch, manifestFileName, manifestFilePath, dir.FullName);
|
||||
var manifestFiles = dir.GetFiles(manifestFileName, SearchOption.AllDirectories);
|
||||
if (manifestFiles.Length == 0) {
|
||||
return null;
|
||||
@@ -125,8 +126,8 @@ namespace SingularityGroup.HotReload.Editor {
|
||||
@"<application\s",
|
||||
"<application android:usesCleartextTraffic=\"true\" "
|
||||
);
|
||||
newContents += $"\n<!-- [{CodePatcher.TAG}] Added android:usesCleartextTraffic=\"true\" to permit connecting to the Hot Reload http server running on your machine. -->";
|
||||
newContents += $"\n<!-- [{CodePatcher.TAG}] This change only happens in Unity development builds. You can disable this in the Hot Reload settings window. -->";
|
||||
newContents += $"\n<!-- {string.Format(Translations.Errors.CommentAndroidCleartextPermit, CodePatcher.TAG)} -->";
|
||||
newContents += $"\n<!-- {string.Format(Translations.Errors.CommentAndroidCleartextDevelopmentOnly, CodePatcher.TAG)} -->";
|
||||
File.WriteAllText(manifestFilePath, newContents);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEngine;
|
||||
using SingularityGroup.HotReload.Editor.Localization;
|
||||
|
||||
namespace SingularityGroup.HotReload.Editor {
|
||||
/// <summary>Includes HotReload Resources only in development builds</summary>
|
||||
@@ -47,7 +48,7 @@ namespace SingularityGroup.HotReload.Editor {
|
||||
|
||||
public void OnPostprocessBuild(BuildTarget target, string path) {
|
||||
if (warnSettingsNotSupported) {
|
||||
Debug.LogWarning("Hot Reload was not included in the build because one or more build settings were not supported.");
|
||||
Debug.LogWarning(Translations.Errors.WarningBuildSettingsNotSupported);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user