Android: Rename opt-in CMake flag that generates QML to Java code

The Java QtQmlComponent has been renamed to QtQuickViewContent
as a part of API reviews.
As a result, we also change the opt-in flag
From QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
To QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
that adds an entry to the android-deployment-settings.json.
The flags later will be used by androiddeployqt to enable the
generation of QtQuickViewContent extensions.

Pick-to: 6.8
Task-number: QTBUG-126976
Task-number: QTBUG-127091
Change-Id: Ie08a9430a5e5a16809f78389144a4a6dfd87ce18
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
This commit is contained in:
Soheil Armin 2024-07-22 15:02:00 +03:00
parent 86e34dfcdd
commit be2c03064c
3 changed files with 14 additions and 14 deletions

View File

@ -300,13 +300,13 @@ function(qt6_android_generate_deployment_settings target)
string(APPEND file_contents
" \"zstdCompression\": ${is_zstd_enabled},\n")
if(QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS)
set(is_generate_java_qml_components "true")
if(QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS)
set(is_generate_java_qtquickview_contents "true")
else()
set(is_generate_java_qml_components "false")
set(is_generate_java_qtquickview_contents "false")
endif()
string(APPEND file_contents
" \"generate-java-qml-components\": ${is_generate_java_qml_components},\n")
" \"generate-java-qtquickview-contents\": ${is_generate_java_qtquickview_contents},\n")
# Last item in json file
# base location of stdlibc++, will be suffixed by androiddeploy qt

View File

@ -322,10 +322,10 @@ The mentioned variables are used internally by \l{androiddeployqt}.
\ingroup cmake-variables-qtcore
\ingroup cmake-android-build-properties
\title QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
\target cmake-variable-QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
\title QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
\target cmake-variable-QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
\summary {Enables the generation of QtQmlComponent-based classes.}
\summary {Enables the generation of QtQuickViewContent-based classes.}
\cmakevariablesince 6.8
\preliminarycmakevariable
\cmakevariableandroidonly
@ -335,8 +335,8 @@ generated code will be included in the resulting package. The Java package name
classes will be the same as the Android app package. If the leaf part of the package name is
not the same as the target executable, an extra static class with the same name as the
capitalized target executable will surround all QML modules enclosing Java classes. Each QML
module class, again in a capitalized form, will contain QtQmlComponent extension classes that
represent QML components of that module.
module class, again in a capitalized form, will contain QtQuickViewContent extension classes
that represent QML components of that module.
*/
\sa{androiddeployqt}

View File

@ -1302,13 +1302,13 @@ bool readInputFile(Options *options)
}
{
const QJsonValue genJavaQmlComponents = jsonObject.value("generate-java-qml-components"_L1);
const QJsonValue genJavaQmlComponents = jsonObject.value("generate-java-qtquickview-contents"_L1);
if (!genJavaQmlComponents.isUndefined() && genJavaQmlComponents.isBool()) {
options->generateJavaQmlComponents = genJavaQmlComponents.toBool(false);
if (options->generateJavaQmlComponents && !options->buildAar) {
fprintf(stderr,
"Warning: Skipping the generation of Java components from QML as it can be "
"enabled only for an AAR target.\n");
"Warning: Skipping the generation of Java QtQuickView contents from QML "
"as it can be enabled only for an AAR target.\n");
options->generateJavaQmlComponents = false;
}
}
@ -1321,7 +1321,7 @@ bool readInputFile(Options *options)
} else if (options->generateJavaQmlComponents) {
fprintf(stderr,
"No qmldom binary defined in json file which is required when "
"building with QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS flag.\n");
"building with QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS flag.\n");
return false;
}
}
@ -3708,7 +3708,7 @@ int generateJavaQmlComponents(const Options &options)
if (moduleInfo.moduleName == libName) {
fprintf(stderr,
"A QML module name (%s) cannot be the same as the target name when building "
"with QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS flag.\n",
"with QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS flag.\n",
qPrintable(moduleInfo.moduleName));
return false;
}