-
Notifications
You must be signed in to change notification settings - Fork 566
Expand file tree
/
Copy pathLinkAssembliesNoShrink.cs
More file actions
41 lines (35 loc) · 1.22 KB
/
LinkAssembliesNoShrink.cs
File metadata and controls
41 lines (35 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#nullable enable
using System;
using Mono.Linker.Steps;
using MonoDroid.Tuner;
namespace Xamarin.Android.Tasks
{
/// <summary>
/// This task is called for builds that did not use ILLink. It runs "linker steps" that
/// should be run on assemblies even in non-linked builds.
/// </summary>
public class LinkAssembliesNoShrink : AssemblyModifierPipeline
{
public override string TaskPrefix => "LNS";
public bool UseDesignerAssembly { get; set; }
protected override void BuildAssemblyModificationSteps (AssemblyPipeline pipeline, MSBuildLinkContext context)
{
// FixAbstractMethodsStep
var fixAbstractMethodsStep = new FixAbstractMethodsStep ();
fixAbstractMethodsStep.Initialize (context, new EmptyMarkContext ());
pipeline.Steps.Add (fixAbstractMethodsStep);
// FixLegacyResourceDesignerStep
if (UseDesignerAssembly) {
var fixLegacyResourceDesignerStep = new FixLegacyResourceDesignerStep ();
fixLegacyResourceDesignerStep.Initialize (context);
pipeline.Steps.Add (fixLegacyResourceDesignerStep);
}
// AddKeepAlivesStep
if (AddKeepAlives) {
var addKeepAliveStep = new AddKeepAlivesStep ();
addKeepAliveStep.Initialize (context);
pipeline.Steps.Add (addKeepAliveStep);
}
}
}
}