Android: scan for qml files in the source dir, not in the install dir.
ClosedPublic

Authored by dfaure on Jul 2 2017, 8:29 AM.

Details

Summary

When the QML files are all bundled into a .qrc file, they don't get
copied to the install dir, which would lead to qmlimportscanner not picking
up the dependencies (e.g. QtQuick Controls) for android packaging.

Looking at commit 1b0496d, I wonder if maybe we should be able to specify
two paths to look into? But qmlimportscanner doesn't support that, does it?

Test Plan

using this toolchain for a basic QtQuick2 app created from a
QtCreator template, with Qt Quick Controls support, and QML files
in a Qt resource.

Diff Detail

Repository
R240 Extra CMake Modules
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dfaure created this revision.Jul 2 2017, 8:29 AM
Restricted Application added projects: Frameworks, Build System. · View Herald TranscriptJul 2 2017, 8:29 AM
apol requested changes to this revision.Jul 2 2017, 11:18 PM

This will be problematic as soon as your application depends on any libraries.
So far we've worked with the assumption that you'd install the applications into a prefix then ran androiddeployqt over this file.

This revision now requires changes to proceed.Jul 2 2017, 11:18 PM
dfaure added a comment.Jul 6 2017, 7:57 PM
In D6466#121152, @apol wrote:

This will be problematic as soon as your application depends on any libraries.

You mean, libraries which themselves have installed QML files, right? Depending on e.g. ki18n is no problem.

But yeah I can see how this would be a problem for something that depends on kirigami for instance.

If we can't find a better solution, then at least it should be documented in the ECM android stuff to NOT put qml files into a .qrc...

So far we've worked with the assumption that you'd install the applications into a prefix then ran androiddeployqt over this file.

Well, that's exactly what I was doing... but if the QML files are built into a .qrc rather than installed, then this fails.

(The assumption also requires that the install prefix is only used for one android app only, otherwise it would all get mixed up)

apol accepted this revision.Jul 7 2017, 1:11 PM
In D6466#121152, @apol wrote:

This will be problematic as soon as your application depends on any libraries.

You mean, libraries which themselves have installed QML files, right? Depending on e.g. ki18n is no problem.

But yeah I can see how this would be a problem for something that depends on kirigami for instance.

If we can't find a better solution, then at least it should be documented in the ECM android stuff to NOT put qml files into a .qrc...

Yes, that's what I meant.

So far we've worked with the assumption that you'd install the applications into a prefix then ran androiddeployqt over this file.

Well, that's exactly what I was doing... but if the QML files are built into a .qrc rather than installed, then this fails.

Yes, I understand your problem.

(The assumption also requires that the install prefix is only used for one android app only, otherwise it would all get mixed up)

Yes.

I've been thinking it through, I agree that the qrc use-case should be properly supported. Let's get this one in and if something's missing we can fix it in androiddeployqt.

This revision is now accepted and ready to land.Jul 7 2017, 1:11 PM
This revision was automatically updated to reflect the committed changes.