[dotnet-linker] Don't do anything in ManagedRegistrarStep unless the current registrar mode is 'ManagedStatic'.

This commit is contained in:
Rolf Bjarne Kvinge 2023-05-10 20:16:05 +02:00
Родитель bf639a99d7
Коммит 57d40d9cf1
3 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -5,6 +5,7 @@ using System.Linq;
using Mono.Cecil;
using Mono.Linker.Steps;
using Xamarin.Tuner;
using Xamarin.Bundler;
@ -16,6 +17,14 @@ namespace Xamarin.Linker {
get { return LinkerConfiguration.GetInstance (Context); }
}
public DerivedLinkContext DerivedLinkContext {
get { return Configuration.DerivedLinkContext; }
}
public Application App {
get { return DerivedLinkContext.App; }
}
protected void Report (params Exception [] exceptions)
{
Report ((IList<Exception>) exceptions);

Просмотреть файл

@ -11,6 +11,9 @@ namespace Xamarin.Linker {
protected override void TryProcessAssembly (AssemblyDefinition assembly)
{
base.TryProcessAssembly (assembly);
if (App.Registrar != RegistrarMode.ManagedStatic)
return;
}
}
}

Просмотреть файл

@ -23,10 +23,24 @@ namespace Xamarin.Linker {
exceptions.Add (exception);
}
protected override void TryProcess ()
{
base.TryProcess ();
App.SelectRegistrar ();
if (App.Registrar != RegistrarMode.ManagedStatic)
return;
}
protected override void TryEndProcess (out List<Exception>? exceptions)
{
base.TryEndProcess ();
if (App.Registrar != RegistrarMode.ManagedStatic) {
exceptions = null;
return;
}
// Report back any exceptions that occurred during the processing.
exceptions = this.exceptions;
}
@ -34,6 +48,9 @@ namespace Xamarin.Linker {
protected override void TryProcessAssembly (AssemblyDefinition assembly)
{
base.TryProcessAssembly (assembly);
if (App.Registrar != RegistrarMode.ManagedStatic)
return;
}
}
}