Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-138472

Deliver public Java API documentation along with AAR target

    XMLWordPrintable

Details

    Description

      Currently, the AAR files built in the Quick for Android project include .jar files but do not include corresponding source or documentation JARs. As a result:

      • Android Studio cannot display Java/Kotlin documentation for Qt-provided Java classes.
      • Method argument names are not visible in the editor or auto-completion (they show as arg0, arg1, etc.).
      • This limits the development experience and makes integration harder for developers relying on Qt's Java APIs like QtQuickView and all other classes that it references.

      Proposed Solution:

      1. Change AAR Delivery Format
        Deliver the AAR in a local directory that mimics a Maven repository structure. This will allow Android Studio to automatically associate -sources.jar }} with the binary {{.aar and .jar artifacts. Currently, the AAR dependency gets added by QtGP under the hood. QtGP can change the way of AAR inclusion after this change.
      1. Enhance Qt Module Installations
        Modify Qt modules that install .jar files to also support installing the corresponding Java source files, enabling generation of a *-sources.jar. In the scope of Quick for Android, adding qtbase and qtdeclarative Java sources would suffice.
      1. Extend AAR Build Process
        Enhance the AAR build logic to also generate a *-sources.jar alongside the main AAR.

      Optionally, support generation of a *-javadoc.jar if we can also produce JavaDocs from the sources.

      Benefits:

      • Improved developer experience in Android Studio.
      • Better documentation access and usability of Qt’s Java APIs.

      Impact Scope:

      • Affects AAR packaging.
      • Requires changes in the module install logic across Qt to include Java source files or generate Qt6Foobar-sources.jar along with the original .jar file.
      • Might require agreement on source file locations and how to handle them in the build system.

      Attachments

        1. image-2025-07-14-15-37-12-469.png
          44 kB
          Soheil Armin
        2. image-2025-07-14-15-46-22-863.png
          473 kB
          Soheil Armin
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtandroidteam Qt Android Team
            soarmin Soheil Armin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes