You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been known that C# 8.0 will support default interface methods (DIM) and we will have to wait for 8.0. Turned out that there is already a preview version built within mono sdks, named as csc-dim.
We should make use of it and implement preview support for DIMs that will make Java bindings easier.
So far I observed they exist in xamarin-android built tree as:
Marek Safar said we should use csc-dim from system mono instead (after I noticed there is actually no /sources/xamarin-android/external/mono/sdks/out/android-host-Linux-debug/lib/mono/4.5/dim/csc.exe). What we should do is probably an extension NuGet package that provides these "dim" assemblies and override CscToolPath MSBuild property. So far /p:CscToolExe=/path/to/my/lib/mono/4.5/dim made it to work.
It should be straightforward to add a new generator unit test fixture which uses TestJVM/etc. to create an on-desktop JVM and run tests using generator-emitted code.
Activity
atsushieno commentedon Jun 26, 2018
Marek Safar said we should use csc-dim from system mono instead (after I noticed there is actually no
/sources/xamarin-android/external/mono/sdks/out/android-host-Linux-debug/lib/mono/4.5/dim/csc.exe). What we should do is probably an extension NuGet package that provides these "dim" assemblies and overrideCscToolPathMSBuild property. So far/p:CscToolExe=/path/to/my/lib/mono/4.5/dimmade it to work.jonpryor commentedon Jun 26, 2018
Step 1: update
generatorwithin Java.Interop to emit default interface methods.This need only support the
XAJavaInterop1andJavaInteropcodegen targets, not theXamarinAndroidcodegen target.jonpryor commentedon Jun 26, 2018
Existing on-desktop-JVM Java.Interop unit tests: https://github.com/xamarin/java.interop/tree/master/src/Java.Interop/Tests
https://github.com/xamarin/java.interop/blob/master/src/Java.Interop/Tests/Java.Interop/JavaObjectTest.cs
These build atop a
JavaVMFixture, which creates a desktop JVM: https://github.com/xamarin/java.interop/blob/master/tests/Java.Interop-Tests/Java.Interop/JavaVMFixture.cshttps://github.com/xamarin/java.interop/blob/master/tests/TestJVM/TestJVM.cs
It should be straightforward to add a new
generatorunit test fixture which usesTestJVM/etc. to create an on-desktop JVM and run tests usinggenerator-emitted code.jpobst commentedon Oct 1, 2019
Added in #3533.