提交 89613bf4 编写于 作者: J johnche(车雄生)

更优雅的方式去掉runtime warning

上级 9fb5cd82
......@@ -1640,18 +1640,18 @@ namespace XLua
{
Directory.CreateDirectory(CSObjectWrapEditor.GeneratorConfig.common_path);
}
using (BinaryWriter writer = new BinaryWriter(new FileStream(hotfix_cfg_in_editor, FileMode.Create, FileAccess.Write)))
{
writer.Write(editor_cfg.Count);
foreach(var kv in editor_cfg)
foreach (var kv in editor_cfg)
{
writer.Write(kv.Key);
writer.Write(kv.Value);
}
}
List<string> args = new List<string>() { inject_tool_path, assembly_csharp_path, typeof(LuaEnv).Module.FullyQualifiedName, id_map_file_path, hotfix_cfg_in_editor};
List<string> args = new List<string>() { assembly_csharp_path, typeof(LuaEnv).Module.FullyQualifiedName, id_map_file_path, hotfix_cfg_in_editor };
foreach (var path in
(from asm in AppDomain.CurrentDomain.GetAssemblies() select asm.ManifestModule.FullyQualifiedName)
......@@ -1670,8 +1670,8 @@ namespace XLua
var idMapFileNames = new List<string>();
foreach (var injectAssemblyPath in injectAssemblyPaths)
{
args[1] = injectAssemblyPath.Replace('\\', '/');
if (ContainNotAsciiChar(args[1]))
args[0] = injectAssemblyPath.Replace('\\', '/');
if (ContainNotAsciiChar(args[0]))
{
throw new Exception("project path must contain only ascii characters");
}
......@@ -1679,18 +1679,22 @@ namespace XLua
if (injectAssemblyPaths.Count > 1)
{
var injectAssemblyFileName = Path.GetFileName(injectAssemblyPath);
args[3] = CSObjectWrapEditor.GeneratorConfig.common_path + "Resources/hotfix_id_map_" + injectAssemblyFileName.Substring(0, injectAssemblyFileName.Length - 4) + ".lua.txt";
idMapFileNames.Add(args[3]);
args[2] = CSObjectWrapEditor.GeneratorConfig.common_path + "Resources/hotfix_id_map_" + injectAssemblyFileName.Substring(0, injectAssemblyFileName.Length - 4) + ".lua.txt";
idMapFileNames.Add(args[2]);
}
Process hotfix_injection = new Process();
hotfix_injection.StartInfo.FileName = mono_path;
hotfix_injection.StartInfo.Arguments = "\"" + String.Join("\" \"", args.ToArray()) + "\"";
#if UNITY_5_6_OR_NEWER
hotfix_injection.StartInfo.Arguments = "--runtime=v4.0.30319 " + inject_tool_path + " \"" + String.Join("\" \"", args.ToArray()) + "\"";
#else
hotfix_injection.StartInfo.Arguments = inject_tool_path + " \"" + String.Join("\" \"", args.ToArray()) + "\"";
#endif
hotfix_injection.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
hotfix_injection.StartInfo.RedirectStandardOutput = true;
hotfix_injection.StartInfo.UseShellExecute = false;
hotfix_injection.StartInfo.CreateNoWindow = true;
hotfix_injection.Start();
UnityEngine.Debug.Log(Regex.Replace(hotfix_injection.StandardOutput.ReadToEnd(), @"\s*WARNING: The runtime version supported by this application is unavailable(\s|.)*$", ""));
UnityEngine.Debug.Log(hotfix_injection.StandardOutput.ReadToEnd());
hotfix_injection.WaitForExit();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册