Repository navigation
[Xamarin.Android.Build.Tasks] Remove unused assembly codegen state - #13055
Conversation
Remove unused target parsing and pipeline context state after JavaInterop1 retirement. Stop passing the target to assembly rewriting and caching the unused JCW target, while retaining the task input as a documented no-op for compatibility. Keep codegen defaults and retired-value diagnostics unchanged. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The focused cleanup preserves compatibility inputs and existing validation while removing only verified unused state.
0 open findings
What changed in this PR
Removes obsolete code-generation state from the assembly-rewriting pipeline while retaining the task input for compatibility.
Changes:
- Removes unused parsing and pipeline state.
- Stops propagating codegen targets into assembly rewriting.
- Removes the irrelevant property-cache entry.
| File | Description |
|---|---|
Xamarin.Android.Common.targets |
Removes obsolete task propagation and cache input. |
MonoAndroidHelper.cs |
Removes the unused parser. |
AssemblyPipeline.cs |
Removes codegen state from StepContext. |
AssemblyModifierPipeline.cs |
Removes parsing and context assignment. |
🧠 Review effort: Balanced
|
@dalexsoto review |
dalexsoto
left a comment
There was a problem hiding this comment.
The complete four-file correctness and integration review confirms that only unused codegen state and an irrelevant cache entry were removed. The no-op task input, retired-value diagnostics, and assembly rewrite/copy behavior remain intact. The previously failed APK leg and its exact JNI-reference tests now pass on the existing retry, resolving the CI deferral.
Follow-up to #13030.
Xamarin.Android.Tasks.AssemblyModifierPipelinestill parses a codegentarget and copies it into
StepContext.CodeGenerationTarget, but noassembly-rewriting step reads that value after JavaInterop1 retirement.
Remove the unused field, context property, parser, and task-argument
propagation. Also remove
$(_AndroidJcwCodegenTarget)from the buildproperties cache, since it no longer affects assembly rewriting.
Keep the
CodeGenerationTargettask input as a no-op so explicit externalMSBuild task invocations remain compatible. Keep
JavaPeerStyle, codegendefaults, and the XA4232/XA4240 retired-value diagnostics unchanged.
Assembly-copy/rewrite logic and all other cache entries are untouched.
Only four production files change, with 19 deletions and no additions.
No tests are added or modified, as requested.
Local validation
All builds and tests use this branch's locally built SDK.
make prepare && make all./dotnet-local.sh build Microsoft.Android.slnx -t:BuildExtraApiLevels -c Debug -v quiet./dotnet-local.sh build build-tools/create-packs/Microsoft.Android.Sdk.proj -t:ConfigureLocalWorkload -c Debug -v quiet./dotnet-local.sh build src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj -c Debug --no-restore -v quiet./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter 'FullyQualifiedName~LinkerTests|Name~UnsupportedCodegenTargetIsRejected|Name~UnsupportedJcwCodegenTargetIsRejected'git diff --checkThe four skipped cases are existing intentional
Assert.Ignorecases,not missing prerequisites:
LinkDescription(False,CoreCLR): CoreCLR does not support builds without assembly stores.RemoveDesigner(False,CoreCLR): CoreCLR supports only assembly stores.WarnAboutAppDomains((True, CoreCLR)): Release-case trimmer-warning issue dotnet/linker#2982.WarnAboutAppDomains((True, NativeAOT)): The same existing Release-case trimmer-warning issue.Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include: