Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Support module-info.class #1096

Closed
Closed

Description

@jonpryor

Context: #1093
Context: https://mvnrepository.com/artifact/org.jetbrains/annotations/24.0.1
Context: https://www.oracle.com/corporate/features/understanding-java-9-modules.html
Context: https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.25

JDK 9 adds support for modules, which is (kinda sorta) like .NET Assemblies: modules can depend upon other modules, export types, etc.

In particular:

exports and exports…to. An exports module directive specifies one of the module’s packages whose public types (and their nested public and protected types) should be accessible to code in all other modules. An exports…to directive enables you to specify in a comma-separated list precisely which module’s or modules’ code can access the exported package—this is known as a qualified export.

This allows an equivalent to the C# internal access modifier: public types in a non-exported package should be treated as "internal", while public types in an exported package a "fully public".

TODO:

  • Implement support in Xamarin.Android.Tools.Bytecode for the Module Attribute, the CONSTANT_Module_info structure, and any other relevant module-related structures.
  • Figure out what //@visibility value should be used for "public types in a non-exported package"; should it be internal? kotlin-internal? Other? See also: 678c4bd, which added the kotlin-internal visibility
  • generator changes to deal with the new visibility value, if necessary.

Activity

  1. added
    enhancementProposed change to current functionality
    generatorIssues binding a Java library (generator, class-parse, etc.)
    on Apr 11, 2023
  2. jonpryor commented on Apr 17, 2023

    @jonpryor
    ContributorAuthor

    After discussion, the //*/@visibility value should be kotlin-internal, as that's just easier. See also this suggested commit message for PR #793, which sadly didn't make it into the final commit:

    Note: we introduce and use a new `//*/@visibility` value of
    `kotline-internal` because `internal` is an *existing* value that may
    be used in `Metadata.xml` files, e.g. making `public` API `internal`
    so that it can still be used in the binding, but isn't *public*.
    
  3. locked and limited conversation to collaborators on Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementProposed change to current functionalitygeneratorIssues binding a Java library (generator, class-parse, etc.)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions