forked from qt-creator/qt-creator
QmlProject: Fix skipping some nodes with QDS prefix
This patch also contains the test data and updated test code for the converters to test QDS prefixed version of .qmlproject file. Task-number: QDS-10503 Change-Id: I496ba6f3d4d3cf90e75c2959c4196f4607677ea1 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Aleksei German <aleksei.german@qt.io> (cherry picked from commit d39efd465c93d2c45687f19bf885679f52919ad3) Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
bc1d590482
commit
a8a58c1747
@@ -272,7 +272,7 @@ QJsonObject qmlProjectTojson(const Utils::FilePath &projectFile)
|
|||||||
if (childNode->name().contains("files", Qt::CaseInsensitive)) {
|
if (childNode->name().contains("files", Qt::CaseInsensitive)) {
|
||||||
PropsPair propsPair;
|
PropsPair propsPair;
|
||||||
FileProps fileProps;
|
FileProps fileProps;
|
||||||
const QString childNodeName = childNode->name().toLower();
|
const QString childNodeName = childNode->name().toLower().remove("qds.");
|
||||||
const QmlJS::SimpleReaderNode::Property childNodeFilter = childNode->property("filter");
|
const QmlJS::SimpleReaderNode::Property childNodeFilter = childNode->property("filter");
|
||||||
const QmlJS::SimpleReaderNode::Property childNodeDirectory = childNode->property(
|
const QmlJS::SimpleReaderNode::Property childNodeDirectory = childNode->property(
|
||||||
"directory");
|
"directory");
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
namespace {
|
namespace {
|
||||||
constexpr QLatin1String localTestDataDir{UNITTEST_DIR "/qmlprojectmanager/data"};
|
constexpr QLatin1String localTestDataDir{UNITTEST_DIR "/qmlprojectmanager/data"};
|
||||||
|
|
||||||
class DataSet : public testing::TestWithParam<QString>
|
class QmlProjectConverter : public testing::TestWithParam<QString>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void setDataSource(const QString &dataSetName)
|
void setDataSource(const QString &dataSetName)
|
||||||
@@ -64,10 +64,12 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(QmlProjectItem,
|
INSTANTIATE_TEST_SUITE_P(QmlProjectItem,
|
||||||
DataSet,
|
QmlProjectConverter,
|
||||||
::testing::Values(QString("test-set-1"), QString("test-set-2")));
|
::testing::Values(QString("test-set-1"),
|
||||||
|
QString("test-set-2"),
|
||||||
|
QString("test-set-3")));
|
||||||
|
|
||||||
TEST_P(DataSet, qml_project_to_json)
|
TEST_P(QmlProjectConverter, qml_project_to_json)
|
||||||
{
|
{
|
||||||
// GIVEN
|
// GIVEN
|
||||||
setDataSource(GetParam());
|
setDataSource(GetParam());
|
||||||
@@ -82,7 +84,7 @@ TEST_P(DataSet, qml_project_to_json)
|
|||||||
ASSERT_THAT(convertedContent, Eq(targetContent));
|
ASSERT_THAT(convertedContent, Eq(targetContent));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(DataSet, json_to_qml_project)
|
TEST_P(QmlProjectConverter, json_to_qml_project)
|
||||||
{
|
{
|
||||||
// GIVEN
|
// GIVEN
|
||||||
setDataSource(GetParam());
|
setDataSource(GetParam());
|
||||||
|
@@ -25,6 +25,12 @@ Test functions iterate over the "test-set-*" folders and run the tests by using
|
|||||||
* **purpose**: testing fileselectors
|
* **purpose**: testing fileselectors
|
||||||
* **origin**: file selectors example from playground
|
* **origin**: file selectors example from playground
|
||||||
|
|
||||||
|
### test-set-3
|
||||||
|
|
||||||
|
* **purpose**: testing `QDS.` prefixes
|
||||||
|
* **origin**: copy of test-set-1
|
||||||
|
|
||||||
|
|
||||||
## File Filters test data
|
## File Filters test data
|
||||||
|
|
||||||
Test data contains an example project folders that file filters will be initialized and tested.
|
Test data contains an example project folders that file filters will be initialized and tested.
|
||||||
|
@@ -0,0 +1,98 @@
|
|||||||
|
// prop: json-converted
|
||||||
|
// prop: auto-generated
|
||||||
|
|
||||||
|
import QmlProject
|
||||||
|
|
||||||
|
Project {
|
||||||
|
mainFile: "content/App.qml"
|
||||||
|
mainUiFile: "content/Screen01.ui.qml"
|
||||||
|
targetDirectory: "/opt/UntitledProject13"
|
||||||
|
widgetApp: true
|
||||||
|
importPaths: [ "imports","asset_imports" ]
|
||||||
|
|
||||||
|
qdsVersion: "4.0"
|
||||||
|
quickVersion: "6.2"
|
||||||
|
qt6Project: true
|
||||||
|
qtForMCUs: true
|
||||||
|
|
||||||
|
multilanguageSupport: true
|
||||||
|
primaryLanguage: "en"
|
||||||
|
supportedLanguages: [ "en" ]
|
||||||
|
|
||||||
|
Environment {
|
||||||
|
QML_COMPAT_RESOLVE_URLS_ON_ASSIGNMENT: "1"
|
||||||
|
QT_AUTO_SCREEN_SCALE_FACTOR: "1"
|
||||||
|
QT_ENABLE_HIGHDPI_SCALING: "0"
|
||||||
|
QT_LOGGING_RULES: "qt.qml.connections=false"
|
||||||
|
QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf"
|
||||||
|
}
|
||||||
|
|
||||||
|
ShaderTool {
|
||||||
|
args: "-s --glsl \"100 es,120,150\" --hlsl 50 --msl 12"
|
||||||
|
files: [ "content/shaders/*" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlFiles {
|
||||||
|
directory: "content"
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlFiles {
|
||||||
|
directory: "imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlFiles {
|
||||||
|
directory: "asset_imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
JavaScriptFiles {
|
||||||
|
directory: "content"
|
||||||
|
}
|
||||||
|
|
||||||
|
JavaScriptFiles {
|
||||||
|
directory: "imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageFiles {
|
||||||
|
directory: "content"
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageFiles {
|
||||||
|
directory: "asset_imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
Files {
|
||||||
|
directory: "."
|
||||||
|
filters: "*.conf"
|
||||||
|
files: [ "qtquickcontrols2.conf" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
Files {
|
||||||
|
directory: "."
|
||||||
|
filters: "*.ttf;*.otf;*.ctf"
|
||||||
|
}
|
||||||
|
|
||||||
|
Files {
|
||||||
|
directory: "asset_imports"
|
||||||
|
filters: "*.mesh"
|
||||||
|
}
|
||||||
|
|
||||||
|
Files {
|
||||||
|
directory: "."
|
||||||
|
filters: "qmldir"
|
||||||
|
}
|
||||||
|
|
||||||
|
Files {
|
||||||
|
directory: "."
|
||||||
|
filters: "*.glsl;*.glslv;*.glslf;*.vsh;*.fsh;*.vert;*.frag;*.trag"
|
||||||
|
}
|
||||||
|
|
||||||
|
Files {
|
||||||
|
directory: "."
|
||||||
|
filters: "*.mp3;*.wav"
|
||||||
|
}
|
||||||
|
|
||||||
|
Files {
|
||||||
|
directory: "."
|
||||||
|
filters: "*.mp4"
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,112 @@
|
|||||||
|
import QmlProject
|
||||||
|
|
||||||
|
Project {
|
||||||
|
QDS.mainFile: "content/App.qml"
|
||||||
|
QDS.mainUiFile: "content/Screen01.ui.qml"
|
||||||
|
|
||||||
|
/* Include .qml, .js, and image files from current directory and subdirectories */
|
||||||
|
QDS.QmlFiles {
|
||||||
|
directory: "content"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.QmlFiles {
|
||||||
|
directory: "imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.JavaScriptFiles {
|
||||||
|
directory: "content"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.JavaScriptFiles {
|
||||||
|
directory: "imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.ImageFiles {
|
||||||
|
directory: "content"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.ImageFiles {
|
||||||
|
directory: "asset_imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Files {
|
||||||
|
filter: "*.conf"
|
||||||
|
files: ["qtquickcontrols2.conf"]
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Files {
|
||||||
|
filter: "qmldir"
|
||||||
|
directory: "."
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Files {
|
||||||
|
filter: "*.ttf;*.otf;*.ctf"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Files {
|
||||||
|
filter: "*.wav;*.mp3"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Files {
|
||||||
|
filter: "*.mp4"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Files {
|
||||||
|
filter: "*.glsl;*.glslv;*.glslf;*.vsh;*.fsh;*.vert;*.frag;*.trag"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Files {
|
||||||
|
filter: "*.mesh"
|
||||||
|
directory: "asset_imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Files {
|
||||||
|
filter: "*.qml"
|
||||||
|
directory: "asset_imports"
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.Environment {
|
||||||
|
QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf"
|
||||||
|
QT_AUTO_SCREEN_SCALE_FACTOR: "1"
|
||||||
|
QML_COMPAT_RESOLVE_URLS_ON_ASSIGNMENT: "1"
|
||||||
|
QT_LOGGING_RULES: "qt.qml.connections=false"
|
||||||
|
QT_ENABLE_HIGHDPI_SCALING: "0"
|
||||||
|
/* Useful for debugging
|
||||||
|
QSG_VISUALIZE=batches
|
||||||
|
QSG_VISUALIZE=clip
|
||||||
|
QSG_VISUALIZE=changes
|
||||||
|
QSG_VISUALIZE=overdraw
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.qt6Project: true
|
||||||
|
|
||||||
|
/* List of plugin directories passed to QML runtime */
|
||||||
|
QDS.importPaths: [ "imports", "asset_imports" ]
|
||||||
|
|
||||||
|
/* Required for deployment */
|
||||||
|
QDS.targetDirectory: "/opt/UntitledProject13"
|
||||||
|
|
||||||
|
QDS.qdsVersion: "4.0"
|
||||||
|
|
||||||
|
QDS.quickVersion: "6.2"
|
||||||
|
|
||||||
|
QDS.qtForMCUs: true
|
||||||
|
|
||||||
|
/* If any modules the project imports require widgets (e.g. QtCharts), widgetApp must be true */
|
||||||
|
QDS.widgetApp: true
|
||||||
|
|
||||||
|
/* args: Specifies command line arguments for qsb tool to generate shaders.
|
||||||
|
files: Specifies target files for qsb tool. If path is included, it must be relative to this file.
|
||||||
|
Wildcard '*' can be used in the file name part of the path.
|
||||||
|
e.g. files: [ "content/shaders/*.vert", "*.frag" ] */
|
||||||
|
QDS.ShaderTool {
|
||||||
|
args: "-s --glsl \"100 es,120,150\" --hlsl 50 --msl 12"
|
||||||
|
files: [ "content/shaders/*" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
QDS.multilanguageSupport: true
|
||||||
|
QDS.supportedLanguages: ["en"]
|
||||||
|
QDS.primaryLanguage: "en"
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,178 @@
|
|||||||
|
{
|
||||||
|
"deployment": {
|
||||||
|
"targetDirectory": "/opt/UntitledProject13"
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"QML_COMPAT_RESOLVE_URLS_ON_ASSIGNMENT": "1",
|
||||||
|
"QT_AUTO_SCREEN_SCALE_FACTOR": "1",
|
||||||
|
"QT_ENABLE_HIGHDPI_SCALING": "0",
|
||||||
|
"QT_LOGGING_RULES": "qt.qml.connections=false",
|
||||||
|
"QT_QUICK_CONTROLS_CONF": "qtquickcontrols2.conf"
|
||||||
|
},
|
||||||
|
"fileGroups": {
|
||||||
|
"config": {
|
||||||
|
"directories": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"name": "qtquickcontrols2.conf"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.conf"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"font": {
|
||||||
|
"directories": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.ttf",
|
||||||
|
"*.otf",
|
||||||
|
"*.ctf"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"image": {
|
||||||
|
"directories": [
|
||||||
|
"content",
|
||||||
|
"asset_imports"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.jpeg",
|
||||||
|
"*.jpg",
|
||||||
|
"*.png",
|
||||||
|
"*.svg",
|
||||||
|
"*.hdr",
|
||||||
|
".ktx"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"javaScript": {
|
||||||
|
"directories": [
|
||||||
|
"content",
|
||||||
|
"imports"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.js",
|
||||||
|
"*.ts"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meshes": {
|
||||||
|
"directories": [
|
||||||
|
"asset_imports"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.mesh"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"qml": {
|
||||||
|
"directories": [
|
||||||
|
"content",
|
||||||
|
"imports",
|
||||||
|
"asset_imports"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.qml"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"qmldir": {
|
||||||
|
"directories": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"qmldir"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"shader": {
|
||||||
|
"directories": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.glsl",
|
||||||
|
"*.glslv",
|
||||||
|
"*.glslf",
|
||||||
|
"*.vsh",
|
||||||
|
"*.fsh",
|
||||||
|
"*.vert",
|
||||||
|
"*.frag",
|
||||||
|
"*.trag"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sound": {
|
||||||
|
"directories": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.mp3",
|
||||||
|
"*.wav"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"video": {
|
||||||
|
"directories": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
"*.mp4"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fileVersion": 1,
|
||||||
|
"importPaths": [
|
||||||
|
"imports",
|
||||||
|
"asset_imports"
|
||||||
|
],
|
||||||
|
"language": {
|
||||||
|
"multiLanguageSupport": true,
|
||||||
|
"primaryLanguage": "en",
|
||||||
|
"supportedLanguages": [
|
||||||
|
"en"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mcuConfig": {
|
||||||
|
"mcuEnabled": true
|
||||||
|
},
|
||||||
|
"runConfig": {
|
||||||
|
"fileSelectors": [
|
||||||
|
],
|
||||||
|
"mainFile": "content/App.qml",
|
||||||
|
"mainUiFile": "content/Screen01.ui.qml",
|
||||||
|
"widgetApp": true
|
||||||
|
},
|
||||||
|
"shaderTool": {
|
||||||
|
"args": [
|
||||||
|
"-s",
|
||||||
|
"--glsl",
|
||||||
|
"\"100 es,120,150\"",
|
||||||
|
"--hlsl",
|
||||||
|
"50",
|
||||||
|
"--msl",
|
||||||
|
"12"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"content/shaders/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"versions": {
|
||||||
|
"designStudio": "4.0",
|
||||||
|
"qt": "6",
|
||||||
|
"qtQuick": "6.2"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user