Skip to content

[Xamarin.Android.Build.Tasks] Remove dead legacy binding documentation and jar2xml paths - #13490

Open
simonrozsival wants to merge 3 commits into
mainfrom
simonrozsival-delete-mdoc-task
Open

simonrozsival wants to merge 3 commits into
mainfrom
simonrozsival-delete-mdoc-task

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

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, MDoc and JavaDoc

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. The BuildDocumentation, _ExtractJavaDocJars and _GenerateJavaDocFromSourceJars targets are therefore unreachable, and so is everything that only they fed:

  • The MDoc and JavaDoc tasks, which have no other callers. The mdoc invocations in src/Mono.Android/Mono.Android.targets run the tool directly via <Exec/> and are unaffected.
  • @(JavaDocIndex), which only this file produced. It is removed from ClassParse.targets and AvailableItems.targets.
  • @(JavaDocJar): ClassParse.targets passed $(IntermediateOutputPath)javadocs\%(FileName) to <ClassParse/>, but only _ExtractJavaDocJars ever created that directory. The item has been a silent no-op in .NET binding projects. It was undocumented, and is removed from AvailableItems.targets.
  • $(_UseLegacyJavadocImport), which only selected the legacy path. Its conditions in ClassParse.targets and Bindings.Core.targets are removed. Leaving it unset behaves as before.
  • The MDC and JDC task prefixes in messages/index.md.

UnzipToFolder stays, because Xamarin.Android.Common.targets uses it for universal APK sets.

JarToXml (previously #13489)

JarToXml and Xamarin.Android.Bindings.JarToXml.targets can't be reached from any supported build either. Microsoft.Android.Sdk.After.targets never imports the JarToXml targets, and Microsoft.Android.Sdk.DefaultProperties.targets forces $(AndroidClassParser) to class-parse. The docs already state that jar2xml is no longer supported.

  • Remove Tasks/JarToXml.cs, the targets file and its <None/> copy item.
  • Remove the orphaned XA1021 resource. messages/index.md now lists XA1021 as no longer emitted, and the JTX prefix is dropped. JavaSourceUtils still emits XA1020 and XA1022, so they stay.
  • ResolveSdksTaskTests: remove the JarToXml command-line assertion. PlatformJarWithMissingSdkDoesNotThrow now runs GetJavaPlatformJar, which goes through the same MonoAndroidHelper.TryGetAndroidJarPath() helper.

Conflicts

#13479 moves JavaDoc.cs to Microsoft.Android.Build.Tasks and edits its <UsingTask/>. Whichever PR merges second should drop the JavaDoc changes.

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.Tasks compiles, that ResolveSdksTaskTests passes, and that the binding tests using @(JavaSourceJar) still pass. A grep confirms no remaining references to MDoc, JavaDoc (the task), JarToXml.cs, JavaDocIndex, JavaDocJar, _UseLegacyJavadocImport or Xamarin.Android.Bindings.Documentation.targets.

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>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 12:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 MDoc task implementation.
  • Removes its task registration and the legacy BuildDocumentation target.
  • Removes the obsolete MDC task-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

simonrozsival and others added 2 commits November 11, 2026 13:47
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>
@simonrozsival simonrozsival changed the title [Xamarin.Android.Build.Tasks] Remove unused MDoc task [Xamarin.Android.Build.Tasks] Remove dead legacy binding documentation and jar2xml paths Nov 11, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #13490

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code assessment: no blocking findings — 0 ❌ errors, 0 ⚠️ warnings, 1 💡 non-blocking inline suggestion. Final CI verification is limited as noted below.

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' ">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 💡 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}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants