Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generator-Tests] Enable JavaInterop1 Integration output tests #1271

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

jonpryor
Copy link
Member

Remaining Integration-Tests which don't support JavaInterop1:

  • Use of Android.Runtime.GeneratedEnumAttribute:

    CS0234: The type or namespace name 'GeneratedEnumAttribute' does not exist in the namespace 'Android.Runtime'
    

    Impacts: Core_Jar2Xml.cs

  • Use of Android.Runtime.RegisterAttribute on *Implementor types, probable missing event handler support:

    CS0234: The type or namespace name 'RegisterAttribute' does not exist in the namespace 'Android.Runtime'
    
    [Register ("mono/com/google/android/exoplayer/drm/ExoMediaDrm_OnEventListenerImplementor")]
    internal sealed partial class IExoMediaDrmOnEventListenerImplementor : global::Java.Lang.Object, IExoMediaDrmOnEventListener
    

    Impacts: GenericArguments.cs

  • Missing builtin mapping between collection types:

    warning BG8800: Unknown parameter type 'java.util.List<java.lang.Integer>' for member …
    warning BG8800: Unknown parameter type 'java.util.ArrayList<java.lang.Integer>' for member
    warning BG8400: Unexpected field type `java.util.List<java.lang.String>`
    

    Impacts: Java_Util_List.cs, NormalMethods.cs, ParameterXPath.cs

  • Handle isn't a public property in JavaInterop1, resulting in warning CS0109:

    CS0109: The member 'SomeObject.Handle(Object, Throwable)' does not hide an accessible member. The new keyword is not required.
    

    Impacts: NormalMethods.cs

  • Use of JNIEnv.GetJniName()

    string __id = "(L" + global::Android.Runtime.JNIEnv.GetJniName (GetType ().DeclaringType) + ";)V";
    

    Impacts: NestedTypes.cs

Remaining Integration-Tests which don't support JavaInterop1:

  * Use of `Android.Runtime.GeneratedEnumAttribute`:

        CS0234: The type or namespace name 'GeneratedEnumAttribute' does not exist in the namespace 'Android.Runtime'

    Impacts: Core_Jar2Xml.cs

  * Use of `Android.Runtime.RegisterAttribute` on `*Implementor`
    types, probable missing event handler support:

        CS0234: The type or namespace name 'RegisterAttribute' does not exist in the namespace 'Android.Runtime'

        [Register ("mono/com/google/android/exoplayer/drm/ExoMediaDrm_OnEventListenerImplementor")]
        internal sealed partial class IExoMediaDrmOnEventListenerImplementor : global::Java.Lang.Object, IExoMediaDrmOnEventListener

    Impacts: GenericArguments.cs

  * Missing builtin mapping between collection types:

        warning BG8800: Unknown parameter type 'java.util.List<java.lang.Integer>' for member …
        warning BG8800: Unknown parameter type 'java.util.ArrayList<java.lang.Integer>' for member
        warning BG8400: Unexpected field type `java.util.List<java.lang.String>`

    Impacts: Java_Util_List.cs, NormalMethods.cs, ParameterXPath.cs

  * `Handle` isn't a public property in JavaInterop1, resulting in
    warning CS0109:

        CS0109: The member 'SomeObject.Handle(Object, Throwable)' does not hide an accessible member. The new keyword is not required.

    Impacts: NormalMethods.cs

  * Use of `JNIEnv.GetJniName()`

        string __id = "(L" + global::Android.Runtime.JNIEnv.GetJniName (GetType ().DeclaringType) + ";)V";

    Impacts: NestedTypes.cs
Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it helps, but we don't use the "real" Android.Runtime.* types that are missing. We have dummy versions that could be used: https://github.com/dotnet/java-interop/tree/main/tests/generator-Tests/SupportFiles.

@jonpryor
Copy link
Member Author

@jpobst wrote:

I don't know if it helps, but we don't use the "real" Android.Runtime.* types that are missing.

It doesn't help. The intent of the TryJavaInterop1 => true tests is to help ensure that:

  1. If/when src/Java.Base uses these constructs/features, it will be able to do so-
  2. without using Android.Runtime types.

…meaning the current generator emission of JNIEnv.GetJniName() for nested types will need to be updated (removed) before src/Java.Base can bind non-static inner classes such as AbstractQueuedLongSynchronizer.ConditionObject.

…meaning the current generator emission of Android.Runtime.GeneratedEnumAttribute will need to be updated/removed if/when we "enumify" src/Java.Base.

…meaning the current generator emission of [Register] means we'll need to update how events are handled for src/Java.Base.

…meaning… :-)

@jonpryor jonpryor merged commit 0aec86a into main Oct 22, 2024
4 checks passed
@jonpryor jonpryor deleted the dev/jonp/jonp-enable-ji-tests branch October 22, 2024 19:20
jonpryor pushed a commit to dotnet/android that referenced this pull request Oct 25, 2024
Changes: dotnet/java-interop@2a1e180...87fdb8e

  * dotnet/java-interop@87fdb8e6: [generator-Tests] bind java.util.List (dotnet/java-interop#1273)
  * dotnet/java-interop@32506ce5: Bump to dotnet/android-tools@60fae19 (dotnet/java-interop#1270)
  * dotnet/java-interop@53079086: [Java.Base] Update to Microsoft.DotNet.GenAPI 8.0.0-beta.24516.1 (dotnet/java-interop#1272)
  * dotnet/java-interop@0aec86ac: [generator-Tests] Enable JavaInterop1 Integration output tests (dotnet/java-interop#1271)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 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.

2 participants