Re: [Qbs] Qtc: Cannot find the androiddeploy Json file

2020-05-12 Thread Richard Weickelt

> When i want to "run" on the device:
> Initializing deployment to Android device/simulator
> Deploying to 150c980e8288de07
> Cannot find the androiddeploy Json file.
> Error while building/deploying project Neon Factory Tools (kit:
> Android for arm64-v8a (Clang Qt 5.12.8 for Android ARM64-v8a))
> When executing step "Deploy to Android device"
> 
> I think this happens only when i do cosmetic changes in my qbs files.
> The only way to recover is to trigger a manual build, changing a
> source file is not enough.
> 
> Any idea what's goind on?
> Looks to me this problem is on QtC side.

A quick guess and without ever having built an Android project: The selected
product is the application executable and thus, none of the subsequent rules
is executed. Could that explain it? Have a look at
https://code.qt.io/cgit/qbs/qbs.git/tree/share/qbs/module-providers/Qt/templates/android_support.qbs
There is a rule that produces qt_androiddeployqt_input (the json file) which
I guess is not requested when you press the "run" button. There are also
subsequent rules responsible for the deployment.

You could add one of the rule's output to your product type, although I
guess there is a cleaner way of doing it.

YourAndroidProduct {
type: base.concat("bundled_jar")
}
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


[Qbs] Quick compiler with external library

2020-05-12 Thread Christian Gagneraud
Hi there,

The UI of my app is a separate static library, i would like too use
the quick compiler in release mode, like so:
Depends { name: "Qt"; submodules: "quick" }
Qt.quick.useCompiler: qbs.buildVariant == "release"

The problem is that on Desktop, it doesn't link due to the external
resource having a different name, so as a temporary workaround, i'm
using:
#ifdef NDEBUG
Q_INIT_RESOURCE(navico_ui_qtquickcompiler);
#else
Q_INIT_RESOURCE(navico_ui);
#endif

Not elegant, but will do for now.

But it doesnt work at runtime, i get errors like:
qrc:/navico/ui/TestModuleUiLoader.js:-1 No such file or directory
Same story with android, with the addition of:
E libTestApp.so: "unterminated string"

Not sure if it is related tho.

2 hours later:
I ended up comparing CMake vs Qbs generated cpp, and it turned out
that this is what i need to do with Qbs:
#ifdef NDEBUG
Q_INIT_RESOURCE(navico_ui_qtquickcompiler);
Q_INIT_RESOURCE(navico_ui_qrc_navico_ui_qtquickcompiler);
#else
Q_INIT_RESOURCE(navico_ui);
#endif

With CMake 'Q_INIT_RESOURCE(navico_ui);' works in both cases.

Looks like a bug to me. What do you think?

Chris
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs