Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
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:
- 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.
- 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.
- 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.