mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-27 10:14:32 +00:00
commit
ca4b6085fd
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -10,3 +10,6 @@
|
||||
[submodule "installer"]
|
||||
path = installer
|
||||
url = https://github.com/QuasarApp/DesktopInstaller.git
|
||||
[submodule "QuasarAppScripts"]
|
||||
path = QuasarAppScripts
|
||||
url = https://github.com/QuasarApp/QuasarAppScripts.git
|
||||
|
@ -8,40 +8,42 @@
|
||||
TEMPLATE = subdirs
|
||||
CONFIG += ordered
|
||||
!android {
|
||||
SUBDIRS += QuasarAppLib \
|
||||
Pe \
|
||||
Deploy \
|
||||
CQtDeployer \
|
||||
UnitTests \
|
||||
tests/TestOnlyC \
|
||||
tests/TestQtWidgets \
|
||||
tests/TestQMLWidgets
|
||||
SUBDIRS += QuasarAppLib \
|
||||
Pe \
|
||||
Deploy \
|
||||
CQtDeployer \
|
||||
UnitTests \
|
||||
tests/TestOnlyC \
|
||||
tests/TestQtWidgets \
|
||||
tests/TestQMLWidgets
|
||||
|
||||
|
||||
contains(DEFINES, WITH_ALL_TESTS) {
|
||||
SUBDIRS += tests/quicknanobrowser
|
||||
}
|
||||
|
||||
|
||||
contains(DEFINES, WITHOUT_TESTS) {
|
||||
SUBDIRS -= UnitTests \
|
||||
tests/TestOnlyC \
|
||||
tests/TestQtWidgets \
|
||||
tests/TestQMLWidgets \
|
||||
tests/quicknanobrowser
|
||||
}
|
||||
|
||||
CQtDeployer.depends=QuasarAppLib
|
||||
CQtDeployer.depends=Deploy
|
||||
|
||||
QuasarAppLib.file = $$PWD/QuasarAppLib/QuasarApp.pro
|
||||
Pe.file = $$PWD/pe/pe-parser-library/pe-parser-library.pro
|
||||
|
||||
include('$$PWD/QIFData/installerCQtDeployer.pri')
|
||||
|
||||
DISTFILES += \
|
||||
snap/snapcraft.yaml \
|
||||
README.md \
|
||||
|
||||
|
||||
}
|
||||
|
||||
contains(DEFINES, WITH_ALL_TESTS) {
|
||||
SUBDIRS += tests/quicknanobrowser
|
||||
}
|
||||
|
||||
|
||||
contains(DEFINES, WITHOUT_TESTS) {
|
||||
SUBDIRS -= UnitTests \
|
||||
tests/TestOnlyC \
|
||||
tests/TestQtWidgets \
|
||||
tests/TestQMLWidgets \
|
||||
tests/quicknanobrowser
|
||||
}
|
||||
|
||||
CQtDeployer.depends=QuasarAppLib
|
||||
CQtDeployer.depends=Deploy
|
||||
|
||||
QuasarAppLib.file = $$PWD/QuasarAppLib/QuasarApp.pro
|
||||
Pe.file = $$PWD/pe/pe-parser-library/pe-parser-library.pro
|
||||
|
||||
include('$$PWD/QIFData/installerCQtDeployer.pri')
|
||||
include($$PWD/test.pri)
|
||||
|
||||
DISTFILES += \
|
||||
snap/snapcraft.yaml \
|
||||
README.md \
|
||||
|
||||
include($$PWD/test.pri)
|
||||
|
||||
|
@ -46,7 +46,8 @@
|
||||
"recOut": "rec",
|
||||
"verbose": 3,
|
||||
"qif": false,
|
||||
"noAutoCheckQmake": false,
|
||||
"noCheckRPATH": false,
|
||||
"noCheckPATH": false,
|
||||
"name": [
|
||||
[
|
||||
"package2",
|
||||
|
@ -28,7 +28,8 @@
|
||||
"recOut": "rec",
|
||||
"verbose": 3,
|
||||
"qif": false,
|
||||
"noAutoCheckQmake": false,
|
||||
"noCheckRPATH": false,
|
||||
"noCheckPATH": false,
|
||||
"name": "mainApplication",
|
||||
"description": "this is description for default package",
|
||||
"deployVersion": "1.0.0",
|
||||
|
@ -111,22 +111,6 @@ bool iDistribution::copyFile(const QString &from, const QString &to) const {
|
||||
return _fileManager->copyFile(from, to);
|
||||
}
|
||||
|
||||
QString iDistribution::findProcess(const QString &env, const QString& proc) const {
|
||||
auto list = env.split(DeployCore::getEnvSeparator());
|
||||
|
||||
for (const auto& path : list) {
|
||||
auto files = QDir(path).entryInfoList(QDir::NoDotAndDotDot | QDir::Files);
|
||||
|
||||
for (const auto& bin : files) {
|
||||
if (bin.fileName().compare(proc, ONLY_WIN_CASE_INSENSIATIVE) == 0) {
|
||||
return bin.absoluteFilePath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
QMap<int ,QPair<QString, const DistroModule*>>
|
||||
iDistribution::sortPackages(const QHash<QString, DistroModule> &input) {
|
||||
QMap<int ,QPair<QString, const DistroModule *>> result;
|
||||
|
@ -43,7 +43,6 @@ protected:
|
||||
bool moveData(const QString& from, const QString& to, const QString &ignore) const;
|
||||
bool copyFile(const QString& from, const QString& to) const;
|
||||
|
||||
QString findProcess(const QString& env, const QString& proc) const;
|
||||
|
||||
QMap<int, QPair<QString, const DistroModule *>> sortPackages(const QHash<QString, DistroModule> &input);
|
||||
private:
|
||||
|
@ -52,7 +52,7 @@ QString QIF::runCmd() {
|
||||
QString base = "binarycreator";
|
||||
|
||||
if (binarycreator.isEmpty())
|
||||
binarycreator = findProcess(toolKitEnv().concatEnv(), base);
|
||||
binarycreator = DeployCore::findProcess(toolKitEnv().concatEnv(), base);
|
||||
|
||||
return binarycreator;
|
||||
}
|
||||
|
@ -578,6 +578,16 @@ QSet<QString> ConfigParser::getQtPathesFromTargets() {
|
||||
return res;
|
||||
}
|
||||
|
||||
bool ConfigParser::isNeededQt() const {
|
||||
for (const auto &i: _config.targets()) {
|
||||
if (i.isValid() && i.isDependetOfQt()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ConfigParser::setTargetDir(const QString &target) {
|
||||
|
||||
if (QuasarAppUtils::Params::isEndable("targetDir")) {
|
||||
@ -852,6 +862,16 @@ bool ConfigParser::initQmake() {
|
||||
auto qtList = getQtPathesFromTargets();
|
||||
|
||||
if (qtList.isEmpty()) {
|
||||
|
||||
if (!QuasarAppUtils::Params::isEndable("noCheckPATH") && isNeededQt()) {
|
||||
auto env = QProcessEnvironment::systemEnvironment();
|
||||
auto proc = DeployCore::findProcess(env.value("PATH"), "qmake");
|
||||
if (proc.isEmpty())
|
||||
return false;
|
||||
|
||||
return initQmakePrivate(proc);
|
||||
}
|
||||
|
||||
qInfo() << "deploy only C libs because qmake is not found";
|
||||
return true;
|
||||
|
||||
@ -881,6 +901,7 @@ bool ConfigParser::setQmake(const QString &value) {
|
||||
|
||||
if (!(qmakeInfo.fileName().compare("qmake", Qt::CaseInsensitive) ||
|
||||
qmakeInfo.fileName().compare("qmake.exe", Qt::CaseInsensitive))) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,7 @@ private:
|
||||
|
||||
bool configureDistribution(iDistribution *distro);
|
||||
|
||||
bool isNeededQt() const;
|
||||
public:
|
||||
ConfigParser(FileManager *filemanager, DependenciesScanner *scaner, Packing* pac);
|
||||
bool parseParams();
|
||||
|
@ -87,7 +87,7 @@ bool DependenciesScanner::fillLibInfo(LibInfo &info, const QString &file) const
|
||||
}
|
||||
}
|
||||
|
||||
void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res) {
|
||||
void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res, QSet<QString>& libStack) {
|
||||
QuasarAppUtils::Params::verboseLog("get recursive dependencies of " + lib.fullPath(),
|
||||
QuasarAppUtils::Info);
|
||||
|
||||
@ -104,6 +104,14 @@ void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (libStack.contains(lib.fullPath())) {
|
||||
QuasarAppUtils::Params::verboseLog("A recursive dependency was found in library " + lib.fullPath(),
|
||||
QuasarAppUtils::Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
libStack.insert(lib.fullPath());
|
||||
|
||||
for (auto i : lib.dependncies) {
|
||||
|
||||
auto libs = getLibsFromEnvirement(i);
|
||||
@ -127,7 +135,10 @@ void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res) {
|
||||
if (!scanedLib.isValid()) {
|
||||
QSet<LibInfo> listDep = {};
|
||||
|
||||
recursiveDep(*dep, listDep);
|
||||
if (!lib.name.compare(dep.value().name, ONLY_WIN_CASE_INSENSIATIVE))
|
||||
continue;
|
||||
|
||||
recursiveDep(*dep, listDep, libStack);
|
||||
|
||||
dep->allDep = listDep;
|
||||
lib.setWinApi(lib.getWinApi() | dep->getWinApi());
|
||||
@ -140,6 +151,8 @@ void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
libStack.remove(lib.fullPath());
|
||||
}
|
||||
|
||||
void DependenciesScanner::addToWinAPI(const QString &lib, QHash<WinAPI, QSet<QString>>& res) {
|
||||
@ -196,7 +209,8 @@ QSet<LibInfo> DependenciesScanner::scan(const QString &path) {
|
||||
return result;
|
||||
}
|
||||
|
||||
recursiveDep(info, result);
|
||||
QSet<QString> stack;
|
||||
recursiveDep(info, result, stack);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ private:
|
||||
|
||||
QMultiMap<LibPriority, LibInfo> getLibsFromEnvirement(const QString& libName) const;
|
||||
|
||||
void recursiveDep(LibInfo& lib, QSet<LibInfo> &res);
|
||||
void recursiveDep(LibInfo& lib, QSet<LibInfo> &res, QSet<QString> &libStack);
|
||||
|
||||
void addToWinAPI(const QString& lib, QHash<WinAPI, QSet<QString> > &res);
|
||||
|
||||
|
@ -56,6 +56,8 @@ Deploy::~Deploy() {
|
||||
if (_packing) {
|
||||
delete _packing;
|
||||
}
|
||||
|
||||
DeployCore::_config = nullptr;
|
||||
}
|
||||
|
||||
bool Deploy::prepare() {
|
||||
|
@ -13,6 +13,13 @@
|
||||
#define DEFAULT_COFIGURATION_FILE QString("CQtDeployer.json")
|
||||
#define DISTRO_DIR QString("DistributionKit")
|
||||
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#define ONLY_WIN_CASE_INSENSIATIVE Qt::CaseInsensitive
|
||||
#else
|
||||
#define ONLY_WIN_CASE_INSENSIATIVE Qt::CaseSensitive
|
||||
#endif
|
||||
|
||||
#if defined(DEPLOY_LIBRARY)
|
||||
# define DEPLOYSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
|
@ -209,7 +209,8 @@ QString DeployCore::help() {
|
||||
{ " : which will not be compatible with equipment on users' hosts."},
|
||||
{ " noTranslations : Skips the translations files." },
|
||||
{ " | It doesn't work without qmake and inside a snap package" },
|
||||
{ " -noAutoCheckQmake : Disables automatic search of paths to qmake in executable files." },
|
||||
{ " noCheckRPATH : Disables automatic search of paths to qmake in executable files." },
|
||||
{ " noCheckPATH : Disables automatic search of paths to qmake in system PATH." },
|
||||
{ " -qmlOut [package;val,val] : Sets path to qml out directory" },
|
||||
{ " -libOut [package;val,val] : Sets path to libraries out directory" },
|
||||
{ " -trOut [package;val,val] : Sets path to translations out directory" },
|
||||
@ -276,7 +277,8 @@ QStringList DeployCore::helpKeys() {
|
||||
"version",
|
||||
"verbose",
|
||||
"qif",
|
||||
"noAutoCheckQmake",
|
||||
"noCheckRPATH",
|
||||
"noCheckPATH",
|
||||
"name",
|
||||
"description",
|
||||
"deployVersion",
|
||||
@ -333,6 +335,22 @@ bool DeployCore::isContainsArraySeparators(const QString &val, int lastLvl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QString DeployCore::findProcess(const QString &env, const QString& proc) {
|
||||
auto list = env.split(DeployCore::getEnvSeparator());
|
||||
|
||||
for (const auto& path : list) {
|
||||
auto files = QDir(path).entryInfoList(QDir::NoDotAndDotDot | QDir::Files);
|
||||
|
||||
for (const auto& bin : files) {
|
||||
if (bin.baseName().compare(proc, ONLY_WIN_CASE_INSENSIATIVE) == 0) {
|
||||
return bin.absoluteFilePath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
int DeployCore::find(const QString &str, const QStringList &list) {
|
||||
for (int i = 0 ; i < list.size(); ++i) {
|
||||
if (list[i].contains(str))
|
||||
@ -448,8 +466,12 @@ QString DeployCore::getMSVCVersion(MSVCVersion msvc) {
|
||||
|
||||
bool DeployCore::isQtLib(const QString &lib) {
|
||||
QFileInfo info((lib));
|
||||
return _config->qtDir.isQt(PathUtils::toFullPath(info.absoluteFilePath()));
|
||||
|
||||
if (_config) {
|
||||
return _config->qtDir.isQt(PathUtils::toFullPath(info.absoluteFilePath()));
|
||||
}
|
||||
|
||||
return isLib(info) && info.fileName().contains("Qt", Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
bool DeployCore::isExtraLib(const QString &lib) {
|
||||
|
@ -170,6 +170,8 @@ public:
|
||||
static bool isExecutable(const QFileInfo &file);
|
||||
static bool isContainsArraySeparators(const QString& val,
|
||||
int lastLvl = 2);
|
||||
static QString findProcess(const QString& env, const QString& proc);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -64,7 +64,7 @@ bool ELF::getLibInfo(const QString &lib, LibInfo &info) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!QuasarAppUtils::Params::isEndable("noAutoCheckQmake")) {
|
||||
if (!QuasarAppUtils::Params::isEndable("noCheckRPATH")) {
|
||||
auto dynStr = getDynamicString(reader);
|
||||
|
||||
for (auto i = dynStr.rbegin(); i != dynStr.rend(); ++i) {
|
||||
|
@ -102,6 +102,16 @@ void LibInfo::setWinApi(WinAPI winApi) {
|
||||
_winApi = winApi;
|
||||
}
|
||||
|
||||
bool LibInfo::isDependetOfQt() const {
|
||||
for (const auto& i : dependncies) {
|
||||
if (DeployCore::isQtLib(i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QString LibInfo::fullPath() const {
|
||||
return path + "/" + name;
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
void setQtPath(const QString &value);
|
||||
WinAPI getWinApi() const;
|
||||
void setWinApi(WinAPI winApi);
|
||||
bool isDependetOfQt() const;
|
||||
};
|
||||
|
||||
uint qHash(const LibInfo& info);
|
||||
|
@ -13,12 +13,6 @@
|
||||
#include <QString>
|
||||
#include "deploy_global.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#define ONLY_WIN_CASE_INSENSIATIVE Qt::CaseInsensitive
|
||||
#else
|
||||
#define ONLY_WIN_CASE_INSENSIATIVE Qt::CaseSensitive
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief The PathUtils class
|
||||
*
|
||||
|
@ -48,8 +48,6 @@ struct parsed_pe_internal {
|
||||
|
||||
bool PE::getDep(peparse::parsed_pe_internal * internal, LibInfo &res) const {
|
||||
auto imports = internal->imports;
|
||||
auto exports = internal->exports;
|
||||
|
||||
std::set<std::string> filter;
|
||||
|
||||
for ( auto &i : imports) {
|
||||
@ -59,13 +57,6 @@ bool PE::getDep(peparse::parsed_pe_internal * internal, LibInfo &res) const {
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto &i : exports) {
|
||||
if (!filter.count(i.moduleName)) {
|
||||
filter.insert(i.moduleName);
|
||||
res.addDependncies(QString::fromStdString(i.moduleName));
|
||||
}
|
||||
}
|
||||
|
||||
if (res.getWinApi() != WinAPI::NoWinAPI) {
|
||||
res.addDependncies(_winAPI.value(res.getWinApi()));
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ win32:OUT_BIN= -binOut .
|
||||
BASE_DEPLOY_FLAGS = clear -qmake $$QMAKE_BIN -libDir $$PWD/../ -recursiveDepth 4 -ignoreEnv $$DEPLOY_TARGET
|
||||
BASE_DEPLOY_FLAGS_CQT = $$BASE_DEPLOY_FLAGS -targetDir $$DATA_DIR $$OUT_LIB $$OUT_BIN
|
||||
|
||||
deploy_dep.commands += $$DEPLOYER -bin $$DEPLOY_TARGET $$BASE_DEPLOY_FLAGS_CQT
|
||||
deploy_dep.commands += cqtdeployer -bin $$DEPLOY_TARGET $$BASE_DEPLOY_FLAGS_CQT
|
||||
|
||||
win32:CONFIG_FILE = $$PWD/config/configWin.xml
|
||||
unix:CONFIG_FILE = $$PWD/config/configLinux.xml
|
||||
@ -34,10 +34,7 @@ deploy.depends += deployOffline
|
||||
win32:ONLINE_REPO_DIR = $$ONLINE/CQtDeployer/Windows
|
||||
unix:ONLINE_REPO_DIR = $$ONLINE/CQtDeployer/Linux
|
||||
|
||||
create_repo.commands = $$REPOGEN \
|
||||
--update-new-components \
|
||||
-p $$PWD/packages \
|
||||
$$ONLINE_REPO_DIR
|
||||
create_repo.commands = python3 $$PWD/QuasarAppScripts/cp.py $$PWD/packages/ $$PWD/../Repo
|
||||
|
||||
chmodSnap.commands = chmod 777 -R $$DATA_DIR
|
||||
unix:deploy.depends += chmodSnap
|
||||
|
@ -31,7 +31,7 @@ function systemIntegration() {
|
||||
if (systemInfo.kernelType === "winnt") {
|
||||
|
||||
component.addOperation('Execute', ["SETX", "cqtdeployer", "\"" + targetDir + "/" + VERSION + "/cqtdeployer.exe\""])
|
||||
|
||||
component.addElevatedOperation('CreateLink', [ "C:/Windows/system32/cqtdeployer", "\"" + targetDir + "/" + VERSION + "/cqtdeployer.exe\""])
|
||||
|
||||
} else {
|
||||
|
||||
|
1
QuasarAppScripts
Submodule
1
QuasarAppScripts
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit f680b277968f6bbd966a7dcfe2014dbb343fefd2
|
@ -4,6 +4,7 @@
|
||||
|
||||
****************************
|
||||
|
||||
|
||||
## What is CQtDeployer
|
||||
The CQtDeployer is application for extract all depends library of executable and create launch script for your application.
|
||||
|
||||
|
@ -32,6 +32,8 @@ TEMPLATE = app
|
||||
SOURCES += tst_deploytest.cpp \
|
||||
libcreator.cpp \
|
||||
modules.cpp \
|
||||
modulesqt513.cpp \
|
||||
modulesqt514.cpp \
|
||||
qmlcreator.cpp \
|
||||
testutils.cpp
|
||||
|
||||
@ -41,5 +43,7 @@ RESOURCES += \
|
||||
HEADERS += \
|
||||
libcreator.h \
|
||||
modules.h \
|
||||
modulesqt513.h \
|
||||
modulesqt514.h \
|
||||
qmlcreator.h \
|
||||
testutils.h
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,26 +12,23 @@
|
||||
#include <configparser.h>
|
||||
#include <QSet>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
#include "modulesqt514.h"
|
||||
class Modules : public ModulesQt514
|
||||
|
||||
#elif QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
||||
#include "modulesqt513.h"
|
||||
class Modules : public ModulesQt513
|
||||
|
||||
#else
|
||||
#include "modulesqt513.h"
|
||||
class Modules : public ModulesQt513
|
||||
|
||||
#endif
|
||||
|
||||
class Modules
|
||||
{
|
||||
private:
|
||||
public:
|
||||
Modules();
|
||||
|
||||
static QSet<QString> ignoreFilter(const QSet<QString>& input, const QString& filter);
|
||||
static QSet<QString> qtLibs();
|
||||
static QSet<QString> qmlLibs();
|
||||
static QSet<QString> qmlLibsExtractPlugins();
|
||||
static QSet<QString> separetedPackageslibs();
|
||||
|
||||
static QSet<QString> outTestLibs();
|
||||
|
||||
static QSet<QString> qtWithoutTr();
|
||||
static QSet<QString> qtWebEngine();
|
||||
static QSet<QString> testEmptyParamsTree(const QString &distDir = DISTRO_DIR);
|
||||
|
||||
};
|
||||
|
||||
#endif // MODULES_H
|
||||
|
5732
UnitTests/modulesqt513.cpp
Normal file
5732
UnitTests/modulesqt513.cpp
Normal file
File diff suppressed because it is too large
Load Diff
34
UnitTests/modulesqt513.h
Normal file
34
UnitTests/modulesqt513.h
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 QuasarApp.
|
||||
* Distributed under the lgplv3 software license, see the accompanying
|
||||
* Everyone is permitted to copy and distribute verbatim copies
|
||||
* of this license document, but changing it is not allowed.
|
||||
*/
|
||||
|
||||
#ifndef MODULESQT513_H
|
||||
#define MODULESQT513_H
|
||||
#include "testutils.h"
|
||||
#include <configparser.h>
|
||||
#include <QSet>
|
||||
|
||||
|
||||
class ModulesQt513
|
||||
{
|
||||
public:
|
||||
ModulesQt513();
|
||||
|
||||
static QSet<QString> ignoreFilter(const QSet<QString>& input, const QString& filter);
|
||||
static QSet<QString> qtLibs();
|
||||
static QSet<QString> qmlLibs();
|
||||
static QSet<QString> qmlLibsExtractPlugins();
|
||||
static QSet<QString> separetedPackageslibs();
|
||||
|
||||
static QSet<QString> outTestLibs();
|
||||
|
||||
static QSet<QString> qtWithoutTr();
|
||||
static QSet<QString> qtWebEngine();
|
||||
static QSet<QString> testEmptyParamsTree(const QString &distDir = DISTRO_DIR);
|
||||
|
||||
};
|
||||
|
||||
#endif // MODULESQT513_H
|
157
UnitTests/modulesqt514.cpp
Normal file
157
UnitTests/modulesqt514.cpp
Normal file
@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 QuasarApp.
|
||||
* Distributed under the lgplv3 software license, see the accompanying
|
||||
* Everyone is permitted to copy and distribute verbatim copies
|
||||
* of this license document, but changing it is not allowed.
|
||||
*/
|
||||
|
||||
#include "modulesqt514.h"
|
||||
#include <configparser.h>
|
||||
|
||||
ModulesQt514::ModulesQt514()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QSet<QString> ModulesQt514::qtLibs()
|
||||
{
|
||||
TestUtils utils;
|
||||
auto res = ModulesQt513::qtLibs();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
res += utils.createTree({
|
||||
{"./" + DISTRO_DIR + "/Qt5QmlModels.dll"},
|
||||
});
|
||||
#else
|
||||
res += utils.createTree({
|
||||
{"./" + DISTRO_DIR + "/lib/libQt5QmlModels.so"},
|
||||
{"./" + DISTRO_DIR + "/plugins/wayland-graphics-integration-client/libvulkan-server.so"},
|
||||
{"./" + DISTRO_DIR + "/plugins/wayland-graphics-integration-server/libvulkan-server.so"},
|
||||
});
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
QSet<QString> ModulesQt514::qmlLibs()
|
||||
{
|
||||
TestUtils utils;
|
||||
|
||||
auto res = ModulesQt513::qmlLibs();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
res += utils.createTree({
|
||||
{"./" + DISTRO_DIR + "/Qt5QmlModels.dll"},
|
||||
{"./" + DISTRO_DIR + "/Qt5QmlWorkerScript.dll"},
|
||||
});
|
||||
#else
|
||||
res += utils.createTree({
|
||||
{"./" + DISTRO_DIR + "/lib/libQt5QmlModels.so"},
|
||||
{"./" + DISTRO_DIR + "/lib/libQt5QmlWorkerScript.so"},
|
||||
{"./" + DISTRO_DIR + "/plugins/wayland-graphics-integration-client/libvulkan-server.so"},
|
||||
{"./" + DISTRO_DIR + "/plugins/wayland-graphics-integration-server/libvulkan-server.so"},
|
||||
});
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
QSet<QString> ModulesQt514::qmlLibsExtractPlugins()
|
||||
{
|
||||
auto res = ModulesQt513::qmlLibsExtractPlugins();
|
||||
return res;
|
||||
}
|
||||
|
||||
QSet<QString> ModulesQt514::separetedPackageslibs()
|
||||
{
|
||||
TestUtils utils;
|
||||
auto res = ModulesQt513::separetedPackageslibs();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
res += utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/lolLib/Qt5QmlModels.dll",
|
||||
"./" + DISTRO_DIR + "/package2/Qt5QmlModels.dll",
|
||||
"./" + DISTRO_DIR + "/package2/Qt5QmlWorkerScript.dll",
|
||||
}
|
||||
);
|
||||
#else
|
||||
res += utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/lolLib/libQt5QmlModels.so",
|
||||
"./" + DISTRO_DIR + "/p/wayland-graphics-integration-client/libvulkan-server.so",
|
||||
"./" + DISTRO_DIR + "/p/wayland-graphics-integration-server/libvulkan-server.so",
|
||||
"./" + DISTRO_DIR + "/package2/lib/libQt5QmlModels.so",
|
||||
"./" + DISTRO_DIR + "/package2/lib/libQt5QmlWorkerScript.so",
|
||||
"./" + DISTRO_DIR + "/package2/plugins/wayland-graphics-integration-client/libvulkan-server.so",
|
||||
"./" + DISTRO_DIR + "/package2/plugins/wayland-graphics-integration-server/libvulkan-server.so",
|
||||
}
|
||||
);
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
QSet<QString> ModulesQt514::outTestLibs()
|
||||
{
|
||||
TestUtils utils;
|
||||
auto res = ModulesQt513::outTestLibs();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
res += utils.createTree({
|
||||
"./" + DISTRO_DIR + "/lolLib/Qt5QmlModels.dll",
|
||||
"./" + DISTRO_DIR + "/lolLib/Qt5QmlWorkerScript.dll",
|
||||
});
|
||||
#else
|
||||
res += utils.createTree({
|
||||
"./" + DISTRO_DIR + "/lolLib/libQt5QmlModels.so",
|
||||
"./" + DISTRO_DIR + "/lolLib/libQt5QmlWorkerScript.so",
|
||||
"./" + DISTRO_DIR + "/p/wayland-graphics-integration-client/libvulkan-server.so",
|
||||
"./" + DISTRO_DIR + "/p/wayland-graphics-integration-server/libvulkan-server.so"
|
||||
});
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
QSet<QString> ModulesQt514::qtWithoutTr()
|
||||
{
|
||||
TestUtils utils;
|
||||
auto res = ModulesQt513::qtWithoutTr();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
res += utils.createTree({
|
||||
{"./" + DISTRO_DIR + "/Qt5QmlModels.dll"},
|
||||
});
|
||||
#else
|
||||
res += utils.createTree({
|
||||
{"./" + DISTRO_DIR + "/lib/libQt5QmlModels.so"},
|
||||
{"./" + DISTRO_DIR + "/plugins/wayland-graphics-integration-client/libvulkan-server.so"},
|
||||
{"./" + DISTRO_DIR + "/plugins/wayland-graphics-integration-server/libvulkan-server.so"},
|
||||
});
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
QSet<QString> ModulesQt514::qtWebEngine()
|
||||
{
|
||||
TestUtils utils;
|
||||
|
||||
auto res = ModulesQt513::qtWebEngine();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#else
|
||||
res += utils.createTree({
|
||||
"./" + DISTRO_DIR + "/lib/libQt5QmlModels.so",
|
||||
"./" + DISTRO_DIR + "/lib/libQt5QmlWorkerScript.so",
|
||||
"./" + DISTRO_DIR + "/plugins/wayland-graphics-integration-client/libvulkan-server.so",
|
||||
"./" + DISTRO_DIR + "/plugins/wayland-graphics-integration-server/libvulkan-server.so",
|
||||
"./" + DISTRO_DIR + "/qml/QtQml/WorkerScript.2/libworkerscriptplugin.so",
|
||||
"./" + DISTRO_DIR + "/qml/QtQml/WorkerScript.2/plugins.qmltypes",
|
||||
"./" + DISTRO_DIR + "/qml/QtQml/WorkerScript.2/qmldir",
|
||||
"./" + DISTRO_DIR + "/qml/QtQml/libqmlplugin.so"
|
||||
});
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
28
UnitTests/modulesqt514.h
Normal file
28
UnitTests/modulesqt514.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 QuasarApp.
|
||||
* Distributed under the lgplv3 software license, see the accompanying
|
||||
* Everyone is permitted to copy and distribute verbatim copies
|
||||
* of this license document, but changing it is not allowed.
|
||||
*/
|
||||
|
||||
#ifndef MODULESQT514_H
|
||||
#define MODULESQT514_H
|
||||
#include "modulesqt513.h"
|
||||
|
||||
class ModulesQt514 : public ModulesQt513
|
||||
{
|
||||
public:
|
||||
ModulesQt514();
|
||||
|
||||
static QSet<QString> qtLibs();
|
||||
static QSet<QString> qmlLibs();
|
||||
static QSet<QString> qmlLibsExtractPlugins();
|
||||
static QSet<QString> separetedPackageslibs();
|
||||
|
||||
static QSet<QString> outTestLibs();
|
||||
|
||||
static QSet<QString> qtWithoutTr();
|
||||
static QSet<QString> qtWebEngine();
|
||||
};
|
||||
|
||||
#endif // MODULESQT514_H
|
@ -94,15 +94,15 @@ private slots:
|
||||
// tested flags binDir
|
||||
void testBinDir();
|
||||
|
||||
// tested flags qmlDir qmake
|
||||
void testQt();
|
||||
|
||||
// tested flags confFile
|
||||
void testConfFile();
|
||||
|
||||
// tested flags targetPackage
|
||||
void testPackages();
|
||||
|
||||
// tested flags qmlDir qmake
|
||||
void testQt();
|
||||
|
||||
// tested clear force clear in clear mode
|
||||
void testClear();
|
||||
|
||||
@ -768,7 +768,8 @@ void deploytest::testRelativeLink() {
|
||||
void deploytest::testCheckQt() {
|
||||
|
||||
Deploy *deployer = new Deploy();
|
||||
QuasarAppUtils::Params::parseParams({"-binDir", TestBinDir, "clear", "noAutoCheckQmake"});
|
||||
QuasarAppUtils::Params::parseParams({"-binDir", TestBinDir, "clear",
|
||||
"noCheckRPATH", "noCheckPATH"});
|
||||
QVERIFY(deployer->prepare());
|
||||
|
||||
|
||||
@ -880,7 +881,8 @@ void deploytest::runTestParams(const QStringList &list, QSet<QString>* tree,
|
||||
QuasarAppUtils::Params::parseParams(list);
|
||||
|
||||
Deploy deploy;
|
||||
QVERIFY(deploy.run() == Good);
|
||||
if (deploy.run() != Good)
|
||||
QVERIFY(false);
|
||||
|
||||
if (tree) {
|
||||
checkResults(*tree, noWarnings, onlySize);
|
||||
@ -1143,7 +1145,7 @@ void deploytest::testBinDir() {
|
||||
|
||||
|
||||
runTestParams({"-binDir", TestBinDir, "clear",
|
||||
"noAutoCheckQmake"}, &comapareTree);
|
||||
"noCheckRPATH", "noCheckPATH"}, &comapareTree);
|
||||
}
|
||||
|
||||
void deploytest::testConfFile() {
|
||||
@ -1176,7 +1178,7 @@ void deploytest::testConfFile() {
|
||||
"./" + DISTRO_DIR + "/quicknanobrowser.sh"});
|
||||
#endif
|
||||
|
||||
runTestParams({"-bin", TestBinDir, "clear" , "noAutoCheckQmake",
|
||||
runTestParams({"-bin", TestBinDir, "clear" , "noCheckRPATH", "noCheckPATH",
|
||||
"-confFile", TestBinDir + "/TestConf.json"}, &comapareTree);
|
||||
|
||||
|
||||
@ -1189,11 +1191,11 @@ void deploytest::testConfFile() {
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC," + TestBinDir + "QtWidgetsProject," + TestBinDir + "TestQMLWidgets",
|
||||
"clear", "noAutoCheckQmake",
|
||||
"clear", "noCheckRPATH", "noCheckPATH",
|
||||
"-confFile", TestBinDir + "/TestConf.json"}, &comapareTree);
|
||||
#else
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC.exe," + TestBinDir + "QtWidgetsProject.exe," + TestBinDir + "TestQMLWidgets.exe",
|
||||
"clear" , "-libDir", "L:/never/absalut/path",
|
||||
"clear" , "-libDir", "L:/never/absalut/path", "noCheckPATH",
|
||||
"-confFile", TestBinDir + "/TestConf.json"}, &comapareTree);
|
||||
#endif
|
||||
|
||||
@ -1251,11 +1253,11 @@ void deploytest::testConfFile() {
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC," + TestBinDir + "QtWidgetsProject," + TestBinDir + "TestQMLWidgets",
|
||||
"clear" , "noAutoCheckQmake",
|
||||
"clear" , "noCheckRPATH", "noCheckPATH",
|
||||
"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"}, &comapareTree);
|
||||
#else
|
||||
runTestParams({"-bin", TestBinDir + "TestOnlyC.exe," + TestBinDir + "QtWidgetsProject.exe," + TestBinDir + "TestQMLWidgets.exe",
|
||||
"clear" ,
|
||||
"clear" , "noCheckPATH",
|
||||
"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"}, &comapareTree);
|
||||
#endif
|
||||
|
||||
@ -1357,7 +1359,7 @@ void deploytest::testConfFile() {
|
||||
bin = target1;
|
||||
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-targetPackage", "package;Test",
|
||||
"-targetPackage", "package;TestOn",
|
||||
"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"}, &comapareTree);
|
||||
|
||||
runTestParams({"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"},
|
||||
@ -1392,7 +1394,7 @@ void deploytest::testPackages() {
|
||||
QString bin = target1;
|
||||
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-targetPackage", "/package/;Test"}, &comapareTree);
|
||||
"-targetPackage", "/package/;TestOn"}, &comapareTree);
|
||||
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-targetPackage", "/package/;" + QFileInfo(target1).absoluteFilePath()}, &comapareTree);
|
||||
@ -1422,6 +1424,8 @@ void deploytest::testPackages() {
|
||||
"-qmlDir", "package2;" + TestBinDir + "/../TestQMLWidgets",
|
||||
"-targetPackage", packageString}, &comapareTree);
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
|
||||
comapareTree -= utils.createTree({
|
||||
"./" + DISTRO_DIR + "/package2/bin/TestQMLWidgets",
|
||||
"./" + DISTRO_DIR + "/package2/bin/qt.conf",
|
||||
@ -1431,6 +1435,18 @@ void deploytest::testPackages() {
|
||||
"./" + DISTRO_DIR + "/package2/testBin/TestQMLWidgets",
|
||||
"./" + DISTRO_DIR + "/package2/testBin/qt.conf",
|
||||
});
|
||||
#else
|
||||
comapareTree -= utils.createTree({
|
||||
"./" + DISTRO_DIR + "/package2/TestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/package2/qt.conf",
|
||||
});
|
||||
|
||||
comapareTree += utils.createTree({
|
||||
"./" + DISTRO_DIR + "/package2/testBin/TestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/package2/TestQMLWidgets.bat",
|
||||
"./" + DISTRO_DIR + "/package2/testBin/qt.conf",
|
||||
});
|
||||
#endif
|
||||
|
||||
runTestParams({"-bin", bin, "force-clear",
|
||||
"-binOut", "package2;/testBin,lol",
|
||||
@ -1480,6 +1496,14 @@ void deploytest::testQt() {
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake}, &comapareTree);
|
||||
|
||||
// test auto detection of detection qmake from PATH
|
||||
runTestParams({"-bin", bin, "clear", "noCheckRPATH"}, &comapareTree);
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
// test auto detection of detection qmake from RPATH
|
||||
runTestParams({"-bin", bin, "clear", "noCheckPATH"}, &comapareTree);
|
||||
#endif
|
||||
|
||||
comapareTree = Modules::qtWithoutTr();
|
||||
|
||||
|
||||
@ -2017,6 +2041,17 @@ void deploytest::testSystemLib() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
comapareTree += utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/d3d11.dll",
|
||||
"./" + DISTRO_DIR + "/dxgi.dll",
|
||||
"./" + DISTRO_DIR + "/win32u.dll",
|
||||
});
|
||||
#endif
|
||||
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"deploySystem"
|
||||
|
@ -72,7 +72,8 @@ cqtdeployer -option1 value1 -option2 list, of, values flag1 flag2 flag3
|
||||
| | It doesn't work without qmake and inside a snap package |
|
||||
| extractPlugins | This flag will cause cqtdeployer to retrieve dependencies from plugins. Starting with version 1.4, this option has been disabled by default, as it can add low-level graphics libraries to the distribution, which will not be compatible with equipment on users' hosts. |
|
||||
| noOverwrite | Prevents replacing existing files. |
|
||||
| noAutoCheckQmake | Disables automatic search of paths to qmake in executable files.|
|
||||
| noCheckRPATH | Disables automatic search of paths to qmake in executable files.|
|
||||
| noCheckPATH | Disables automatic search of paths to qmake in system PATH. |
|
||||
| v / version | Shows compiled version |
|
||||
|
||||
|
||||
@ -155,7 +156,8 @@ cqtdeployer -option1 value1 -option2 list,of,values flag1 flag2 flag3
|
||||
| noTranslations | Пропускает файлы переводов |
|
||||
| | не работает без qmake и в snap |
|
||||
| noOverwrite | Запрещает замену уже существующих файлов. |
|
||||
| noAutoCheckQmake | Отключает автоматический поиск путей к qmake в исполняемых файлах.|
|
||||
| noCheckRPATH | Отключает автоматический поиск путей к qmake в исполняемых файлах.|
|
||||
| noCheckPATH | Отключает автоматический поиск путей к qmake в системном окружении. |
|
||||
| v / version | Показывает версию приложения |
|
||||
|
||||
|
||||
|
2
test.pri
2
test.pri
@ -12,7 +12,7 @@ deployTest.commands = cqtdeployer -bin $$exec clear -qmake $$QMAKE_BIN -targetDi
|
||||
|
||||
test.depends = deployTest
|
||||
unix:!android:test.commands = $$PWD/deployTests/UnitTests.sh -maxwarnings 100000
|
||||
win32:test.commands = $$PWD/deployTests/UnitTests.exe -maxwarnings 100000
|
||||
win32:test.commands = $$PWD/deployTests/UnitTests.exe -maxwarnings 100000 -o $$PWD/buildLog.log
|
||||
|
||||
contains(QMAKE_HOST.os, Linux):{
|
||||
win32:test.commands =
|
||||
|
Loading…
x
Reference in New Issue
Block a user