You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[XABT] Refactor <LinkAssembliesNoShrink>/<AssemblyModifierPipeline> tasks to use an actual pipeline. (#10024)
In order to continue moving forward with moving tasks from the `<GenerateJavaStubs>` task to our "additional linker steps", we need a more flexible assembly scanning/modification pipeline.
Specifically, we will need to run "RewriteMarshalMethods" in the `<AssemblyModifierPipeline>` task so that it happens for both linked and non-linked builds. However, we want to run it:
- After the `FindJavaObjectsStep` step in the `<AssemblyModifierPipeline>` pipeline.
- In the same loop as the other assembly modification steps in the `<LinkAssembliesNoShrink>` task (which is before `<AssemblyModifierPipeline>` steps run) so that we do not need to write the assemblies twice.
Although we could achieve these goals with enough hacks, instead refactor the steps into a proper, flexible "pipeline".
This pipeline provides the features we need:
- Steps from both tasks can be run in any order
- Steps from both tasks can modify assemblies, and only 1 write call will happen
Additionally, encapsulate the "should this step run on this assembly" logic to each step, so that the pipeline doesn't need to know about each step's requirements.
// When marshal methods or non-JavaPeerStyle.XAJavaInterop1 are in use we do not want to skip non-user assemblies (such as Mono.Android) - we need to generate JCWs for them during
83
+
// application build, unlike in Debug configuration or when marshal methods are disabled, in which case we use JCWs generated during Xamarin.Android
Log.LogDebugMessage($"Skipping assembly '{context.Source.ItemSpec}' because it is not a user assembly and we don't need JLOs from non-user assemblies");
// Skip this assembly if it is not an Android assembly
174
-
if(!IsAndroidAssembly(source)){
175
-
Log.LogDebugMessage($"Skipping assembly '{source.ItemSpec}' because it is not an Android assembly");
176
-
returnfalse;
177
-
}
178
-
179
-
// When marshal methods or non-JavaPeerStyle.XAJavaInterop1 are in use we do not want to skip non-user assemblies (such as Mono.Android) - we need to generate JCWs for them during
180
-
// application build, unlike in Debug configuration or when marshal methods are disabled, in which case we use JCWs generated during Xamarin.Android
0 commit comments