Repository navigation
[Xamarin.Android.Build.Tasks] Remove dead legacy binding documentation and jar2xml paths - #13490
simonrozsival wants to merge 3 commits into
Conversation
The MDoc task was only invoked by the legacy BuildDocumentation target, gated on _UseLegacyJavadocImport, which nothing sets. The containing Xamarin.Android.Bindings.Documentation.targets is not imported anywhere. Remove the task, its UsingTask, the BuildDocumentation target and the MDC task-prefix doc entry. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the removal of the unused MDoc task and its legacy build wiring.
No open issues 🎉
What changed in this PR
Removes the unused MDoc MSBuild task from Xamarin.Android.Build.Tasks as cleanup related to #13479. The separate API documentation pipeline that invokes mdoc directly remains unchanged.
Changes:
- Deletes the
MDoctask implementation. - Removes its task registration and the legacy
BuildDocumentationtarget. - Removes the obsolete
MDCtask-prefix documentation entry.
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Tasks/MDoc.cs |
Deletes the unused task implementation. |
src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Documentation.targets |
Removes the MDoc registration and its consuming target. |
Documentation/docs-mobile/messages/index.md |
Removes the MDC–MDoc prefix entry. |
Review effort: Balanced
The `JarToXml` task and `Xamarin.Android.Bindings.JarToXml.targets` were unreachable: the SDK only imports `Xamarin.Android.Bindings.ClassParse.targets`, and `Microsoft.Android.Sdk.DefaultProperties.targets` unconditionally sets `$(AndroidClassParser)` to `class-parse`. Remove the task, its targets file, its packaging entry, its unit-test usages, the orphaned XA1021 resource and the `JTX` task prefix. The missing-SDK unit test now exercises the shared `TryGetAndroidJarPath` helper through `GetJavaPlatformJar`. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…tation.targets Context: 1c14614 (#10337) Context: b830f57 (#8464) Nothing has imported `Xamarin.Android.Bindings.Documentation.targets` since 1c14614 deleted `Xamarin.Android.Bindings.targets`, and b830f57 had already stopped shipping it in the .NET SDK pack. Every target in it is therefore unreachable, and so is everything that only it fed: * The `JavaDoc` task, which was only invoked by `_GenerateJavaDocFromSourceJars`. * `@(JavaDocIndex)`, which was only produced by this file. It is removed from `ClassParse.targets` and `AvailableItems.targets`. * `@(JavaDocJar)`: `ClassParse.targets` passed `$(IntermediateOutputPath)javadocs\%(FileName)` to `<ClassParse/>`, but that directory was only ever created by `_ExtractJavaDocJars` in this file. It has been a silent no-op in .NET binding projects. * `$(_UseLegacyJavadocImport)`, which only selected the legacy path. Its conditions in `ClassParse.targets` and `Bindings.Core.targets` are removed. `UnzipToFolder` remains: `Xamarin.Android.Common.targets` uses it for universal APK sets. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
Code assessment: no blocking findings — 0 ❌ errors, 0
Reviewed all 13 changed files, including the complete removed tasks/targets, and traced the surviving imports, callers, packaging entries, and documentation tests. The legacy task removals are consistent with the supported SDK import graph; the modern JavaSourceJar pipeline remains connected, Mono.Android's direct mdoc invocations are unaffected, and the still-used XA1020/XA1022 resources are correctly retained. The replacement missing-SDK test exercises the shared platform-jar lookup through GetJavaPlatformJar.
CI: All 40 head-commit GitHub checks report success, including the aggregate dotnet-android check for Azure build 1675316. Independent Azure build/timeline verification could not complete because of Azure CLI setup/authentication errors, so I cannot independently confirm the Azure result. No local builds or tests were run for this review.
Generated by Android PR Reviewer for #13490 · copilot · gpt61 · 47.3 AIC · ⌖ 7.4 AIC · ⊞ 20.2K
Comment /review to run again
|
|
||
| <Target Name="_GetJavaSourceJarJavadocFiles" | ||
| Condition=" '$(_UseLegacyJavadocImport)' != 'True' And '@(JavaSourceJar->Count())' != '0' "> | ||
| Condition=" '@(JavaSourceJar->Count())' != '0' "> |
There was a problem hiding this comment.
🤖 💡 Testing — Could the existing BindingBuildTest.JavaSourceJar test also cover $(_UseLegacyJavadocImport)=true? Removing this guard (and the corresponding extraction/documentation guards) intentionally makes projects retaining that old setting use the modern documentation pipeline. The existing test leaves the property unset, so it only covers the unchanged default behavior. A parameterized case that retains its XML-content assertions would lock in successful documentation import when the obsolete setting is still present.
{Rule: Test behavioral changes and assert generated output}
Context: 1c14614 (#10337)
Context: b830f57 (#8464)
Supersedes: #13489
Remove the dead classic binding-project documentation and jar2xml paths, together with everything that only they used.
Xamarin.Android.Bindings.Documentation.targets,MDocandJavaDocNothing has imported
Xamarin.Android.Bindings.Documentation.targetssince 1c14614 deletedXamarin.Android.Bindings.targets, and b830f57 had already stopped shipping it in the .NET SDK pack. TheBuildDocumentation,_ExtractJavaDocJarsand_GenerateJavaDocFromSourceJarstargets are therefore unreachable, and so is everything that only they fed:MDocandJavaDoctasks, which have no other callers. Themdocinvocations insrc/Mono.Android/Mono.Android.targetsrun the tool directly via<Exec/>and are unaffected.@(JavaDocIndex), which only this file produced. It is removed fromClassParse.targetsandAvailableItems.targets.@(JavaDocJar):ClassParse.targetspassed$(IntermediateOutputPath)javadocs\%(FileName)to<ClassParse/>, but only_ExtractJavaDocJarsever created that directory. The item has been a silent no-op in .NET binding projects. It was undocumented, and is removed fromAvailableItems.targets.$(_UseLegacyJavadocImport), which only selected the legacy path. Its conditions inClassParse.targetsandBindings.Core.targetsare removed. Leaving it unset behaves as before.MDCandJDCtask prefixes inmessages/index.md.UnzipToFolderstays, becauseXamarin.Android.Common.targetsuses it for universal APK sets.JarToXml(previously #13489)JarToXmlandXamarin.Android.Bindings.JarToXml.targetscan't be reached from any supported build either.Microsoft.Android.Sdk.After.targetsnever imports the JarToXml targets, andMicrosoft.Android.Sdk.DefaultProperties.targetsforces$(AndroidClassParser)toclass-parse. The docs already state that jar2xml is no longer supported.Tasks/JarToXml.cs, the targets file and its<None/>copy item.XA1021resource.messages/index.mdnow listsXA1021as no longer emitted, and theJTXprefix is dropped.JavaSourceUtilsstill emitsXA1020andXA1022, so they stay.ResolveSdksTaskTests: remove theJarToXmlcommand-line assertion.PlatformJarWithMissingSdkDoesNotThrownow runsGetJavaPlatformJar, which goes through the sameMonoAndroidHelper.TryGetAndroidJarPath()helper.Conflicts
#13479 moves
JavaDoc.cstoMicrosoft.Android.Build.Tasksand edits its<UsingTask/>. Whichever PR merges second should drop theJavaDocchanges.Testing
I didn't run local builds or tests for this batch because the machine is low on disk space. CI needs to confirm that
Xamarin.Android.Build.Taskscompiles, thatResolveSdksTaskTestspasses, and that the binding tests using@(JavaSourceJar)still pass. A grep confirms no remaining references toMDoc,JavaDoc(the task),JarToXml.cs,JavaDocIndex,JavaDocJar,_UseLegacyJavadocImportorXamarin.Android.Bindings.Documentation.targets.