mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-07 23:19:35 +00:00
Merge branch 'v1.4' into v1.5
This commit is contained in:
commit
1a574f6175
@ -652,15 +652,16 @@ QSet<QString> ConfigParser::getQtPathesFromTargets() {
|
||||
return res;
|
||||
}
|
||||
|
||||
bool ConfigParser::isNeededQt() const {
|
||||
QtMajorVersion ConfigParser::isNeededQt() const {
|
||||
|
||||
auto Qt = QtMajorVersion::NoQt;
|
||||
for (const auto &i: _config.targets()) {
|
||||
if (i.isValid() && i.isDependetOfQt()) {
|
||||
return true;
|
||||
if (i.isValid()) {
|
||||
Qt = Qt | i.isDependetOfQt();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return Qt;
|
||||
}
|
||||
|
||||
void ConfigParser::setTargetDir(const QString &target) {
|
||||
@ -955,7 +956,6 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {
|
||||
bool ConfigParser::initQmake() {
|
||||
|
||||
|
||||
|
||||
if (!isNeededQt()) {
|
||||
QuasarAppUtils::Params::log("deploy only C/C++ libraryes because a qmake is not needed"
|
||||
" for the distribution",
|
||||
@ -1063,6 +1063,9 @@ bool ConfigParser::setQmake(const QString &value) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_config.qtDir.setQtVersion(isNeededQt());
|
||||
|
||||
_config.envirement.addEnv(_config.qtDir.getLibs());
|
||||
_config.envirement.addEnv(_config.qtDir.getBins());
|
||||
|
||||
@ -1127,6 +1130,8 @@ bool ConfigParser::setQtDir(const QString &value) {
|
||||
_config.qtDir.setQtPlatform(Platform::Win);
|
||||
#endif
|
||||
|
||||
_config.qtDir.setQtVersion(isNeededQt());
|
||||
|
||||
_config.envirement.addEnv(_config.qtDir.getLibs());
|
||||
_config.envirement.addEnv(_config.qtDir.getBins());
|
||||
|
||||
|
@ -82,6 +82,10 @@ private:
|
||||
|
||||
void initEnvirement();
|
||||
|
||||
/**
|
||||
* @brief checkSnapPermisions This method checks the required permissions. Of all the permissions granted, this method returns true, otherwise false.
|
||||
* @return
|
||||
*/
|
||||
bool checkSnapPermisions();
|
||||
|
||||
QStringList getDirsRecursive(const QString &path, int maxDepch = -1, int depch = 0);
|
||||
@ -102,7 +106,7 @@ private:
|
||||
|
||||
QList<iDistribution *> getDistribution();
|
||||
|
||||
bool isNeededQt() const;
|
||||
QtMajorVersion isNeededQt() const;
|
||||
};
|
||||
|
||||
#endif // CQT_H
|
||||
|
@ -26,64 +26,66 @@
|
||||
const DeployConfig* DeployCore::_config = nullptr;
|
||||
|
||||
QtModuleEntry DeployCore::qtModuleEntries[] = {
|
||||
{ QtBluetoothModule, "bluetooth", "Qt5Bluetooth", nullptr },
|
||||
{ QtConcurrentModule, "concurrent", "Qt5Concurrent", "qtbase" },
|
||||
{ QtCoreModule, "core", "Qt5Core", "qtbase" },
|
||||
{ QtDeclarativeModule, "declarative", "Qt5Declarative", "qtquick1" },
|
||||
{ QtDesignerModule, "designer", "Qt5Designer", nullptr },
|
||||
{ QtDesignerComponents, "designercomponents", "Qt5DesignerComponents", nullptr },
|
||||
{ QtBluetoothModule, "bluetooth", "Bluetooth", nullptr },
|
||||
{ QtConcurrentModule, "concurrent", "Concurrent", "qtbase" },
|
||||
{ QtCoreModule, "core", "Core", "qtbase" },
|
||||
{ QtDeclarativeModule, "declarative", "Declarative", "qtquick1" },
|
||||
{ QtDesignerModule, "designer", "Designer", nullptr },
|
||||
{ QtDesignerComponents, "designercomponents", "DesignerComponents", nullptr },
|
||||
{ QtEnginioModule, "enginio", "Enginio", nullptr },
|
||||
{ QtGamePadModule, "gamepad", "Qt5Gamepad", nullptr },
|
||||
{ QtGuiModule, "gui", "Qt5Gui", "qtbase" },
|
||||
{ QtHelpModule, "qthelp", "Qt5Help", "qt_help" },
|
||||
{ QtMultimediaModule, "multimedia", "Qt5Multimedia", "qtmultimedia" },
|
||||
{ QtMultimediaWidgetsModule, "multimediawidgets", "Qt5MultimediaWidgets", "qtmultimedia" },
|
||||
{ QtMultimediaQuickModule, "multimediaquick", "Qt5MultimediaQuick_p", "qtmultimedia" },
|
||||
{ QtNetworkModule, "network", "Qt5Network", "qtbase" },
|
||||
{ QtNfcModule, "nfc", "Qt5Nfc", nullptr },
|
||||
{ QtOpenGLModule, "opengl", "Qt5OpenGL", nullptr },
|
||||
{ QtPositioningModule, "positioning", "Qt5Positioning", nullptr },
|
||||
{ QtPrintSupportModule, "printsupport", "Qt5PrintSupport", nullptr },
|
||||
{ QtQmlModule, "qml", "Qt5Qml", "qtdeclarative" },
|
||||
{ QtGamePadModule, "gamepad", "Gamepad", nullptr },
|
||||
{ QtGuiModule, "gui", "Gui", "qtbase" },
|
||||
{ QtHelpModule, "qthelp", "Help", "qt_help" },
|
||||
{ QtMultimediaModule, "multimedia", "Multimedia", "qtmultimedia" },
|
||||
{ QtMultimediaWidgetsModule, "multimediawidgets", "MultimediaWidgets", "qtmultimedia" },
|
||||
{ QtMultimediaQuickModule, "multimediaquick", "MultimediaQuick_p", "qtmultimedia" },
|
||||
{ QtNetworkModule, "network", "Network", "qtbase" },
|
||||
{ QtNfcModule, "nfc", "Nfc", nullptr },
|
||||
{ QtOpenGLModule, "opengl", "OpenGL", nullptr },
|
||||
{ QtOpenGLWidgetsModule, "openglwidgets", "OpenGLWidgets", nullptr },
|
||||
{ QtPositioningModule, "positioning", "Positioning", nullptr },
|
||||
{ QtPrintSupportModule, "printsupport", "PrintSupport", nullptr },
|
||||
{ QtQmlModule, "qml", "Qml", "qtdeclarative" },
|
||||
{ QtQmlToolingModule, "qmltooling", "qmltooling", nullptr },
|
||||
{ QtQuickModule, "quick", "Qt5Quick", "qtdeclarative" },
|
||||
{ QtQuickParticlesModule, "quickparticles", "Qt5QuickParticles", nullptr },
|
||||
{ QtQuickWidgetsModule, "quickwidgets", "Qt5QuickWidgets", nullptr },
|
||||
{ QtScriptModule, "script", "Qt5Script", "qtscript" },
|
||||
{ QtScriptToolsModule, "scripttools", "Qt5ScriptTools", "qtscript" },
|
||||
{ QtSensorsModule, "sensors", "Qt5Sensors", nullptr },
|
||||
{ QtSerialPortModule, "serialport", "Qt5SerialPort", "qtserialport" },
|
||||
{ QtSqlModule, "sql", "Qt5Sql", "qtbase" },
|
||||
{ QtSvgModule, "svg", "Qt5Svg", nullptr },
|
||||
{ QtTestModule, "test", "Qt5Test", "qtbase" },
|
||||
{ QtWebKitModule, "webkit", "Qt5WebKit", nullptr },
|
||||
{ QtWebKitWidgetsModule, "webkitwidgets", "Qt5WebKitWidgets", nullptr },
|
||||
{ QtWebSocketsModule, "websockets", "Qt5WebSockets", nullptr },
|
||||
{ QtWidgetsModule, "widgets", "Qt5Widgets", "qtbase" },
|
||||
{ QtWinExtrasModule, "winextras", "Qt5WinExtras", nullptr },
|
||||
{ QtXmlModule, "xml", "Qt5Xml", "qtbase" },
|
||||
{ QtXmlPatternsModule, "xmlpatterns", "Qt5XmlPatterns", "qtxmlpatterns" },
|
||||
{ QtWebEngineCoreModule, "webenginecore", "Qt5WebEngineCore", nullptr },
|
||||
{ QtWebEngineModule, "webengine", "Qt5WebEngine", "qtwebengine" },
|
||||
{ QtWebEngineWidgetsModule, "webenginewidgets", "Qt5WebEngineWidgets", nullptr },
|
||||
{ Qt3DCoreModule, "3dcore", "Qt53DCore", nullptr },
|
||||
{ Qt3DRendererModule, "3drenderer", "Qt53DRender", nullptr },
|
||||
{ Qt3DQuickModule, "3dquick", "Qt53DQuick", nullptr },
|
||||
{ Qt3DQuickRendererModule, "3dquickrenderer", "Qt53DQuickRender", nullptr },
|
||||
{ Qt3DInputModule, "3dinput", "Qt53DInput", nullptr },
|
||||
{ Qt3DAnimationModule, "3danimation", "Qt53DAnimation", nullptr },
|
||||
{ Qt3DExtrasModule, "3dextras", "Qt53DExtras", nullptr },
|
||||
{ QtLocationModule, "geoservices", "Qt5Location", nullptr },
|
||||
{ QtWebChannelModule, "webchannel", "Qt5WebChannel", nullptr },
|
||||
{ QtTextToSpeechModule, "texttospeech", "Qt5TextToSpeech", nullptr },
|
||||
{ QtSerialBusModule, "serialbus", "Qt5SerialBus", nullptr },
|
||||
{ QtWebViewModule, "webview", "Qt5WebView", nullptr }
|
||||
{ QtQuickModule, "quick", "Quick", "qtdeclarative" },
|
||||
{ QtQuickParticlesModule, "quickparticles", "QuickParticles", nullptr },
|
||||
{ QtQuickWidgetsModule, "quickwidgets", "QuickWidgets", nullptr },
|
||||
{ QtScriptModule, "script", "Script", "qtscript" },
|
||||
{ QtScriptToolsModule, "scripttools", "ScriptTools", "qtscript" },
|
||||
{ QtSensorsModule, "sensors", "Sensors", nullptr },
|
||||
{ QtSerialPortModule, "serialport", "SerialPort", "qtserialport" },
|
||||
{ QtSqlModule, "sql", "Sql", "qtbase" },
|
||||
{ QtSvgWidgetsModule, "svgwidgets", "SvgWidgets", nullptr },
|
||||
{ QtSvgModule, "svg", "Svg", nullptr },
|
||||
{ QtTestModule, "test", "Test", "qtbase" },
|
||||
{ QtWebKitModule, "webkit", "WebKit", nullptr },
|
||||
{ QtWebKitWidgetsModule, "webkitwidgets", "WebKitWidgets", nullptr },
|
||||
{ QtWebSocketsModule, "websockets", "WebSockets", nullptr },
|
||||
{ QtWidgetsModule, "widgets", "Widgets", "qtbase" },
|
||||
{ QtWinExtrasModule, "winextras", "WinExtras", nullptr },
|
||||
{ QtXmlModule, "xml", "Xml", "qtbase" },
|
||||
{ QtXmlPatternsModule, "xmlpatterns", "XmlPatterns", "qtxmlpatterns" },
|
||||
{ QtWebEngineCoreModule, "webenginecore", "WebEngineCore", nullptr },
|
||||
{ QtWebEngineModule, "webengine", "WebEngine", "qtwebengine" },
|
||||
{ QtWebEngineWidgetsModule, "webenginewidgets", "WebEngineWidgets", nullptr },
|
||||
{ Qt3DCoreModule, "3dcore", "3DCore", nullptr },
|
||||
{ Qt3DRendererModule, "3drenderer", "3DRender", nullptr },
|
||||
{ Qt3DQuickModule, "3dquick", "3DQuick", nullptr },
|
||||
{ Qt3DQuickRendererModule, "3dquickrenderer", "3DQuickRender", nullptr },
|
||||
{ Qt3DInputModule, "3dinput", "3DInput", nullptr },
|
||||
{ Qt3DAnimationModule, "3danimation", "3DAnimation", nullptr },
|
||||
{ Qt3DExtrasModule, "3dextras", "3DExtras", nullptr },
|
||||
{ QtLocationModule, "geoservices", "Location", nullptr },
|
||||
{ QtWebChannelModule, "webchannel", "WebChannel", nullptr },
|
||||
{ QtTextToSpeechModule, "texttospeech", "TextToSpeech", nullptr },
|
||||
{ QtSerialBusModule, "serialbus", "SerialBus", nullptr },
|
||||
{ QtWebViewModule, "webview", "WebView", nullptr }
|
||||
};
|
||||
|
||||
DeployCore::QtModule DeployCore::getQtModule(const QString& path) {
|
||||
auto priority = DeployCore::getLibPriority(path);
|
||||
auto Qt = DeployCore::isQtLib(path);
|
||||
|
||||
if (priority != QtLib) {
|
||||
if (!Qt) {
|
||||
return DeployCore::QtModule::NONE;
|
||||
}
|
||||
|
||||
@ -406,6 +408,21 @@ QString DeployCore::findProcess(const QString &env, const QString& proc) {
|
||||
return "";
|
||||
}
|
||||
|
||||
QStringList DeployCore::debugExtensions() {
|
||||
return {".debug", "d.dll", ".pdb"};
|
||||
}
|
||||
|
||||
bool DeployCore::isDebugFile(const QString &file) {
|
||||
auto debug = debugExtensions();
|
||||
for (const auto& debugEx: debug) {
|
||||
if (file.contains(debugEx, ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int DeployCore::find(const QString &str, const QStringList &list) {
|
||||
for (int i = 0 ; i < list.size(); ++i) {
|
||||
if (list[i].contains(str))
|
||||
@ -519,21 +536,34 @@ QString DeployCore::getMSVCVersion(MSVCVersion msvc) {
|
||||
return "";
|
||||
}
|
||||
|
||||
bool DeployCore::isQtLib(const QString &lib) {
|
||||
QtMajorVersion DeployCore::isQtLib(const QString &lib) {
|
||||
QFileInfo info(lib);
|
||||
/*
|
||||
* Task https://github.com/QuasarApp/CQtDeployer/issues/422
|
||||
* All qt libs need to contains the Qt label.
|
||||
*/
|
||||
bool isQt = isLib(info) && info.fileName().contains("Qt", ONLY_WIN_CASE_INSENSIATIVE);
|
||||
QtMajorVersion isQt = QtMajorVersion::NoQt;
|
||||
|
||||
if (_config) {
|
||||
isQt = isQt && _config->qtDir.isQt(info.absoluteFilePath());
|
||||
if (!isLib(info)) {
|
||||
return isQt;
|
||||
}
|
||||
|
||||
QString fileName = info.fileName();
|
||||
if (fileName.contains("Qt4", ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
isQt = QtMajorVersion::Qt4;
|
||||
} else if (fileName.contains("Qt5", ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
isQt = QtMajorVersion::Qt5;
|
||||
} else if (fileName.contains("Qt6", ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
isQt = QtMajorVersion::Qt6;
|
||||
}
|
||||
|
||||
if (_config && !_config->qtDir.isQt(info.absoluteFilePath())) {
|
||||
return QtMajorVersion::NoQt;
|
||||
}
|
||||
|
||||
if (isQt && QuasarAppUtils::Params::isEndable("noQt") &&
|
||||
!QuasarAppUtils::Params::isEndable("qmake")) {
|
||||
return false;
|
||||
return QtMajorVersion::NoQt;
|
||||
}
|
||||
|
||||
return isQt;
|
||||
|
@ -24,6 +24,16 @@ enum MSVCVersion: int {
|
||||
MSVC_19 = 0x80,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The QtMajorVersion enum
|
||||
*/
|
||||
enum QtMajorVersion: int {
|
||||
NoQt = 0x0,
|
||||
Qt4 = 0x01,
|
||||
Qt5 = 0x02,
|
||||
Qt6 = 0x04
|
||||
};
|
||||
|
||||
struct DEPLOYSHARED_EXPORT QtModuleEntry {
|
||||
quint64 module;
|
||||
const char *option;
|
||||
@ -166,19 +176,23 @@ public:
|
||||
QtGamePadModule = 0x0001000000000000,
|
||||
Qt3DAnimationModule = 0x0002000000000000,
|
||||
QtWebViewModule = 0x0004000000000000,
|
||||
Qt3DExtrasModule = 0x0008000000000000
|
||||
Qt3DExtrasModule = 0x0008000000000000,
|
||||
// Qt6
|
||||
QtOpenGLWidgetsModule = 0x0010000000000000,
|
||||
QtSvgWidgetsModule = 0x0020000000000000
|
||||
};
|
||||
|
||||
DeployCore() = delete;
|
||||
|
||||
|
||||
static QtModuleEntry qtModuleEntries[];
|
||||
|
||||
static const DeployConfig * _config;
|
||||
|
||||
static MSVCVersion getMSVC(const QString & _qtBin);
|
||||
static QString getVCredist(const QString & _qtBin);
|
||||
|
||||
static bool isQtLib(const QString &lib);
|
||||
static QtMajorVersion isQtLib(const QString &lib);
|
||||
static bool isExtraLib(const QString &lib);
|
||||
static QChar getSeparator(int lvl);
|
||||
static bool isAlienLib(const QString &lib);
|
||||
@ -222,6 +236,8 @@ public:
|
||||
int lastLvl = 2);
|
||||
static QString findProcess(const QString& env, const QString& proc);
|
||||
|
||||
static QStringList debugExtensions();
|
||||
static bool isDebugFile(const QString& file);
|
||||
|
||||
static bool isSnap();
|
||||
static QString snapRootFS();
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
bool Extracter::deployMSVC() {
|
||||
QuasarAppUtils::Params::log("try deploy msvc",
|
||||
QuasarAppUtils::Info);
|
||||
QuasarAppUtils::Info);
|
||||
auto msvcInstaller = DeployCore::getVCredist(DeployCore::_config->qtDir.getBins());
|
||||
|
||||
if (msvcInstaller.isEmpty()) {
|
||||
@ -89,8 +89,8 @@ QList<QString> Extracter::angleGLLibs() {
|
||||
if (cnf->qtDir.getQtPlatform() & Platform::Win) {
|
||||
return {
|
||||
cnf->qtDir.getBins() + "/d3dcompiler_47.dll",
|
||||
cnf->qtDir.getBins() + "/libEGL.dll",
|
||||
cnf->qtDir.getBins() + "/libGLESv2.dll",
|
||||
cnf->qtDir.getBins() + "/libEGL.dll",
|
||||
cnf->qtDir.getBins() + "/libGLESv2.dll",
|
||||
};
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ void Extracter::clear() {
|
||||
if (QuasarAppUtils::Params::isEndable("clear") ||
|
||||
QuasarAppUtils::Params::isEndable("force-clear")) {
|
||||
QuasarAppUtils::Params::log("clear old data",
|
||||
QuasarAppUtils::Info);
|
||||
QuasarAppUtils::Info);
|
||||
_fileManager->clear(DeployCore::_config->getTargetDir(),
|
||||
QuasarAppUtils::Params::isEndable("force-clear"));
|
||||
}
|
||||
@ -134,7 +134,7 @@ void Extracter::copyExtraPlugins(const QString& package) {
|
||||
|
||||
if (info.isFile()) {
|
||||
if (!_fileManager->copyFile(info.absoluteFilePath(),
|
||||
targetPath + distro.getPluginsOutDir())) {
|
||||
targetPath + distro.getPluginsOutDir())) {
|
||||
|
||||
QuasarAppUtils::Params::log("fail to copy extra plugin from:" + info.absoluteFilePath() +
|
||||
" to: " + targetPath + distro.getPluginsOutDir(),
|
||||
@ -149,7 +149,7 @@ void Extracter::copyExtraPlugins(const QString& package) {
|
||||
QStringList plugins;
|
||||
if (!_fileManager->copyFolder(info.absoluteFilePath(),
|
||||
targetPath + distro.getPluginsOutDir() + info.fileName(),
|
||||
QStringList() << ".so.debug" << "d.dll" << ".pdb" << ".dll.debug",
|
||||
DeployCore::debugExtensions(),
|
||||
&plugins)) {
|
||||
|
||||
QuasarAppUtils::Params::log("fail to copy extra plugin from:" + info.absoluteFilePath() +
|
||||
@ -179,7 +179,7 @@ void Extracter::extractPlugins() {
|
||||
_pluginsParser->scan(cnf->qtDir.getPlugins(), plugins, _packageDependencyes[i.key()].qtModules(), i.key());
|
||||
|
||||
_fileManager->copyFiles(plugins, targetPath + distro.getPluginsOutDir(), 1,
|
||||
QStringList() << ".so.debug" << "d.dll" << ".pdb" << ".dll.debug", &listItems);
|
||||
DeployCore::debugExtensions(), &listItems);
|
||||
|
||||
for (const auto &item : listItems) {
|
||||
extractPluginLib(item, i.key());
|
||||
@ -229,7 +229,7 @@ void Extracter::copyTr() {
|
||||
if (!copyTranslations(DeployCore::extractTranslation(_packageDependencyes[i.key()].neadedLibs()),
|
||||
i.key())) {
|
||||
QuasarAppUtils::Params::log("Failed to copy standard Qt translations",
|
||||
QuasarAppUtils::Warning);
|
||||
QuasarAppUtils::Warning);
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ void Extracter::copyTr() {
|
||||
|
||||
void Extracter::deploy() {
|
||||
QuasarAppUtils::Params::log("target deploy started!!",
|
||||
QuasarAppUtils::Info);
|
||||
QuasarAppUtils::Info);
|
||||
clear();
|
||||
_cqt->smartMoveTargets();
|
||||
_scaner->setEnvironment(DeployCore::_config->envirement.environmentList());
|
||||
@ -246,7 +246,7 @@ void Extracter::deploy() {
|
||||
|
||||
if (DeployCore::_config->deployQml && !extractQml()) {
|
||||
QuasarAppUtils::Params::log("qml not extacted!",
|
||||
QuasarAppUtils::Error);
|
||||
QuasarAppUtils::Error);
|
||||
}
|
||||
|
||||
extractPlugins();
|
||||
@ -265,7 +265,7 @@ void Extracter::deploy() {
|
||||
|
||||
_metaFileManager->createRunMetaFiles();
|
||||
QuasarAppUtils::Params::log("deploy done!",
|
||||
QuasarAppUtils::Info);
|
||||
QuasarAppUtils::Info);
|
||||
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ bool Extracter::copyTranslations(const QStringList &list, const QString& package
|
||||
|
||||
|
||||
QFileInfoList Extracter::findFilesInsideDir(const QString &name,
|
||||
const QString &dirpath) {
|
||||
const QString &dirpath) {
|
||||
QFileInfoList files;
|
||||
|
||||
QDir dir(dirpath);
|
||||
@ -330,7 +330,7 @@ void Extracter::extractLib(const QString &file,
|
||||
|
||||
assert(depMap);
|
||||
QuasarAppUtils::Params::log("extract lib :" + file,
|
||||
QuasarAppUtils::Debug);
|
||||
QuasarAppUtils::Debug);
|
||||
|
||||
auto data = _scaner->scan(file);
|
||||
|
||||
@ -348,8 +348,8 @@ void Extracter::extractLib(const QString &file,
|
||||
depMap->addNeadedLib(line.fullPath());
|
||||
|
||||
} else if (QuasarAppUtils::Params::isEndable("deploySystem") &&
|
||||
line.getPriority() >= LibPriority::SystemLib &&
|
||||
!depMap->containsSysLib(line.fullPath())) {
|
||||
line.getPriority() >= LibPriority::SystemLib &&
|
||||
!depMap->containsSysLib(line.fullPath())) {
|
||||
|
||||
depMap->addSystemLib(line.fullPath());
|
||||
}
|
||||
@ -366,7 +366,7 @@ bool Extracter::extractQmlAll() {
|
||||
|
||||
if (!QFileInfo::exists(cnf->qtDir.getQmls())) {
|
||||
QuasarAppUtils::Params::log("qml dir wrong!",
|
||||
QuasarAppUtils::Warning);
|
||||
QuasarAppUtils::Warning);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -377,8 +377,8 @@ bool Extracter::extractQmlAll() {
|
||||
QStringList listItems;
|
||||
|
||||
if (!_fileManager->copyFolder(cnf->qtDir.getQmls(), targetPath + distro.getQmlOutDir(),
|
||||
QStringList() << ".so.debug" << "d.dll" << ".pdb" << ".dll.debug",
|
||||
&listItems)) {
|
||||
DeployCore::debugExtensions(),
|
||||
&listItems)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -401,22 +401,20 @@ bool Extracter::extractQmlFromSource() {
|
||||
|
||||
QStringList plugins;
|
||||
QStringList listItems;
|
||||
QStringList filter;
|
||||
filter << ".so.debug" << "d.dll" << ".pdb" << ".dll.debug";
|
||||
|
||||
for (const auto &qmlInput: distro.qmlInput()) {
|
||||
QFileInfo info(qmlInput);
|
||||
|
||||
if (!info.isDir()) {
|
||||
QuasarAppUtils::Params::log("extract qml fail! qml source dir not exits or is not dir " + qmlInput,
|
||||
QuasarAppUtils::Error);
|
||||
QuasarAppUtils::Error);
|
||||
continue;
|
||||
}
|
||||
QuasarAppUtils::Params::log("extractQmlFromSource " + info.absoluteFilePath());
|
||||
|
||||
if (!QFileInfo::exists(cnf->qtDir.getQmls())) {
|
||||
QuasarAppUtils::Params::log("qml dir wrong!",
|
||||
QuasarAppUtils::Warning);
|
||||
QuasarAppUtils::Warning);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -424,14 +422,15 @@ bool Extracter::extractQmlFromSource() {
|
||||
|
||||
if (!ownQmlScaner.scan(plugins, info.absoluteFilePath())) {
|
||||
QuasarAppUtils::Params::log("qml scaner run failed!",
|
||||
QuasarAppUtils::Error);
|
||||
QuasarAppUtils::Error);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_fileManager->copyFolder(cnf->qtDir.getQmls(),
|
||||
targetPath + distro.getQmlOutDir(),
|
||||
filter , &listItems, &plugins)) {
|
||||
targetPath + distro.getQmlOutDir(),
|
||||
DeployCore::debugExtensions() ,
|
||||
&listItems, &plugins)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -483,7 +482,7 @@ Extracter::Extracter(FileManager *fileManager, PluginsParser *pluginsParser, Con
|
||||
_fileManager(fileManager),
|
||||
_pluginsParser(pluginsParser),
|
||||
_cqt(cqt)
|
||||
{
|
||||
{
|
||||
|
||||
assert(_cqt);
|
||||
assert(_fileManager);
|
||||
|
@ -102,14 +102,14 @@ void LibInfo::setWinApi(WinAPI winApi) {
|
||||
_winApi = winApi;
|
||||
}
|
||||
|
||||
bool LibInfo::isDependetOfQt() const {
|
||||
QtMajorVersion LibInfo::isDependetOfQt() const {
|
||||
for (const auto& i : dependncies) {
|
||||
if (DeployCore::isQtLib(i)) {
|
||||
return true;
|
||||
if (QtMajorVersion result = DeployCore::isQtLib(i)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return QtMajorVersion::NoQt;
|
||||
}
|
||||
|
||||
QString LibInfo::fullPath() const {
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
void setQtPath(const QString &value);
|
||||
WinAPI getWinApi() const;
|
||||
void setWinApi(WinAPI winApi);
|
||||
bool isDependetOfQt() const;
|
||||
QtMajorVersion isDependetOfQt() const;
|
||||
};
|
||||
|
||||
uint qHash(const LibInfo& info);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <QFile>
|
||||
#include <quasarapp.h>
|
||||
#include <deploycore.h>
|
||||
#include "deployconfig.h"
|
||||
|
||||
QStringList QML::extractImportsFromFile(const QString &filepath) {
|
||||
QStringList imports;
|
||||
@ -29,17 +30,19 @@ QStringList QML::extractImportsFromFile(const QString &filepath) {
|
||||
if (!word.startsWith("import")) continue;
|
||||
|
||||
QStringList list = word.split(" ", splitbehavior);
|
||||
if (list.count() != 3)
|
||||
{
|
||||
if (list.count() == 5)
|
||||
{
|
||||
if (list[3] != "as") continue;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
imports << (list[2][0] + "#" + list[1].replace(".", "/"));
|
||||
if (list.count() == 3 || (list.count() == 5 && list[3] == "as")) {
|
||||
if (list[2] == "auto") {
|
||||
// qt6
|
||||
imports << (list[1].replace(".", "/"));
|
||||
continue;
|
||||
}
|
||||
// qt5
|
||||
imports << (list[2][0] + "#" + list[1].replace(".", "/"));
|
||||
} else if (list.count() == 2 || (list.count() == 4 && list[2] == "as")) {
|
||||
// qt6
|
||||
imports << (list[1].replace(".", "/"));
|
||||
}
|
||||
}
|
||||
|
||||
return imports;
|
||||
@ -75,6 +78,12 @@ bool QML::extractImportsFromDir(const QString &path, bool recursive) {
|
||||
}
|
||||
|
||||
QString QML::getPathFromImport(const QString &import, bool checkVersions) {
|
||||
if (!import.contains("#")) {
|
||||
// qt 6
|
||||
auto info = QFileInfo(_qmlRoot + "/" + import);
|
||||
return info.absoluteFilePath();
|
||||
}
|
||||
|
||||
auto importData = import.split("#");
|
||||
|
||||
int index;
|
||||
@ -115,11 +124,9 @@ bool QML::deployPath(const QString &path, QStringList &res) {
|
||||
auto infoList = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs);
|
||||
|
||||
for (auto info : infoList) {
|
||||
if (info.fileName().contains(".so.debug") ||
|
||||
info.fileName().contains("d.dll") ||
|
||||
info.fileName().contains(".dll.debug")) {
|
||||
if (DeployCore::isDebugFile(info.fileName())) {
|
||||
QuasarAppUtils::Params::log("sciped debug lib " +
|
||||
info.absoluteFilePath());
|
||||
info.absoluteFilePath());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,13 @@
|
||||
|
||||
class DEPLOYSHARED_EXPORT QML {
|
||||
private:
|
||||
|
||||
QStringList extractImportsFromFile(const QString &filepath);
|
||||
|
||||
bool extractImportsFromDir(const QString &path, bool recursive = false);
|
||||
|
||||
QString getPathFromImport(const QString& import, bool checkVersions = true);
|
||||
|
||||
bool deployPath( const QString& path, QStringList& res);
|
||||
bool scanQmlTree(const QString& qmlTree);
|
||||
void addImport();
|
||||
|
@ -1,6 +1,14 @@
|
||||
#include "pathutils.h"
|
||||
#include "qtdir.h"
|
||||
|
||||
QtMajorVersion QtDir::getQtVersion() const {
|
||||
return _qtVersion;
|
||||
}
|
||||
|
||||
void QtDir::setQtVersion(const QtMajorVersion &qtVersion) {
|
||||
_qtVersion = qtVersion;
|
||||
}
|
||||
|
||||
QString QtDir::getLibs() const {
|
||||
return libs;
|
||||
}
|
||||
@ -71,11 +79,11 @@ bool QtDir::isQt(QString path) const {
|
||||
path = PathUtils::fixPath(path);
|
||||
|
||||
return
|
||||
(!libs.isEmpty() && path.contains(libs)) ||
|
||||
(!bins.isEmpty() && path.contains(bins)) ||
|
||||
(!libexecs.isEmpty() && path.contains(libexecs)) ||
|
||||
(!plugins.isEmpty() && path.contains(plugins)) ||
|
||||
(!qmls.isEmpty() && path.contains(qmls)) ||
|
||||
(!translations.isEmpty() && path.contains(translations)) ||
|
||||
(!resources.isEmpty() && path.contains(resources));
|
||||
(!libs.isEmpty() && path.contains(libs, ONLY_WIN_CASE_INSENSIATIVE)) ||
|
||||
(!bins.isEmpty() && path.contains(bins, ONLY_WIN_CASE_INSENSIATIVE)) ||
|
||||
(!libexecs.isEmpty() && path.contains(libexecs, ONLY_WIN_CASE_INSENSIATIVE)) ||
|
||||
(!plugins.isEmpty() && path.contains(plugins, ONLY_WIN_CASE_INSENSIATIVE)) ||
|
||||
(!qmls.isEmpty() && path.contains(qmls, ONLY_WIN_CASE_INSENSIATIVE)) ||
|
||||
(!translations.isEmpty() && path.contains(translations, ONLY_WIN_CASE_INSENSIATIVE)) ||
|
||||
(!resources.isEmpty() && path.contains(resources, ONLY_WIN_CASE_INSENSIATIVE));
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class DEPLOYSHARED_EXPORT QtDir {
|
||||
|
||||
Platform qtPlatform = UnknownPlatform;
|
||||
|
||||
|
||||
QtMajorVersion _qtVersion;
|
||||
public:
|
||||
QString getLibs() const;
|
||||
void setLibs(const QString &value);
|
||||
@ -41,6 +41,13 @@ public:
|
||||
* @return true if object is qt.
|
||||
*/
|
||||
bool isQt(QString path) const;
|
||||
|
||||
/**
|
||||
* @brief getQtVersion This method return information of version of qt
|
||||
* @return the masjor version of qt
|
||||
*/
|
||||
QtMajorVersion getQtVersion() const;
|
||||
void setQtVersion(const QtMajorVersion &qtVersion);
|
||||
};
|
||||
|
||||
#endif // QTDIR_H
|
||||
|
@ -746,7 +746,28 @@ QSet<QString> ModulesQt513::qmlLibs(const QString &distDir) const {
|
||||
"./" + distDir + "/translations/qtdeclarative_pl.qm",
|
||||
"./" + distDir + "/translations/qtdeclarative_ru.qm",
|
||||
"./" + distDir + "/translations/qtdeclarative_sk.qm",
|
||||
"./" + distDir + "/translations/qtdeclarative_uk.qm"
|
||||
"./" + distDir + "/translations/qtdeclarative_uk.qm",
|
||||
"./" + distDir + "/translations/qtscript_ar.qm",
|
||||
"./" + distDir + "/translations/qtscript_bg.qm",
|
||||
"./" + distDir + "/translations/qtscript_ca.qm",
|
||||
"./" + distDir + "/translations/qtscript_cs.qm",
|
||||
"./" + distDir + "/translations/qtscript_da.qm",
|
||||
"./" + distDir + "/translations/qtscript_de.qm",
|
||||
"./" + distDir + "/translations/qtscript_en.qm",
|
||||
"./" + distDir + "/translations/qtscript_es.qm",
|
||||
"./" + distDir + "/translations/qtscript_fi.qm",
|
||||
"./" + distDir + "/translations/qtscript_fr.qm",
|
||||
"./" + distDir + "/translations/qtscript_he.qm",
|
||||
"./" + distDir + "/translations/qtscript_hu.qm",
|
||||
"./" + distDir + "/translations/qtscript_it.qm",
|
||||
"./" + distDir + "/translations/qtscript_ja.qm",
|
||||
"./" + distDir + "/translations/qtscript_ko.qm",
|
||||
"./" + distDir + "/translations/qtscript_lv.qm",
|
||||
"./" + distDir + "/translations/qtscript_pl.qm",
|
||||
"./" + distDir + "/translations/qtscript_ru.qm",
|
||||
"./" + distDir + "/translations/qtscript_sk.qm",
|
||||
"./" + distDir + "/translations/qtscript_tr.qm",
|
||||
"./" + distDir + "/translations/qtscript_uk.qm"
|
||||
});
|
||||
|
||||
#else
|
||||
@ -1256,7 +1277,28 @@ QSet<QString> ModulesQt513::qmlLibs(const QString &distDir) const {
|
||||
"./" + distDir + "/translations/qtdeclarative_pl.qm",
|
||||
"./" + distDir + "/translations/qtdeclarative_ru.qm",
|
||||
"./" + distDir + "/translations/qtdeclarative_sk.qm",
|
||||
"./" + distDir + "/translations/qtdeclarative_uk.qm"
|
||||
"./" + distDir + "/translations/qtdeclarative_uk.qm",
|
||||
"./" + distDir + "/translations/qtscript_ar.qm",
|
||||
"./" + distDir + "/translations/qtscript_bg.qm",
|
||||
"./" + distDir + "/translations/qtscript_ca.qm",
|
||||
"./" + distDir + "/translations/qtscript_cs.qm",
|
||||
"./" + distDir + "/translations/qtscript_da.qm",
|
||||
"./" + distDir + "/translations/qtscript_de.qm",
|
||||
"./" + distDir + "/translations/qtscript_en.qm",
|
||||
"./" + distDir + "/translations/qtscript_es.qm",
|
||||
"./" + distDir + "/translations/qtscript_fi.qm",
|
||||
"./" + distDir + "/translations/qtscript_fr.qm",
|
||||
"./" + distDir + "/translations/qtscript_he.qm",
|
||||
"./" + distDir + "/translations/qtscript_hu.qm",
|
||||
"./" + distDir + "/translations/qtscript_it.qm",
|
||||
"./" + distDir + "/translations/qtscript_ja.qm",
|
||||
"./" + distDir + "/translations/qtscript_ko.qm",
|
||||
"./" + distDir + "/translations/qtscript_lv.qm",
|
||||
"./" + distDir + "/translations/qtscript_pl.qm",
|
||||
"./" + distDir + "/translations/qtscript_ru.qm",
|
||||
"./" + distDir + "/translations/qtscript_sk.qm",
|
||||
"./" + distDir + "/translations/qtscript_tr.qm",
|
||||
"./" + distDir + "/translations/qtscript_uk.qm"
|
||||
});
|
||||
#endif
|
||||
|
||||
@ -1853,7 +1895,28 @@ QSet<QString> ModulesQt513::testDistroLibs(const QString &distDir) const {
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_pl.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_ru.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_sk.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_uk.qm"
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_uk.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ar.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_bg.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ca.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_cs.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_da.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_de.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_en.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_es.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_fi.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_fr.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_he.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_hu.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_it.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ja.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ko.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_lv.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_pl.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ru.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_sk.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_tr.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_uk.qm"
|
||||
}
|
||||
);
|
||||
#else
|
||||
@ -2507,7 +2570,29 @@ QSet<QString> ModulesQt513::testDistroLibs(const QString &distDir) const {
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_pl.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_ru.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_sk.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_uk.qm"
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtdeclarative_uk.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ar.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_bg.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ca.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_cs.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_da.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_de.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_en.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_es.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_fi.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_fr.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_he.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_hu.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_it.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ja.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ko.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_lv.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_pl.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_ru.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_sk.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_tr.qm",
|
||||
"./" + distDir + "/package2/ZzZ/translations/qtscript_uk.qm"
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
@ -2577,6 +2662,27 @@ QSet<QString> ModulesQt513::testOutLibs(const QString &distDir) const {
|
||||
"./" + distDir + "/lolTr/qtdeclarative_ru.qm",
|
||||
"./" + distDir + "/lolTr/qtdeclarative_sk.qm",
|
||||
"./" + distDir + "/lolTr/qtdeclarative_uk.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ar.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_bg.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ca.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_cs.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_da.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_de.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_en.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_es.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_fi.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_fr.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_he.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_hu.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_it.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ja.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ko.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_lv.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_pl.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ru.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_sk.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_tr.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_uk.qm",
|
||||
"./" + distDir + "/p/bearer/qgenericbearer.dll",
|
||||
"./" + distDir + "/p/iconengines/qsvgicon.dll",
|
||||
"./" + distDir + "/p/imageformats/qgif.dll",
|
||||
@ -3121,6 +3227,27 @@ QSet<QString> ModulesQt513::testOutLibs(const QString &distDir) const {
|
||||
"./" + distDir + "/lolTr/qtdeclarative_ru.qm",
|
||||
"./" + distDir + "/lolTr/qtdeclarative_sk.qm",
|
||||
"./" + distDir + "/lolTr/qtdeclarative_uk.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ar.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_bg.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ca.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_cs.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_da.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_de.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_en.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_es.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_fi.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_fr.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_he.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_hu.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_it.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ja.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ko.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_lv.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_pl.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_ru.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_sk.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_tr.qm",
|
||||
"./" + distDir + "/lolTr/qtscript_uk.qm",
|
||||
"./" + distDir + "/p/bearer/libqconnmanbearer.so",
|
||||
"./" + distDir + "/p/bearer/libqgenericbearer.so",
|
||||
"./" + distDir + "/p/bearer/libqnmbearer.so",
|
||||
@ -4198,7 +4325,28 @@ QSet<QString> ModulesQt513::qtWebEngine(const QString &distDir) const {
|
||||
"./" + distDir + "/translations/qtwebengine_locales/zh-TW.pak",
|
||||
"./" + distDir + "/translations/qtwebengine_pl.qm",
|
||||
"./" + distDir + "/translations/qtwebengine_ru.qm",
|
||||
"./" + distDir + "/translations/qtwebengine_uk.qm"
|
||||
"./" + distDir + "/translations/qtwebengine_uk.qm",
|
||||
"./" + distDir + "/translations/qtscript_ar.qm",
|
||||
"./" + distDir + "/translations/qtscript_bg.qm",
|
||||
"./" + distDir + "/translations/qtscript_ca.qm",
|
||||
"./" + distDir + "/translations/qtscript_cs.qm",
|
||||
"./" + distDir + "/translations/qtscript_da.qm",
|
||||
"./" + distDir + "/translations/qtscript_de.qm",
|
||||
"./" + distDir + "/translations/qtscript_en.qm",
|
||||
"./" + distDir + "/translations/qtscript_es.qm",
|
||||
"./" + distDir + "/translations/qtscript_fi.qm",
|
||||
"./" + distDir + "/translations/qtscript_fr.qm",
|
||||
"./" + distDir + "/translations/qtscript_he.qm",
|
||||
"./" + distDir + "/translations/qtscript_hu.qm",
|
||||
"./" + distDir + "/translations/qtscript_it.qm",
|
||||
"./" + distDir + "/translations/qtscript_ja.qm",
|
||||
"./" + distDir + "/translations/qtscript_ko.qm",
|
||||
"./" + distDir + "/translations/qtscript_lv.qm",
|
||||
"./" + distDir + "/translations/qtscript_pl.qm",
|
||||
"./" + distDir + "/translations/qtscript_ru.qm",
|
||||
"./" + distDir + "/translations/qtscript_sk.qm",
|
||||
"./" + distDir + "/translations/qtscript_tr.qm",
|
||||
"./" + distDir + "/translations/qtscript_uk.qm",
|
||||
}
|
||||
);
|
||||
#else
|
||||
|
@ -12,6 +12,7 @@
|
||||
<file alias="win64msvc.exe">testRes/win64/msvc/exe.exe</file>
|
||||
<file alias="win64msvc.dll">testRes/win64/msvc/lib.dll</file>
|
||||
<file alias="qmlFile.qml">testRes/qml/Scene</file>
|
||||
<file alias="qmlFileQt6.qml">testRes/qml/SceneQt6</file>
|
||||
</qresource>
|
||||
<qresource prefix="/testResurces">
|
||||
<file>testRes/TestQMLWidgets.sh</file>
|
||||
|
271
UnitTests/testRes/qml/SceneQt6
Normal file
271
UnitTests/testRes/qml/SceneQt6
Normal file
@ -0,0 +1,271 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material auto
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
Item {
|
||||
id: scene;
|
||||
z: -2
|
||||
|
||||
Rectangle {
|
||||
id: background;
|
||||
color: "#ffffff"
|
||||
anchors.fill: parent;
|
||||
|
||||
Behavior on color {
|
||||
|
||||
ColorAnimation {
|
||||
duration: 5000
|
||||
}
|
||||
}
|
||||
|
||||
z: -3
|
||||
|
||||
}
|
||||
|
||||
property var model: (contr)? contr: null;
|
||||
property var arrayObjects: []
|
||||
property bool showMenu: false
|
||||
property bool isPause: false
|
||||
|
||||
function add (cppObjId) {
|
||||
if (!model) {
|
||||
console.log("create object fail")
|
||||
return;
|
||||
}
|
||||
var objModel = model.getGameObject(cppObjId);
|
||||
|
||||
if (!objModel) {
|
||||
console.log("object model not found");
|
||||
return;
|
||||
}
|
||||
|
||||
var viewTemplate = objModel.viewTemplate;
|
||||
|
||||
var temp = Qt.createComponent( viewTemplate + ".qml")
|
||||
if (temp.status === Component.Ready) {
|
||||
var obj = temp.createObject(parent) // parent - это обьект на который будет помещен соззданный элемент
|
||||
obj.model = model.getGameObject(cppObjId);
|
||||
obj.z = -2;
|
||||
arrayObjects.push(obj)
|
||||
} else {
|
||||
console.log("wrong viewTemplate in model");
|
||||
}
|
||||
}
|
||||
|
||||
function remove(id) {
|
||||
if (typeof id !== "number" || id < 0) {
|
||||
console.log("id not found");
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < arrayObjects.length; ++i) {
|
||||
if (id === arrayObjects[i].guiId) {
|
||||
arrayObjects.splice(i,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setAuto (auto) {
|
||||
if (auto && model) {
|
||||
model.newGame();
|
||||
|
||||
}
|
||||
showMenu = (auto && model)
|
||||
autoTimer.running = auto && model;
|
||||
}
|
||||
|
||||
function updateBackgroundColor(lvl) {
|
||||
switch(lvl % 7) {
|
||||
case 0: background.color = "#d6eaf8"; break;
|
||||
case 1: background.color = "#d0ece7"; break;
|
||||
case 2: background.color = "#d4efdf"; break;
|
||||
case 3: background.color = "#fcf3cf"; break;
|
||||
case 4: background.color = "#f6ddcc"; break;
|
||||
case 5: background.color = "#f2d7d5"; break;
|
||||
case 6: background.color = "#ebdef0"; break;
|
||||
case 7: background.color = "#fbfcfc"; break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Timer {
|
||||
id :autoTimer;
|
||||
repeat: true;
|
||||
running: false;
|
||||
interval: 1000
|
||||
onTriggered: {
|
||||
interval = Math.random() * 600
|
||||
scene.model.buttonPress();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: model;
|
||||
onGameObjectsChanged: {
|
||||
if (!dif) {
|
||||
console.log("dif not found");
|
||||
return;
|
||||
}
|
||||
|
||||
var tempDifRem = [];
|
||||
tempDifRem = dif.getRemoveIds();
|
||||
var tempDifAdd = [];
|
||||
tempDifAdd = dif.getAddedIds();
|
||||
|
||||
for (var i = 0; i < tempDifAdd.length; ++i) {
|
||||
add(tempDifAdd[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < tempDifRem.length; ++i) {
|
||||
remove(tempDifRem[i]);
|
||||
}
|
||||
}
|
||||
|
||||
onFinished: {
|
||||
|
||||
var isVictory = victory;
|
||||
var gameLvl = lvl + 1;
|
||||
var dist = distance;
|
||||
updateBackgroundColor(gameLvl);
|
||||
|
||||
if (isVictory ) {
|
||||
|
||||
if (!autoTimer.running)
|
||||
notification.show(qsTr(" Next Lvl!!!"),
|
||||
qsTr(" You anblock next lvl (" + gameLvl + ")" ),
|
||||
"qrc:/texture/up");
|
||||
|
||||
model.nextLvl();
|
||||
} else if (autoTimer.running) {
|
||||
model.newGame();
|
||||
} else {
|
||||
showMenu = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
updateBackgroundColor(0);
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
|
||||
onClicked: {
|
||||
if (!model) {
|
||||
console.log("model not found");
|
||||
return;
|
||||
}
|
||||
|
||||
model.buttonPress();
|
||||
}
|
||||
}
|
||||
|
||||
NotificationForm {
|
||||
z: -1
|
||||
id: notification;
|
||||
margin: mainWindow.point;
|
||||
|
||||
x: parent.width - width - margin;
|
||||
y: margin;
|
||||
|
||||
width: 40 * mainWindow.point;
|
||||
height: width * 0.5
|
||||
|
||||
}
|
||||
|
||||
Button {
|
||||
id: returnToMenu;
|
||||
|
||||
text: "<<"
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: point
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: point
|
||||
z: 1
|
||||
|
||||
onClicked: {
|
||||
showMenu = true;
|
||||
}
|
||||
|
||||
visible: !showMenu
|
||||
}
|
||||
|
||||
Button {
|
||||
id: pause
|
||||
|
||||
text: (isPause)? "▶" :"||"
|
||||
|
||||
anchors.left: returnToMenu.right
|
||||
anchors.leftMargin: point
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: point
|
||||
z: returnToMenu.z
|
||||
|
||||
onClicked: {
|
||||
isPause = !isPause;
|
||||
if (model) model.setPause(isPause);
|
||||
}
|
||||
|
||||
visible: !showMenu
|
||||
|
||||
}
|
||||
|
||||
Button {
|
||||
id: long_
|
||||
Label {
|
||||
anchors.fill: parent;
|
||||
|
||||
textFormat: Text.AutoText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
text: qsTr("lvl long: ") + ((model)? model.long_: "0")
|
||||
}
|
||||
|
||||
width: 35 * point;
|
||||
height: pause.height;
|
||||
|
||||
anchors.left: pause.right
|
||||
anchors.leftMargin: point
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: point
|
||||
z: returnToMenu.z
|
||||
|
||||
visible: !showMenu
|
||||
|
||||
}
|
||||
|
||||
Button {
|
||||
Label {
|
||||
anchors.fill: parent;
|
||||
|
||||
textFormat: Text.AutoText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
text: qsTr("general long: ") + ((model)? model.generalLong: "0")
|
||||
}
|
||||
|
||||
width: 35 * point;
|
||||
height: long_.height;
|
||||
|
||||
anchors.left: long_.right
|
||||
anchors.leftMargin: point
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: point
|
||||
z: returnToMenu.z
|
||||
|
||||
visible: !showMenu
|
||||
|
||||
}
|
||||
}
|
@ -160,6 +160,8 @@ private slots:
|
||||
void testInit();
|
||||
|
||||
void testDependencyMap();
|
||||
|
||||
void testQmlScaner();
|
||||
};
|
||||
|
||||
bool deploytest::runProcess(const QString &DistroPath,
|
||||
@ -953,6 +955,50 @@ void deploytest::testDependencyMap() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void deploytest::testQmlScaner() {
|
||||
|
||||
// qt5
|
||||
auto qmlRoot = QFileInfo(TestQtDir + "/qml").absoluteFilePath();
|
||||
QML *scaner = new QML(qmlRoot);
|
||||
auto imports = scaner->extractImportsFromFile(":/qmlFile.qml");
|
||||
|
||||
scaner->scanQmlTree(qmlRoot);
|
||||
|
||||
QSet<QString> results = {
|
||||
{qmlRoot + "/QtQuick.2/"},
|
||||
{qmlRoot + "/QtQuick/Controls.2/"},
|
||||
{qmlRoot + "/QtQuick/Controls.2/Material/"},
|
||||
{qmlRoot + "/QtQuick/Layouts/"},
|
||||
};
|
||||
|
||||
QVERIFY(results.size() == imports.size());
|
||||
|
||||
for (auto import: imports) {
|
||||
auto path = scaner->getPathFromImport(import);
|
||||
QVERIFY(results.contains(path));
|
||||
}
|
||||
|
||||
|
||||
// qt6
|
||||
|
||||
results = {
|
||||
{qmlRoot + "/QtQuick"},
|
||||
{qmlRoot + "/QtQuick/Controls"},
|
||||
{qmlRoot + "/QtQuick/Controls/Material"},
|
||||
{qmlRoot + "/QtQuick/Layouts"},
|
||||
};
|
||||
|
||||
imports = scaner->extractImportsFromFile(":/qmlFileQt6.qml");
|
||||
|
||||
QVERIFY(results.size() == imports.size());
|
||||
|
||||
for (auto import: imports) {
|
||||
auto path = scaner->getPathFromImport(import);
|
||||
QVERIFY(results.contains(path));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void deploytest::testQmlExtrct() {
|
||||
@ -1066,28 +1112,28 @@ void deploytest::testCheckQt() {
|
||||
QVERIFY(deployer->prepare());
|
||||
|
||||
|
||||
auto cases = QList<QPair<QString, bool>>{
|
||||
{TestQtDir + "/", false},
|
||||
{TestQtDir + "", false},
|
||||
{TestQtDir + "/bin/file1", false},
|
||||
{TestQtDir + "/lib/file12.so", false},
|
||||
{TestQtDir + "/resurces/file13.dll", false},
|
||||
{TestQtDir + "/libexec/f", false},
|
||||
{TestQtDir + "/mkspecs", false},
|
||||
{TestQtDir + "/qml", false},
|
||||
{TestQtDir + "/plugins", false},
|
||||
{TestQtDir + "/file", false},
|
||||
auto cases = QList<QPair<QString, QtMajorVersion>>{
|
||||
{TestQtDir + "/", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/bin/file1", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/lib/file12.so", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/resurces/file13.dll", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/libexec/f", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/mkspecs", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/qml", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/plugins", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/file", QtMajorVersion::NoQt},
|
||||
|
||||
{TestQtDir + "\\", false},
|
||||
{TestQtDir + "", false},
|
||||
{TestQtDir + "\\bin\\file1", false},
|
||||
{TestQtDir + "\\lib\\file12", false},
|
||||
{TestQtDir + "\\resurces\\file13", false},
|
||||
{TestQtDir + "\\libexec\\f.so", false},
|
||||
{TestQtDir + "\\mkspecs.dll", false},
|
||||
{TestQtDir + "\\qml", false},
|
||||
{TestQtDir + "\\plugins", false},
|
||||
{TestQtDir + "\\file", false},
|
||||
{TestQtDir + "\\", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\bin\\file1", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\lib\\file12", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\resurces\\file13", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\libexec\\f.so", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\mkspecs.dll", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\qml", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\plugins", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\file", QtMajorVersion::NoQt},
|
||||
|
||||
};
|
||||
|
||||
@ -1112,30 +1158,44 @@ void deploytest::testCheckQt() {
|
||||
QVERIFY(deployer->prepare());
|
||||
|
||||
|
||||
cases = QList<QPair<QString, bool>>{
|
||||
{TestQtDir + "/", false},
|
||||
{TestQtDir + "", false},
|
||||
{TestQtDir + "/bin/file1", false},
|
||||
{TestQtDir + "/lib/file12", false},
|
||||
{TestQtDir + "/bin/file1Qt.so", true},
|
||||
{TestQtDir + "/lib/file12", false},
|
||||
{TestQtDir + "/resources/Qtfile13.so", true},
|
||||
{TestQtDir + "/libexec/Qtf.dll", true},
|
||||
{TestQtDir + "/mkspecs", false},
|
||||
{TestQtDir + "/qml", false},
|
||||
{TestQtDir + "/plugins", false},
|
||||
{TestQtDir + "/file", false},
|
||||
cases = QList<QPair<QString, QtMajorVersion>>{
|
||||
{TestQtDir + "/", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/bin/file1", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/lib/file12", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/lib/file12", QtMajorVersion::NoQt},
|
||||
|
||||
{TestQtDir + "\\", false},
|
||||
{TestQtDir + "", false},
|
||||
{TestQtDir + "\\bin\\Qtfile1.dll", true},
|
||||
{TestQtDir + "\\lib\\file12", false},
|
||||
{TestQtDir + "\\resources\\fileQt13.dll", true},
|
||||
{TestQtDir + "\\libexec\\fQt", false},
|
||||
{TestQtDir + "\\mkspecs", false},
|
||||
{TestQtDir + "\\qml", false},
|
||||
{TestQtDir + "\\plugins", false},
|
||||
{TestQtDir + "\\file", false},
|
||||
{TestQtDir + "/mkspecs", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/qml", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/plugins", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "/file", QtMajorVersion::NoQt},
|
||||
|
||||
{TestQtDir + "\\", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\lib\\file12", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\libexec\\fQt", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\mkspecs", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\qml", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\plugins", QtMajorVersion::NoQt},
|
||||
{TestQtDir + "\\file", QtMajorVersion::NoQt},
|
||||
|
||||
{TestQtDir + "/bin/file1Qt4.so", QtMajorVersion::Qt4},
|
||||
{TestQtDir + "/resources/Qt4file13.so", QtMajorVersion::Qt4},
|
||||
{TestQtDir + "/libexec/Qt4f.dll", QtMajorVersion::Qt4},
|
||||
{TestQtDir + "\\bin\\Qt4file1.dll", QtMajorVersion::Qt4},
|
||||
{TestQtDir + "\\resources\\fileQt413.dll", QtMajorVersion::Qt4},
|
||||
|
||||
{TestQtDir + "/bin/file1Qt5.so", QtMajorVersion::Qt5},
|
||||
{TestQtDir + "/resources/Qt5file13.so", QtMajorVersion::Qt5},
|
||||
{TestQtDir + "/libexec/Qt5f.dll", QtMajorVersion::Qt5},
|
||||
{TestQtDir + "\\bin\\Qt5file1.dll", QtMajorVersion::Qt5},
|
||||
{TestQtDir + "\\resources\\fileQt513.dll", QtMajorVersion::Qt5},
|
||||
|
||||
{TestQtDir + "/bin/file1Qt6.so", QtMajorVersion::Qt6},
|
||||
{TestQtDir + "/resources/Qt6file13.so", QtMajorVersion::Qt6},
|
||||
{TestQtDir + "/libexec/Qt6f.dll", QtMajorVersion::Qt6},
|
||||
{TestQtDir + "\\bin\\Qt6file1.dll", QtMajorVersion::Qt6},
|
||||
{TestQtDir + "\\resources\\fileQt613.dll", QtMajorVersion::Qt6},
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user