[jnimarshalmethod-gen] JavaInterop1 marshal methods #1164
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #1159
Context: c93fea0
jnimarshalmethod-genis intended to generate marshal methods for any type that that:[JavaCallable](tested inJava.Interop.Export-Tests.dlland c93fea0), orvirtualmethod which has[JniMethodSignature], or[JniMethodSignature].Thus, the intention was that it should generate marshal methods for
Java.Base-Tests:Notably missing? No messages stating:
Also missing?
ikdasm bin/TestDebug-net7.0/Java.Base-Tests.dllshowed that there were no__RegisterNativeMembers()methods emitted.The
jnimarshalmethod-geninvocation was a no-op!The problems were twofold:
It was only looking for methods with
Android.Runtime.RegisterAttribute. This was useful for Xamarin.Android (when we were trying to make it work), but doesn't work with Java.Base. We need to also look forJava.Interop.JniMethodSignature.Relatedly, the attempt to use
registerAttribute.Constructor.Parametersto determine parameter names didn't work; the parameter name was always"".A'la c93fea0, we need to ensure that the Java
nativemethods we register are consistent withjcw-genoutput.Fix these two problems, which allows
jnimarshalmethod-gento now emit marshal methods for types withinJava.Base-Tests.dll.Additionally, rework the
jnimarshalmethod-gen -flogic to remove the existing__<$>_jni_marshal_methodsnested type when present.