mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-29 19:24:33 +00:00
Merge branch 'v1.5' of github.com:QuasarApp/CQtDeployer into v1.5
This commit is contained in:
commit
d9eb258d2e
@ -63,6 +63,7 @@ SOURCES += \
|
|||||||
extracter.cpp \
|
extracter.cpp \
|
||||||
filemanager.cpp \
|
filemanager.cpp \
|
||||||
Distributions/idistribution.cpp \
|
Distributions/idistribution.cpp \
|
||||||
|
generalfiles_type.cpp \
|
||||||
ignorerule.cpp \
|
ignorerule.cpp \
|
||||||
metafilemanager.cpp \
|
metafilemanager.cpp \
|
||||||
packagecontrol.cpp \
|
packagecontrol.cpp \
|
||||||
@ -101,6 +102,7 @@ HEADERS += \
|
|||||||
extracter.h \
|
extracter.h \
|
||||||
filemanager.h \
|
filemanager.h \
|
||||||
Distributions/idistribution.h \
|
Distributions/idistribution.h \
|
||||||
|
generalfiles_type.h \
|
||||||
ignorerule.h \
|
ignorerule.h \
|
||||||
metafilemanager.h \
|
metafilemanager.h \
|
||||||
packagecontrol.h \
|
packagecontrol.h \
|
||||||
|
@ -1458,7 +1458,7 @@ bool ConfigParser::smartMoveTargets() {
|
|||||||
for (auto i = _config.targets().cbegin(); i != _config.targets().cend(); ++i) {
|
for (auto i = _config.targets().cbegin(); i != _config.targets().cend(); ++i) {
|
||||||
|
|
||||||
if (!i.value().isValid()) {
|
if (!i.value().isValid()) {
|
||||||
QuasarAppUtils::Params::log(QString("Interna error ocurred in %0. Target not inited.").arg(__FUNCTION__),
|
QuasarAppUtils::Params::log(QString("Internal error ocurred in %0. Target not inited.").arg(__FUNCTION__),
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
QuasarAppUtils::Params::log(QString("If you see this message please create a new issue"
|
QuasarAppUtils::Params::log(QString("If you see this message please create a new issue"
|
||||||
" about this problem on the official github page"
|
" about this problem on the official github page"
|
||||||
|
@ -90,10 +90,13 @@ bool DependenciesScanner::fillLibInfo(LibInfo &info, const QString &file) const
|
|||||||
case PrivateScaner::PE: {
|
case PrivateScaner::PE: {
|
||||||
return _peScaner.getLibInfo(file, info);
|
return _peScaner.getLibInfo(file, info);
|
||||||
}
|
}
|
||||||
case PrivateScaner::ELF:
|
|
||||||
return _elfScaner.getLibInfo(file, info);
|
|
||||||
|
|
||||||
default: return false;
|
case PrivateScaner::ELF: {
|
||||||
|
return _elfScaner.getLibInfo(file, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return _filesScaner.getLibInfo(file, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "pe_type.h"
|
#include "pe_type.h"
|
||||||
#include "elf_type.h"
|
#include "elf_type.h"
|
||||||
#include "libinfo.h"
|
#include "libinfo.h"
|
||||||
|
#include "generalfiles_type.h"
|
||||||
|
|
||||||
|
|
||||||
enum class PrivateScaner: unsigned char {
|
enum class PrivateScaner: unsigned char {
|
||||||
@ -32,6 +33,7 @@ private:
|
|||||||
|
|
||||||
PE _peScaner;
|
PE _peScaner;
|
||||||
ELF _elfScaner;
|
ELF _elfScaner;
|
||||||
|
GeneralFiles _filesScaner;
|
||||||
|
|
||||||
PrivateScaner getScaner(const QString& lib) const;
|
PrivateScaner getScaner(const QString& lib) const;
|
||||||
|
|
||||||
|
@ -91,7 +91,9 @@ bool Deploy::deploy() {
|
|||||||
|
|
||||||
switch (DeployCore::getMode() ) {
|
switch (DeployCore::getMode() ) {
|
||||||
case RunMode::Deploy:
|
case RunMode::Deploy:
|
||||||
_extracter->deploy();
|
if (!_extracter->deploy())
|
||||||
|
return false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -18,7 +18,7 @@ ELF::ELF()
|
|||||||
QByteArrayList ELF::getDynamicString(ElfReader& reader) const {
|
QByteArrayList ELF::getDynamicString(ElfReader& reader) const {
|
||||||
auto headers = reader.readHeaders();
|
auto headers = reader.readHeaders();
|
||||||
|
|
||||||
for (const auto §ionHeader : headers.sectionHeaders) {
|
for (const auto §ionHeader : qAsConst(headers.sectionHeaders)) {
|
||||||
if (sectionHeader.name == ".dynstr") {
|
if (sectionHeader.name == ".dynstr") {
|
||||||
auto arr = reader.readSection(sectionHeader.name).split(0);
|
auto arr = reader.readSection(sectionHeader.name).split(0);
|
||||||
return arr;
|
return arr;
|
||||||
|
@ -262,10 +262,13 @@ void Extracter::copyTr() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extracter::deploy() {
|
bool Extracter::deploy() {
|
||||||
QuasarAppUtils::Params::log("target deploy started!!",
|
QuasarAppUtils::Params::log("target deploy started!!",
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
_cqt->smartMoveTargets();
|
if (!_cqt->smartMoveTargets()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
_scaner->setEnvironment(DeployCore::_config->envirement.environmentList());
|
_scaner->setEnvironment(DeployCore::_config->envirement.environmentList());
|
||||||
extractAllTargets();
|
extractAllTargets();
|
||||||
extractExtraDataTargets();
|
extractExtraDataTargets();
|
||||||
@ -283,6 +286,7 @@ void Extracter::deploy() {
|
|||||||
|
|
||||||
if (!extractWebEngine()) {
|
if (!extractWebEngine()) {
|
||||||
QuasarAppUtils::Params::log("deploy webEngine failed", QuasarAppUtils::Error);
|
QuasarAppUtils::Params::log("deploy webEngine failed", QuasarAppUtils::Error);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!deployMSVC()) {
|
if (!deployMSVC()) {
|
||||||
@ -293,6 +297,8 @@ void Extracter::deploy() {
|
|||||||
QuasarAppUtils::Params::log("deploy done!",
|
QuasarAppUtils::Params::log("deploy done!",
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Extracter::copyTranslations(const QStringList &list, const QString& package) {
|
bool Extracter::copyTranslations(const QStringList &list, const QString& package) {
|
||||||
|
@ -24,7 +24,7 @@ class DEPLOYSHARED_EXPORT Extracter {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Extracter(FileManager *fileManager, PluginsParser* pluginsParser, ConfigParser * cqt, DependenciesScanner *_scaner);
|
explicit Extracter(FileManager *fileManager, PluginsParser* pluginsParser, ConfigParser * cqt, DependenciesScanner *_scaner);
|
||||||
void deploy();
|
bool deploy();
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
24
Deploy/generalfiles_type.cpp
Normal file
24
Deploy/generalfiles_type.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 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 "generalfiles_type.h"
|
||||||
|
|
||||||
|
GeneralFiles::GeneralFiles()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GeneralFiles::getLibInfo(const QString &lib, LibInfo &info) const {
|
||||||
|
|
||||||
|
QFileInfo fileInfo(lib);
|
||||||
|
|
||||||
|
info.setPlatform(GeneralFile);
|
||||||
|
info.setName(fileInfo.fileName());
|
||||||
|
info.setPath(fileInfo.absolutePath());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
26
Deploy/generalfiles_type.h
Normal file
26
Deploy/generalfiles_type.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 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 GENERALFILES_TYPE_H
|
||||||
|
#define GENERALFILES_TYPE_H
|
||||||
|
|
||||||
|
#include "igetlibinfo.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The GeneralFiles class intendet for extract information of general files.
|
||||||
|
* This is defautl extracte for unknown files types.
|
||||||
|
*/
|
||||||
|
class GeneralFiles: public IGetLibInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GeneralFiles();
|
||||||
|
|
||||||
|
// IGetLibInfo interface
|
||||||
|
bool getLibInfo(const QString &lib, LibInfo &info) const override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GENERALFILES_TYPE_H
|
@ -175,6 +175,7 @@ private slots:
|
|||||||
|
|
||||||
void testRunScripts();
|
void testRunScripts();
|
||||||
void testGetDefaultTemplate();
|
void testGetDefaultTemplate();
|
||||||
|
void testDeployGeneralFiles();
|
||||||
|
|
||||||
void customTest();
|
void customTest();
|
||||||
};
|
};
|
||||||
@ -1147,6 +1148,25 @@ void deploytest::testGetDefaultTemplate() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deploytest::testDeployGeneralFiles() {
|
||||||
|
TestUtils utils;
|
||||||
|
|
||||||
|
QString bin = TestBinDir + "/../../CMakeLists.txt";
|
||||||
|
|
||||||
|
auto comapareTree = utils.createTree(
|
||||||
|
{
|
||||||
|
"./" + DISTRO_DIR + "/bin/CMakeLists.txt",
|
||||||
|
"./" + DISTRO_DIR + "/bin/qt.conf",
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
runTestParams(
|
||||||
|
{"-bin", bin,
|
||||||
|
"-binOut", "bin",
|
||||||
|
"force-clear"
|
||||||
|
}, &comapareTree);
|
||||||
|
}
|
||||||
|
|
||||||
void deploytest::customTest() {
|
void deploytest::customTest() {
|
||||||
// runTestParams({"-confFile", "path",
|
// runTestParams({"-confFile", "path",
|
||||||
// "qifFromSystem"});
|
// "qifFromSystem"});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user