Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] AndroidJavaSource refs dependent jars (#…
…8194) Fixes: #8191 The implementation of `@(AndroidJavaSource)` was missing one component: if your project contains `@(PackageReference)`s to NuGet packages which pull in `.jar` files, those `.jar` files would *not* be referenced when building `@(AndroidJavaSource)`. For example, if you reference the [Xamarin.AndroidX.AppCompat][0] package, there is an expectation that `@(AndroidJavaSource)` code should be able to use the type `androidx.appcompat.widget.Toolbar`. Unfortunately, this would fail: Error JAVAC0000 error: package androidx.appcompat.widget does not exist This would fail because the `javac` invocation was missing references to the `classes.jar` files which are extracted into the `$(IntemediateOutputPath)lp` directory. Update the (internal) `$(_CompileBindingJavaDependsOnTargets)` property so that the `_GetLibraryImports` target is a dependency. This will call the chain of targets which extracts the dependent `classes.jar` files and populates the `@(Jars)` ItemGroup which is used in the `_CompileBindingJava` target. This should allow users to write simple wrapper methods in Java that wrap more complex APIs. [0]: https://www.nuget.org/packages/Xamarin.AndroidX.AppCompat/1.1.0.1