Implement .NET 7 runtime support and bindings generation

This commit is contained in:
2022-11-17 19:49:39 +02:00
parent fe943ca010
commit 96dc279ebd
89 changed files with 6009 additions and 503 deletions

View File

@@ -375,7 +375,9 @@ namespace FlaxEditor.Modules
Thread.Sleep(0);
_workerThread.Join(1000);
_workerThread.Abort();
#if !USE_NETCORE
_workerThread.Abort(); // Deprecated in .NET 7
#endif
_workerThread = null;
}

View File

@@ -257,7 +257,7 @@ namespace FlaxEditor.Modules.SourceCodeEditing
{
Profiler.BeginEvent("GetXmlDocs");
var uri = new UriBuilder(assembly.CodeBase);
var uri = new UriBuilder(Utils.GetAssemblyLocation(assembly));
var path = Uri.UnescapeDataString(uri.Path);
var name = assembly.GetName().Name;
var xmlFilePath = Path.Combine(Path.GetDirectoryName(path), name + ".xml");

View File

@@ -391,9 +391,27 @@ namespace FlaxEditor.Modules.SourceCodeEditing
private static bool HasAssemblyValidAnyTypes(Assembly assembly)
{
var codeBase = Utils.GetAssemblyLocation(assembly);
#if USE_NETCORE
if (assembly.ManifestModule.FullyQualifiedName == "<In Memory Module>")
return false;
if (string.IsNullOrEmpty(codeBase))
return true;
// Skip runtime related assemblies
string repositoryUrl = assembly.GetCustomAttributes<AssemblyMetadataAttribute>().FirstOrDefault(x => x.Key == "RepositoryUrl")?.Value ?? "";
if (repositoryUrl != "https://github.com/dotnet/runtime")
return true;
#else
if (string.IsNullOrEmpty(codeBase))
return true;
// Skip assemblies from in-build Mono directory
var codeBase = assembly.CodeBase;
return string.IsNullOrEmpty(codeBase) || !codeBase.Contains("/Mono/lib/mono/");
if (!codeBase.Contains("/Mono/lib/mono/"))
return true;
#endif
return false;
}
private static bool HasAssemblyValidScriptingTypes(Assembly a)