Skip to content

Commit

Permalink
Remove workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
sbomer committed Mar 16, 2021
1 parent f78874b commit 34cd3bf
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Microsoft.Android.Sdk.ILLink/SetupStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ List<IStep> Steps {
}
}

static MethodInfo getReferencedAssembliesMethod = typeof (LinkContext).GetMethod ("GetReferencedAssemblies", BindingFlags.Public | BindingFlags.Instance);

List<IMarkHandler> MarkHandlers {
get {
if (_markHandlers == null) {
Expand All @@ -50,22 +48,15 @@ protected override void Process ()
new PreserveExportedTypes ()
}));

var cache = new TypeDefinitionCache ();
MarkHandlers.Add (new MarkJavaObjects ());
MarkHandlers.Add (new PreserveJavaExceptions ());
MarkHandlers.Add (new PreserveApplications ());
var cache = new TypeDefinitionCache ();
MarkHandlers.Add (new PreserveRegistrations (cache));
MarkHandlers.Add (new PreserveJavaInterfaces ());

MarkHandlers.Add (new FixAbstractMethodsHandler (cache));

// temporary workaround: this call forces illink to process all the assemblies
if (getReferencedAssembliesMethod == null)
throw new InvalidOperationException ($"Temporary linker workaround failed, {nameof (getReferencedAssembliesMethod)} is null.");

foreach (var assembly in (IEnumerable<AssemblyDefinition>)getReferencedAssembliesMethod.Invoke (Context, null))
Context.LogMessage ($"Reference assembly to process: {assembly}");

string proguardPath;
if (Context.TryGetCustomData ("ProguardConfiguration", out proguardPath))
InsertAfter (new GenerateProguardConfiguration (proguardPath), "CleanStep");
Expand Down

0 comments on commit 34cd3bf

Please sign in to comment.