Java Callable Wrappers should be emitted & built as part of Build #4278
Labels
Area: Bindings
Issues in Java Library Binding projects.
enhancement
Proposed change to current functionality.
Context: dotnet/android-libraries#56
Currently, binding projects only emit binding assemblies. They don't do any "sanity checking" to ensure that the binding assembly is usable.
Enter dotnet/android-libraries#56: the Xamarin.Google.Android.Material 1.1.0-rc1 NuGet package contains a bug, as it binds the
com.google.android.material.button.MaterialButton.OnPressedChangeListener
interface asGoogle.Android.Material.Button.MaterialButton/IOnPressedChangeListener
. However,MaterialButton.OnPressedChangeListener
is not public; it's (presumably?) package-private, and as such it cannot be used from outside of its containing package.The result is that if an app tries to use the
Xamarin.Google.Android.Material
NuGet package, it will fail to build:This is in part a
generator
bug: dotnet/java-interop#572That said, there is also a "defense in depth" argument to be made here: the binding built, but it should never have built in the first place!
To ensure that binding projects are actually usable, the
Build
target for binding projects should also:This would avoid the need to create a new App project which references the Binding project to ensure that it works, which may result in "false positives" (e.g. if the App test project is built in Release config, the types which emit the "invalid" Java Callable Wrappers may never be emitted, resulting in a "good App" but a "bad binding assembly").
Steps to Reproduce
Expected Behavior
Actual Behavior
Version Information
Log File
The text was updated successfully, but these errors were encountered: