Skip to content

[jnigen] Generate Dart Bindings with Javadoc/KDoc from Kotlin/Java Source #2819

Closed

Description

@YahyaAtta

Problem:
Currently, jnigen generates Dart bindings from Kotlin/Java classes, but it does not include Javadoc or KDoc comments from the source code
Suggestion:
When generating Dart bindings from Kotlin/Java code, jnigen should also extract the Javadoc/KDoc comments from the source files and include them as Dartdoc (///) in the generated Dart code.
Benefits:
Provides fully documented Dart bindings automatically.
Makes it easier for developers to understand and use the API.
For Example For Justing clear Idea:
class Example {
/// Calculate The Sum
fun sum(a:Int , b:Int) : Int {
return a+b
}
}
After Generating Dart Bindings for This Class
When Mouse Indicator The over the function it Show Information About Function as it same in Exists Java/Kotlin Code in IDE Like VSCode or Android Studio
it Show About Tasks of This Function
/// Calculate The Sum
void main(){
Example.sum(2,3) ;
}

Activity

  1. changed the title [-][jnigen] Generating javadoc/KDoc[/-] [+][jnigen] Generate Dart Bindings with Javadoc/KDoc from Kotlin/Java Source[/+] on Nov 24, 2025
  2. HosseinYousefi commented on Nov 24, 2025

    @HosseinYousefi
    Contributor

    We are copying the Javadoc when parsing from Java sources. Javadoc/KDoc are not available in the bytecode (jar) so we're not able to generate those. We could add a link to https://javadoc.io/ instead.

  3. added this to the milestone on Jan 21, 2026
  4. added
    good first issueA good starting issue for contributors (issues with this label will appear in /contribute)
    on Jan 21, 2026
  5. modified the milestones: , JNIgen post-stable on Mar 9, 2026
  6. Siya-05 commented on Jun 11, 2026

    @Siya-05
    Contributor

    Can I work on this if it is still open?

  7. dcharkes commented on Jun 12, 2026

    @dcharkes
    Collaborator

    I don't believe we take Java sources, we use mostly jars. And these don't have java doc. cc @liamappelbe to confirm.

  8. YahyaAtta commented on Aug 3, 2026

    @YahyaAtta
    Author

    I don't believe we take Java sources, we use mostly jars. And these don't have java doc. cc @liamappelbe to confirm.

    You are Right At This Point
    I have Suggestion If it Possible
    System Suggestions read javadoc in html and convert it into Json Format Json Format standards can be read in any language.
    As you say waiting @liamappelbe to confirm

  9. liamappelbe commented on Aug 4, 2026

    @liamappelbe
    Contributor

    @YahyaAtta If I understand correctly, your proposal is:

    1. Locate the javadoc website for a particular API
    2. Download the HTML
    3. Parse it into a JSON format
    4. Consume that format in JNIgen
    5. Generate Dart docs for the APIs

    The effort vs reward ratio on that plan doesn't seem favorable. Also, if javadoc ever changes its HTML format, your parser will break, so there's a maintenance burden there.

    I'd say, skip steps 2-4 and just paste the URL to the javadocs in the Dart docs (ideally a link to the specific method's docs). That's 80% as good for 1% of the effort. It also neatly sidesteps potential copyright issues (tho INAL 🤷).

  10. YahyaAtta commented on Aug 4, 2026

    @YahyaAtta
    Author

    Can I work on this if it is still open?

    Yes You Can Work it still open

  11. YahyaAtta commented on Aug 4, 2026

    @YahyaAtta
    Author

    @YahyaAtta If I understand correctly, your proposal is:

    1. Locate the javadoc website for a particular API
    2. Download the HTML
    3. Parse it into a JSON format
    4. Consume that format in JNIgen
    5. Generate Dart docs for the APIs

    The effort vs reward ratio on that plan doesn't seem favorable. Also, if javadoc ever changes its HTML format, your parser will break, so there's a maintenance burden there.

    I'd say, skip steps 2-4 and just paste the URL to the javadocs in the Dart docs (ideally a link to the specific method's docs). That's 80% as good for 1% of the effort. It also neatly sidesteps potential copyright issues (tho INAL 🤷).

    I agree with your approach. To be honest, I don't have enough experience with this specific(Particular Coding) part yet. I'll leave this open for someone else to take over

  12. Siya-05 commented on Aug 20, 2026

    @Siya-05
    Contributor

    @liamappelbe Would it be okay if I give this a quick patch based on the approach you suggested?

  13. liamappelbe commented on Aug 20, 2026

    @liamappelbe
    Contributor

    Sure, go for it.

  14. liamappelbe commented on Aug 20, 2026

    @liamappelbe
    Contributor

    Btw, it's not true that we only take JARs. I remember there was a plan to remove the source backend, but it looks like it hasn't happened yet. We still have both backends, and both are covered pretty well by integration tests.

    So we only need this URL fallback if there's no javadoc for the method.

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

    good first issueA good starting issue for contributors (issues with this label will appear in /contribute)package:jnipackage:jnigen

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions