Skip to content

Conversation

@radekdoulik
Copy link
Member

Commits 70fc4c0 and 857b9a9 introduced support for handling methods with 14 and more
arguments. jnimarshalmethod-gen still needed update for handling these correctly and it is
implemented here.

The IL improvements code was updated to know how to handle new custom delegates code from
System.Linq.Expression.

The _ALL_THE_ARGUMENTS define was removed as it is no longer needed.

The test was updated to use the new staticFuncThisMethodTakesLotsOfParameters method.

Example generated code:

[JniAddNativeMethodRegistration]
public static void __RegisterNativeMembers (JniNativeMethodRegistrationArguments args)
{
	args.AddRegistrations (new JniNativeMethodRegistration[11] {
		new JniNativeMethodRegistration ("funcIJavaObject", "()Ljava/lang/Object;", new Func<IntPtr, IntPtr, IntPtr> (FuncIJavaObject)),
		new JniNativeMethodRegistration ("funcInt64", "()J", new Func<IntPtr, IntPtr, long> (FuncInt64)),
		new JniNativeMethodRegistration ("action", "()V", new Action<IntPtr, IntPtr> (InstanceAction)),
		new JniNativeMethodRegistration ("actionIJavaObject", "(Ljava/lang/Object;)V", new Action<IntPtr, IntPtr, IntPtr> (InstanceActionIJavaObject)),
		new JniNativeMethodRegistration ("staticAction", "()V", new Action<IntPtr, IntPtr> (StaticAction)),
		new JniNativeMethodRegistration ("staticActionFloat", "(F)V", new Action<IntPtr, IntPtr, float> (StaticActionFloat)),
		new JniNativeMethodRegistration ("staticActionIJavaObject", "(Ljava/lang/Object;)V", new Action<IntPtr, IntPtr, IntPtr> (StaticActionIJavaObject)),
		new JniNativeMethodRegistration ("staticActionInt", "(I)V", new Action<IntPtr, IntPtr, int> (StaticActionInt)),
		new JniNativeMethodRegistration ("staticActionInt32String", "(ILjava/lang/String;)V", new Action<IntPtr, IntPtr, int, IntPtr> (StaticActionInt32String)),
		new JniNativeMethodRegistration ("staticFuncMyLegacyColorMyColor_MyColor", "(II)I", new Func<IntPtr, IntPtr, int, int, int> (StaticFuncMyLegacyColorMyColor_MyColor)),
		new JniNativeMethodRegistration ("staticFuncThisMethodTakesLotsOfParameters", "(ZBCSIJFDLjava/lang/Object;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;Ljava/lang/Object;DFJ)Z", new _JniMarshal_PPZBCSIJFDLLLLLDFJ_Z (StaticFuncThisMethodTakesLotsOfParameters))
	});
}

@radekdoulik radekdoulik requested review from jonpryor and jpobst June 23, 2020 12:12
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jun 23, 2020
@jonpryor
Copy link
Contributor

Let's see how it works in xamarin-android! dotnet/android#4860

@jonpryor jonpryor merged commit de35d29 into dotnet:master Jun 24, 2020
@jpobst jpobst added this to the 10.5 (16.8 / 8.8) milestone Jun 26, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants