Skip to content

[Xamarin.Android.Build.Tasks] Remove the dead JarToXml task - #13489

Closed
simonrozsival wants to merge 1 commit into
mainfrom
simonrozsival-delete-jartoxml
Closed

simonrozsival wants to merge 1 commit into
mainfrom
simonrozsival-delete-jartoxml

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

The JarToXml task and Xamarin.Android.Bindings.JarToXml.targets can't be reached from any supported build. Microsoft.Android.Sdk.After.targets imports only Xamarin.Android.Bindings.ClassParse.targets, never the JarToXml targets. Microsoft.Android.Sdk.DefaultProperties.targets also sets $(AndroidClassParser) to class-parse unconditionally, so a project setting jar2xml has no effect. The docs already say jar2xml is no longer supported (build-properties.md, OneDotNetBindingProjects.md). There's no user-facing switch left, so this PR doesn't add a new error or warning.

Changes:

  • Remove Tasks/JarToXml.cs and Xamarin.Android.Bindings.JarToXml.targets (which held the only <UsingTask/>), plus the <None/> item that copied the targets file to the output.
  • Remove the orphaned XA1021 resource from Resources.resx and Resources.Designer.cs. messages/index.md now lists XA1021 as "No longer emitted by current SDKs". Drop the JTX task prefix. JavaSourceUtils still emits XA1020 and XA1022, so they stay.
  • ResolveSdksTaskTests: remove the JarToXml command-line assertion and its helper subclass. PlatformJarWithMissingSdkDoesNotThrow now runs GetJavaPlatformJar, which uses the same MonoAndroidHelper.TryGetAndroidJarPath() helper and expects the same XA5300/XA5207 errors.

The ClassParse path is unchanged, including the ExportJarToXml and _ExportJarToXml target names, which ClassParse still uses.

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 and that ResolveSdksTaskTests passes.

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 <[email protected]>
@simonrozsival

Copy link
Copy Markdown
Member Author

Folded into #13490, which also removes the rest of the unreachable legacy binding documentation path.

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.

1 participant