mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-21 05:49:36 +00:00
commit
eaf94eb69f
@ -15,6 +15,7 @@
|
|||||||
#include "filemanager.h"
|
#include "filemanager.h"
|
||||||
#include "packing.h"
|
#include "packing.h"
|
||||||
#include "pathutils.h"
|
#include "pathutils.h"
|
||||||
|
#include "pluginsparser.h"
|
||||||
#include "quasarapp.h"
|
#include "quasarapp.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -32,27 +33,27 @@
|
|||||||
|
|
||||||
static QString defaultPackage = "";
|
static QString defaultPackage = "";
|
||||||
|
|
||||||
template<typename Container, typename Setter>
|
template<typename Container, typename Adder>
|
||||||
bool parsePackagesPrivate(Container& mainContainer,
|
bool parsePackagesPrivate(Container& mainContainer,
|
||||||
const QStringList &inputParamsList,
|
const QStringList &inputParamsList,
|
||||||
Setter setter) {
|
Adder adder) {
|
||||||
|
|
||||||
for (const auto& str: inputParamsList) {
|
for (const auto& str: inputParamsList) {
|
||||||
auto pair = str.split(DeployCore::getSeparator(1));
|
auto paramsList = str.split(DeployCore::getSeparator(1));
|
||||||
auto first = pair.value(0, "");
|
auto first = paramsList.value(0, "");
|
||||||
auto second = pair.value(1, "");
|
auto second = paramsList.value(1, "");
|
||||||
if (pair.size() == 1)
|
if (paramsList.size() == 1)
|
||||||
(mainContainer[defaultPackage].*setter)(first);
|
(mainContainer[defaultPackage].*adder)(first);
|
||||||
else {
|
else {
|
||||||
first = PathUtils::fullStripPath(first);
|
first = PathUtils::fullStripPath(first);
|
||||||
if (!mainContainer.contains(first)) {
|
if (!mainContainer.contains(first)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
(mainContainer[first].*setter)(second);
|
for (int i = 1; i < paramsList.size(); ++i) {
|
||||||
|
(mainContainer[first].*adder)(paramsList[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -535,12 +536,11 @@ bool ConfigParser::parseDeployMode() {
|
|||||||
auto listNamesMasks = QuasarAppUtils::Params::getStrArg("extraLibs").
|
auto listNamesMasks = QuasarAppUtils::Params::getStrArg("extraLibs").
|
||||||
split(DeployCore::getSeparator(0));
|
split(DeployCore::getSeparator(0));
|
||||||
|
|
||||||
auto listExtraPlugin = QuasarAppUtils::Params::getStrArg("extraPlugin").
|
|
||||||
split(DeployCore::getSeparator(0));
|
|
||||||
|
|
||||||
setExtraPath(listLibDir);
|
setExtraPath(listLibDir);
|
||||||
setExtraNames(listNamesMasks);
|
setExtraNames(listNamesMasks);
|
||||||
setExtraPlugins(listExtraPlugin);
|
initPlugins();
|
||||||
|
|
||||||
if (!initQmake()) {
|
if (!initQmake()) {
|
||||||
return false;
|
return false;
|
||||||
@ -1110,11 +1110,46 @@ void ConfigParser::setExtraNames(const QStringList &value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigParser::setExtraPlugins(const QStringList &value) {
|
bool ConfigParser::initPlugins() {
|
||||||
for (const auto &i : value) {
|
|
||||||
if (!i.isEmpty())
|
auto listExtraPlugin = QuasarAppUtils::Params::getStrArg("extraPlugin").
|
||||||
_config.extraPlugins.append(i);
|
split(DeployCore::getSeparator(0), QString::SkipEmptyParts);
|
||||||
|
|
||||||
|
auto listEnablePlugins = QuasarAppUtils::Params::getStrArg("enablePlugins").
|
||||||
|
split(DeployCore::getSeparator(0), QString::SkipEmptyParts);
|
||||||
|
|
||||||
|
auto listDisablePlugins = QuasarAppUtils::Params::getStrArg("disablePlugins").
|
||||||
|
split(DeployCore::getSeparator(0), QString::SkipEmptyParts);
|
||||||
|
|
||||||
|
auto erroLog = [](const QString &flag){
|
||||||
|
QuasarAppUtils::Params::log(QString("Set %0 fail, because you try set %0 for not inited package."
|
||||||
|
" Use 'targetPackage' flag for init the packages").arg(flag),
|
||||||
|
QuasarAppUtils::Error);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (listExtraPlugin.size() && !parsePackagesPrivate(_config.packagesEdit(),
|
||||||
|
listExtraPlugin,
|
||||||
|
&DistroModule::addExtraPlugins)) {
|
||||||
|
erroLog("extra plugins");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (listEnablePlugins.size() && !parsePackagesPrivate(_config.packagesEdit(),
|
||||||
|
listEnablePlugins,
|
||||||
|
&DistroModule::addEnabledPlugins)) {
|
||||||
|
erroLog("enable plugins");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listDisablePlugins.size() && !parsePackagesPrivate(_config.packagesEdit(),
|
||||||
|
listDisablePlugins,
|
||||||
|
&DistroModule::addDisabledPlugins)) {
|
||||||
|
erroLog("disable plugins");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ConfigParser::findWindowsPath(const QString& path) const {
|
QString ConfigParser::findWindowsPath(const QString& path) const {
|
||||||
@ -1222,12 +1257,14 @@ bool ConfigParser::smartMoveTargets() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigParser::ConfigParser(FileManager *filemanager, DependenciesScanner* scaner, Packing *pac):
|
ConfigParser::ConfigParser(FileManager *filemanager, PluginsParser *pluginsParser, DependenciesScanner* scaner, Packing *pac):
|
||||||
_fileManager(filemanager),
|
_fileManager(filemanager),
|
||||||
|
_pluginsParser(pluginsParser),
|
||||||
_scaner(scaner),
|
_scaner(scaner),
|
||||||
_packing(pac) {
|
_packing(pac) {
|
||||||
|
|
||||||
assert(_fileManager);
|
assert(_fileManager);
|
||||||
|
assert(_pluginsParser);
|
||||||
assert(_scaner);
|
assert(_scaner);
|
||||||
assert(_packing);
|
assert(_packing);
|
||||||
|
|
||||||
|
@ -25,13 +25,23 @@ class FileManager;
|
|||||||
class DependenciesScanner;
|
class DependenciesScanner;
|
||||||
class Packing;
|
class Packing;
|
||||||
class iDistribution;
|
class iDistribution;
|
||||||
|
class PluginsParser;
|
||||||
|
|
||||||
class DEPLOYSHARED_EXPORT ConfigParser
|
class DEPLOYSHARED_EXPORT ConfigParser
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
ConfigParser(FileManager *filemanager, PluginsParser* pluginsParser, DependenciesScanner *scaner, Packing* pac);
|
||||||
|
bool parseParams();
|
||||||
|
bool smartMoveTargets();
|
||||||
|
|
||||||
|
const DeployConfig* config() const;
|
||||||
|
friend class deploytest;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
DeployConfig _config;
|
DeployConfig _config;
|
||||||
FileManager *_fileManager;
|
FileManager *_fileManager;
|
||||||
|
PluginsParser *_pluginsParser;
|
||||||
DependenciesScanner *_scaner;
|
DependenciesScanner *_scaner;
|
||||||
Packing * _packing;
|
Packing * _packing;
|
||||||
|
|
||||||
@ -68,7 +78,7 @@ private:
|
|||||||
void setExtraPath(const QStringList &value);
|
void setExtraPath(const QStringList &value);
|
||||||
void setExtraNames(const QStringList &value);
|
void setExtraNames(const QStringList &value);
|
||||||
|
|
||||||
void setExtraPlugins(const QStringList &value);
|
bool initPlugins();
|
||||||
|
|
||||||
void initEnvirement();
|
void initEnvirement();
|
||||||
|
|
||||||
@ -91,14 +101,6 @@ private:
|
|||||||
iDistribution* getDistribution();
|
iDistribution* getDistribution();
|
||||||
|
|
||||||
bool isNeededQt() const;
|
bool isNeededQt() const;
|
||||||
public:
|
|
||||||
ConfigParser(FileManager *filemanager, DependenciesScanner *scaner, Packing* pac);
|
|
||||||
bool parseParams();
|
|
||||||
bool smartMoveTargets();
|
|
||||||
|
|
||||||
const DeployConfig* config() const;
|
|
||||||
friend class deploytest;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CQT_H
|
#endif // CQT_H
|
||||||
|
@ -47,21 +47,31 @@ QMultiMap<LibPriority, LibInfo> DependenciesScanner::getLibsFromEnvirement(
|
|||||||
for (const auto & lib : values) {
|
for (const auto & lib : values) {
|
||||||
LibInfo info;
|
LibInfo info;
|
||||||
|
|
||||||
auto priority = (DeployCore::getLibPriority(lib));
|
if (_scanedLibs.contains(lib)) {
|
||||||
|
info = _scanedLibs.value(lib);
|
||||||
|
|
||||||
if ((priority >= SystemLib) && !QuasarAppUtils::Params::isEndable("deploySystem")) {
|
if ((info.priority >= SystemLib) && !QuasarAppUtils::Params::isEndable("deploySystem")) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
auto priority = (DeployCore::getLibPriority(lib));
|
||||||
|
|
||||||
|
if ((priority >= SystemLib) && !QuasarAppUtils::Params::isEndable("deploySystem")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
info.setPriority(priority);
|
||||||
|
|
||||||
|
if (!fillLibInfo(info, lib)) {
|
||||||
|
QuasarAppUtils::Params::log(
|
||||||
|
"error extract lib info from " + lib + "(" + libName + ")",
|
||||||
|
QuasarAppUtils::VerboseLvl::Warning);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fillLibInfo(info, lib)) {
|
|
||||||
QuasarAppUtils::Params::log(
|
|
||||||
"error extract lib info from " + lib + "(" + libName + ")",
|
|
||||||
QuasarAppUtils::VerboseLvl::Warning);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
info.setPriority(priority);
|
|
||||||
|
|
||||||
if (!DeployCore::_config->ignoreList.isIgnore(info)) {
|
if (!DeployCore::_config->ignoreList.isIgnore(info)) {
|
||||||
res.insertMulti(info.getPriority(), info);
|
res.insertMulti(info.getPriority(), info);
|
||||||
}
|
}
|
||||||
|
@ -10,13 +10,16 @@
|
|||||||
#include "extracter.h"
|
#include "extracter.h"
|
||||||
#include "filemanager.h"
|
#include "filemanager.h"
|
||||||
#include "packing.h"
|
#include "packing.h"
|
||||||
|
#include "pluginsparser.h"
|
||||||
#include <quasarapp.h>
|
#include <quasarapp.h>
|
||||||
|
|
||||||
Deploy::Deploy() {
|
Deploy::Deploy() {
|
||||||
_fileManager = new FileManager();
|
_fileManager = new FileManager();
|
||||||
_scaner = new DependenciesScanner();
|
_scaner = new DependenciesScanner();
|
||||||
_packing = new Packing();
|
_packing = new Packing();
|
||||||
_paramsParser = new ConfigParser(_fileManager, _scaner, _packing);
|
_pluginParser = new PluginsParser();
|
||||||
|
|
||||||
|
_paramsParser = new ConfigParser(_fileManager, _pluginParser, _scaner, _packing);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,6 +66,10 @@ Deploy::~Deploy() {
|
|||||||
delete _packing;
|
delete _packing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_pluginParser) {
|
||||||
|
delete _pluginParser;
|
||||||
|
}
|
||||||
|
|
||||||
DeployCore::_config = nullptr;
|
DeployCore::_config = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +80,7 @@ bool Deploy::prepare() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_extracter = new Extracter(_fileManager, _paramsParser, _scaner);
|
_extracter = new Extracter(_fileManager, _pluginParser, _paramsParser, _scaner);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ class ConfigParser;
|
|||||||
class Extracter;
|
class Extracter;
|
||||||
class FileManager;
|
class FileManager;
|
||||||
class DependenciesScanner;
|
class DependenciesScanner;
|
||||||
|
class PluginsParser;
|
||||||
class Packing;
|
class Packing;
|
||||||
|
|
||||||
enum exitCodes {
|
enum exitCodes {
|
||||||
@ -34,6 +35,8 @@ private:
|
|||||||
Extracter *_extracter = nullptr;
|
Extracter *_extracter = nullptr;
|
||||||
FileManager *_fileManager = nullptr;
|
FileManager *_fileManager = nullptr;
|
||||||
DependenciesScanner *_scaner = nullptr;
|
DependenciesScanner *_scaner = nullptr;
|
||||||
|
PluginsParser *_pluginParser = nullptr;
|
||||||
|
|
||||||
Packing *_packing = nullptr;
|
Packing *_packing = nullptr;
|
||||||
|
|
||||||
bool prepare();
|
bool prepare();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "deployconfig.h"
|
#include "deployconfig.h"
|
||||||
|
#include "quasarapp.h"
|
||||||
|
|
||||||
void DeployConfig::reset() {
|
void DeployConfig::reset() {
|
||||||
*this = DeployConfig{};
|
*this = DeployConfig{};
|
||||||
@ -55,6 +56,29 @@ QHash<QString, DistroModule> &DeployConfig::packagesEdit() {
|
|||||||
return _packages;
|
return _packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Platform DeployConfig::getPlatform(const QString& package) const {
|
||||||
|
Platform result = Platform::UnknownPlatform;
|
||||||
|
|
||||||
|
if (_packages.contains(package)) {
|
||||||
|
auto disto = getDistroFromPackage(package);
|
||||||
|
|
||||||
|
for( auto it = disto.targets().cbegin(); it != disto.targets().cend(); ++it) {
|
||||||
|
result = result | _targets.value(*it).getPlatform();
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for( auto it = _targets.cbegin(); it != _targets.cend(); ++it) {
|
||||||
|
result = result | it.value().getPlatform();
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const QHash<QString, TargetInfo> &DeployConfig::targets() const {
|
const QHash<QString, TargetInfo> &DeployConfig::targets() const {
|
||||||
return _targets;
|
return _targets;
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
IgnoreRule ignoreList;
|
IgnoreRule ignoreList;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief extraPlugins - list with pathes of extra plugins or plugins names
|
|
||||||
*/
|
|
||||||
QStringList extraPlugins;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief appDir - it is cqtdeployer library location for ignre cqtdeployr libraries
|
* @brief appDir - it is cqtdeployer library location for ignre cqtdeployr libraries
|
||||||
*/
|
*/
|
||||||
@ -91,6 +86,8 @@ public:
|
|||||||
QHash<QString, TargetInfo>& targetsEdit();
|
QHash<QString, TargetInfo>& targetsEdit();
|
||||||
QHash<QString, DistroModule>& packagesEdit();
|
QHash<QString, DistroModule>& packagesEdit();
|
||||||
|
|
||||||
|
Platform getPlatform(const QString& package) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "deploycore.h"
|
#include "deploycore.h"
|
||||||
#include "quasarapp.h"
|
#include "quasarapp.h"
|
||||||
#include "pathutils.h"
|
#include "pathutils.h"
|
||||||
|
#include "pluginsparser.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@ -190,7 +191,8 @@ void DeployCore::help() {
|
|||||||
{"qif", "Create the QIF installer for deployement programm"},
|
{"qif", "Create the QIF installer for deployement programm"},
|
||||||
{"qifFromSystem", "force use system binarycreator tool of qif from path or qt"},
|
{"qifFromSystem", "force use system binarycreator tool of qif from path or qt"},
|
||||||
{"deploySystem", "Deploys all libraries (do not work in snap )"},
|
{"deploySystem", "Deploys all libraries (do not work in snap )"},
|
||||||
{"deploySystem-with-libc", "deploy all libs libs (only linux) (do not work in snap )"},
|
{"deploySystem-with-libc", "deploy all libs (only linux) (do not work in snap )"},
|
||||||
|
{"allPlatforms", "deploy all platforms plugins (big size)."},
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -211,7 +213,6 @@ void DeployCore::help() {
|
|||||||
" Example: '-extraLibs mySql' - forces to copy all libraries whose names contain mySql to the project folder."
|
" Example: '-extraLibs mySql' - forces to copy all libraries whose names contain mySql to the project folder."
|
||||||
" This option is case sensitive."},
|
" This option is case sensitive."},
|
||||||
{"-customScript [scriptCode]", "Insert extra code inTo All run script."},
|
{"-customScript [scriptCode]", "Insert extra code inTo All run script."},
|
||||||
{"-extraPlugin [list,params]", "Sets an additional path to extraPlugin of an app"},
|
|
||||||
{"-recursiveDepth [params]", "Sets the Depth of recursive search of libs and depth for ignoreEnv option (default 0)"},
|
{"-recursiveDepth [params]", "Sets the Depth of recursive search of libs and depth for ignoreEnv option (default 0)"},
|
||||||
{"-targetDir [params]", "Sets target directory(by default it is the path to the first deployable file)"},
|
{"-targetDir [params]", "Sets target directory(by default it is the path to the first deployable file)"},
|
||||||
{"-verbose [0-3]", "Shows debug log"},
|
{"-verbose [0-3]", "Shows debug log"},
|
||||||
@ -233,12 +234,23 @@ void DeployCore::help() {
|
|||||||
{"-releaseDate [package;val,val]", "Sets release date for package"},
|
{"-releaseDate [package;val,val]", "Sets release date for package"},
|
||||||
{"-icon [package;val,val]", "Sets path to icon for package"},
|
{"-icon [package;val,val]", "Sets path to icon for package"},
|
||||||
{"-publisher [package;val,val]", "Sets publisher for package"},
|
{"-publisher [package;val,val]", "Sets publisher for package"},
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"Part 4 QtInstallFramework options", {
|
"Part 4 Plugins Control Options", {
|
||||||
|
{"-extraPlugin [package;val1;val2,SingeleVal]", "Sets an additional path to third-party application plug-in"},
|
||||||
|
{"-enablePlugins [package;val1;val2,SingeleVal", "Enables additional plugins for distribution."
|
||||||
|
" By default disabled next plugins: " + PluginsParser::defaultForbidenPlugins().join(',') + " if you want enable"
|
||||||
|
" it then use '-enablePlugins " + PluginsParser::defaultForbidenPlugins().join(',') + "' option"},
|
||||||
|
{"-disablePlugins [package;val1;val2,SingeleVal]", "Disables plugins for distribution. "
|
||||||
|
"You can disable any plugin of your Qt build, just see the yourQtFolder/plugins forlder for available plugins."
|
||||||
|
" Example if you want disable qxcb plugin: -disablePlugins qxcb. Note that the name of the plugin is indicated without its extension"},
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Part 5 QtInstallFramework options", {
|
||||||
{"-qifStyle [path/to/style.css]", "Sets the path to the CSS style file or sets the default style. Available styles: quasar "},
|
{"-qifStyle [path/to/style.css]", "Sets the path to the CSS style file or sets the default style. Available styles: quasar "},
|
||||||
{"-qifBanner [path/to/banner.png]", "Sets path to the banner png file."},
|
{"-qifBanner [path/to/banner.png]", "Sets path to the banner png file."},
|
||||||
{"-qifLogo [path/to/logo.png]", "Sets path to the logo png file."},
|
{"-qifLogo [path/to/logo.png]", "Sets path to the logo png file."},
|
||||||
@ -300,6 +312,7 @@ QStringList DeployCore::helpKeys() {
|
|||||||
"qifStyle",
|
"qifStyle",
|
||||||
"qifBanner",
|
"qifBanner",
|
||||||
"qifLogo",
|
"qifLogo",
|
||||||
|
"allPlatforms"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,14 +32,28 @@ struct DEPLOYSHARED_EXPORT QtModuleEntry {
|
|||||||
|
|
||||||
|
|
||||||
enum Platform {
|
enum Platform {
|
||||||
UnknownPlatform = 0x00,
|
UnknownPlatform = 0x0000,
|
||||||
Win32 = 0x01,
|
// Windows
|
||||||
Win64 = 0x02,
|
Win32 = 0x0001,
|
||||||
|
Win64 = 0x0002,
|
||||||
Win = Win32 | Win64,
|
Win = Win32 | Win64,
|
||||||
Unix32 = 0x04,
|
|
||||||
Unix64 = 0x08,
|
// Unix
|
||||||
Unix = Unix32 | Unix64,
|
Unix_x86_32 = 0x0004,
|
||||||
GeneralFile = 0x10
|
Unix_x86_64 = 0x0008,
|
||||||
|
Unix_x86 = Unix_x86_32 | Unix_x86_64,
|
||||||
|
Unix_ARM_32 = 0x0010,
|
||||||
|
Unix_ARM_64 = 0x0020,
|
||||||
|
Unix_ARM = Unix_x86_32 | Unix_x86_64,
|
||||||
|
Unix = Unix_x86 | Unix_ARM,
|
||||||
|
|
||||||
|
// Other
|
||||||
|
|
||||||
|
// Web
|
||||||
|
WebGl = 0x0040,
|
||||||
|
WebRemote = 0x0080,
|
||||||
|
|
||||||
|
GeneralFile = 0x0100
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LibPriority : int {
|
enum LibPriority : int {
|
||||||
|
@ -87,3 +87,46 @@ void DistroModule::setPublisher(const QString &publisher)
|
|||||||
{
|
{
|
||||||
_publisher = publisher;
|
_publisher = publisher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSet<QString> DistroModule::enabledPlugins() const
|
||||||
|
{
|
||||||
|
return _enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DistroModule::setEnabledPlugins(const QSet<QString> &enabled)
|
||||||
|
{
|
||||||
|
_enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DistroModule::addEnabledPlugins(const QString &enabled) {
|
||||||
|
_enabled += enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSet<QString> DistroModule::disabledPlugins() const
|
||||||
|
{
|
||||||
|
return _disabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DistroModule::setDisabledPlugins(const QSet<QString> &disabled)
|
||||||
|
{
|
||||||
|
_disabled = disabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DistroModule::addDisabledPlugins(const QString &disabled) {
|
||||||
|
_disabled += disabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSet<QString> DistroModule::extraPlugins() const
|
||||||
|
{
|
||||||
|
return _extraPlugins;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DistroModule::setExtraPlugins(const QSet<QString> &extraPlugins)
|
||||||
|
{
|
||||||
|
_extraPlugins = extraPlugins;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DistroModule::addExtraPlugins(const QString &extraPlugin) {
|
||||||
|
_extraPlugins += extraPlugin;
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -36,6 +36,18 @@ public:
|
|||||||
QString publisher() const;
|
QString publisher() const;
|
||||||
void setPublisher(const QString &publisher);
|
void setPublisher(const QString &publisher);
|
||||||
|
|
||||||
|
QSet<QString> enabledPlugins() const;
|
||||||
|
void setEnabledPlugins(const QSet<QString> &enabled);
|
||||||
|
void addEnabledPlugins(const QString &enabled);
|
||||||
|
|
||||||
|
QSet<QString> disabledPlugins() const;
|
||||||
|
void setDisabledPlugins(const QSet<QString> &disabled);
|
||||||
|
void addDisabledPlugins(const QString &disabled);
|
||||||
|
|
||||||
|
QSet<QString> extraPlugins() const;
|
||||||
|
void setExtraPlugins(const QSet<QString> &extraPlugins);
|
||||||
|
void addExtraPlugins(const QString &extraPlugin);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString _name;
|
QString _name;
|
||||||
QString _description;
|
QString _description;
|
||||||
@ -46,6 +58,11 @@ private:
|
|||||||
|
|
||||||
QSet<QString> _targets;
|
QSet<QString> _targets;
|
||||||
QSet<QString> _qmlInput;
|
QSet<QString> _qmlInput;
|
||||||
|
|
||||||
|
// plugins
|
||||||
|
QSet<QString> _enabled;
|
||||||
|
QSet<QString> _disabled;
|
||||||
|
QSet<QString> _extraPlugins;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DISTROMODULE_H
|
#endif // DISTROMODULE_H
|
||||||
|
@ -55,10 +55,12 @@ bool ELF::getLibInfo(const QString &lib, LibInfo &info) const {
|
|||||||
|
|
||||||
auto headers = reader.readHeaders();
|
auto headers = reader.readHeaders();
|
||||||
|
|
||||||
if (headers.elfclass == ElfClass::Elf_ELFCLASS32) {
|
if (headers.elfmachine == ElfMachine::Elf_EM_386) {
|
||||||
info.setPlatform(Unix32);
|
info.setPlatform(Unix_x86_32);
|
||||||
} else if (headers.elfclass == ElfClass::Elf_ELFCLASS64) {
|
} else if (headers.elfmachine == ElfMachine::Elf_EM_X86_64) {
|
||||||
info.setPlatform(Unix64);
|
info.setPlatform(Unix_x86_64);
|
||||||
|
} else if (headers.elfmachine == ElfMachine::Elf_EM_ARM) {
|
||||||
|
info.setPlatform(Unix_ARM_32);
|
||||||
} else {
|
} else {
|
||||||
info.setPlatform(UnknownPlatform);
|
info.setPlatform(UnknownPlatform);
|
||||||
return false;
|
return false;
|
||||||
|
@ -76,66 +76,6 @@ bool Extracter::extractWebEngine() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Extracter::copyPlugin(const QString &plugin, const QString& package) {
|
|
||||||
|
|
||||||
QStringList listItems;
|
|
||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
|
||||||
auto targetPath = cnf->getTargetDir() + "/" + package;
|
|
||||||
auto distro = cnf->getDistroFromPackage(package);
|
|
||||||
|
|
||||||
|
|
||||||
auto pluginPath = targetPath + distro.getPluginsOutDir() +
|
|
||||||
QFileInfo(plugin).fileName();
|
|
||||||
|
|
||||||
if (!_fileManager->copyFolder(plugin, pluginPath,
|
|
||||||
QStringList() << ".so.debug" << "d.dll" << ".pdb", &listItems)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto &item : listItems) {
|
|
||||||
extractPluginLib(item, package);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Extracter::copyExtraPlugins(const QString& package) {
|
|
||||||
QFileInfo info;
|
|
||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
|
||||||
auto targetPath = cnf->getTargetDir() + "/" + package;
|
|
||||||
auto distro = cnf->getDistroFromPackage(package);
|
|
||||||
|
|
||||||
for (auto extraPlugin : cnf->extraPlugins) {
|
|
||||||
|
|
||||||
if (!PathUtils::isPath(extraPlugin)) {
|
|
||||||
extraPlugin = cnf->qtDir.getPlugins() + "/" + extraPlugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
info.setFile(extraPlugin);
|
|
||||||
if (info.isDir() && cnf->qtDir.isQt(info.absoluteFilePath())) {
|
|
||||||
copyPlugin(info.absoluteFilePath(), package);
|
|
||||||
|
|
||||||
} else if (info.exists()) {
|
|
||||||
_fileManager->copyFile(info.absoluteFilePath(),
|
|
||||||
targetPath + distro.getPluginsOutDir());
|
|
||||||
|
|
||||||
extractPluginLib(info.absoluteFilePath(), package);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Extracter::copyPlugins(const QStringList &list, const QString& package) {
|
|
||||||
for (const auto &plugin : list) {
|
|
||||||
if (!copyPlugin(plugin, package)) {
|
|
||||||
QuasarAppUtils::Params::log("not copied!",
|
|
||||||
QuasarAppUtils::Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
copyExtraPlugins(package);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Extracter::extractAllTargets() {
|
void Extracter::extractAllTargets() {
|
||||||
auto cfg = DeployCore::_config;
|
auto cfg = DeployCore::_config;
|
||||||
for (auto i = cfg->packages().cbegin(); i != cfg->packages().cend(); ++i) {
|
for (auto i = cfg->packages().cbegin(); i != cfg->packages().cend(); ++i) {
|
||||||
@ -157,17 +97,74 @@ void Extracter::clear() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Extracter::copyExtraPlugins(const QString& package) {
|
||||||
|
|
||||||
|
|
||||||
|
QFileInfo info;
|
||||||
|
|
||||||
|
auto cnf = DeployCore::_config;
|
||||||
|
auto targetPath = cnf->getTargetDir() + "/" + package;
|
||||||
|
auto distro = cnf->getDistroFromPackage(package);
|
||||||
|
|
||||||
|
for (auto extraPlugin : distro.extraPlugins()) {
|
||||||
|
|
||||||
|
info.setFile(extraPlugin);
|
||||||
|
|
||||||
|
if (info.isFile()) {
|
||||||
|
if (!_fileManager->copyFile(info.absoluteFilePath(),
|
||||||
|
targetPath + distro.getPluginsOutDir())) {
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log("fail to copy extra plugin from:" + info.absoluteFilePath() +
|
||||||
|
" to: " + targetPath + distro.getPluginsOutDir(),
|
||||||
|
QuasarAppUtils::Warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
extractPluginLib(info.absoluteFilePath(), package);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info.isDir()) {
|
||||||
|
QStringList plugins;
|
||||||
|
if (!_fileManager->copyFolder(info.absoluteFilePath(),
|
||||||
|
targetPath + distro.getPluginsOutDir() + info.fileName()
|
||||||
|
, {}, &plugins)) {
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log("fail to copy extra plugin from:" + info.absoluteFilePath() +
|
||||||
|
" to: " + targetPath + distro.getPluginsOutDir(),
|
||||||
|
QuasarAppUtils::Warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto& plugin : plugins) {
|
||||||
|
extractPluginLib(plugin, package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Extracter::extractPlugins() {
|
void Extracter::extractPlugins() {
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
PluginsParser pluginsParser;
|
|
||||||
|
_pluginsParser->initDeployPluginsList();
|
||||||
|
|
||||||
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
||||||
|
auto targetPath = cnf->getTargetDir() + "/" + i.key();
|
||||||
auto distro = cnf->getDistroFromPackage(i.key());
|
auto distro = cnf->getDistroFromPackage(i.key());
|
||||||
|
|
||||||
QStringList plugins;
|
QStringList plugins;
|
||||||
pluginsParser.scan(cnf->qtDir.getPlugins(), plugins, _packageDependencyes[i.key()].qtModules());
|
QStringList listItems;
|
||||||
copyPlugins(plugins, i.key());
|
|
||||||
|
_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", &listItems);
|
||||||
|
|
||||||
|
for (const auto &item : listItems) {
|
||||||
|
extractPluginLib(item, i.key());
|
||||||
|
}
|
||||||
|
|
||||||
|
copyExtraPlugins(i.key());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extracter::copyLibs(const QSet<QString> &files, const QString& package) {
|
void Extracter::copyLibs(const QSet<QString> &files, const QString& package) {
|
||||||
@ -240,7 +237,7 @@ void Extracter::deploy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!deployMSVC()) {
|
if (!deployMSVC()) {
|
||||||
QuasarAppUtils::Params::log("deploy msvc failed");
|
QuasarAppUtils::Params::log("deploy msvc failed", QuasarAppUtils::Warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
_metaFileManager->createRunMetaFiles();
|
_metaFileManager->createRunMetaFiles();
|
||||||
@ -460,15 +457,17 @@ void Extracter::extract(const QString &file,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Extracter::Extracter(FileManager *fileManager, ConfigParser *cqt,
|
Extracter::Extracter(FileManager *fileManager, PluginsParser *pluginsParser, ConfigParser *cqt,
|
||||||
DependenciesScanner *scaner):
|
DependenciesScanner *scaner):
|
||||||
_scaner(scaner),
|
_scaner(scaner),
|
||||||
_fileManager(fileManager),
|
_fileManager(fileManager),
|
||||||
|
_pluginsParser(pluginsParser),
|
||||||
_cqt(cqt)
|
_cqt(cqt)
|
||||||
{
|
{
|
||||||
|
|
||||||
assert(_cqt);
|
assert(_cqt);
|
||||||
assert(_fileManager);
|
assert(_fileManager);
|
||||||
|
assert(_pluginsParser);
|
||||||
assert(DeployCore::_config);
|
assert(DeployCore::_config);
|
||||||
|
|
||||||
_metaFileManager = new MetaFileManager(_fileManager);
|
_metaFileManager = new MetaFileManager(_fileManager);
|
||||||
|
@ -18,14 +18,22 @@
|
|||||||
|
|
||||||
class ConfigParser;
|
class ConfigParser;
|
||||||
class MetaFileManager;
|
class MetaFileManager;
|
||||||
|
class PluginsParser;
|
||||||
|
|
||||||
class DEPLOYSHARED_EXPORT Extracter {
|
class DEPLOYSHARED_EXPORT Extracter {
|
||||||
private:
|
|
||||||
|
public:
|
||||||
|
explicit Extracter(FileManager *fileManager, PluginsParser* pluginsParser, ConfigParser * cqt, DependenciesScanner *_scaner);
|
||||||
|
void deploy();
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
QHash<QString, DependencyMap> _packageDependencyes;
|
QHash<QString, DependencyMap> _packageDependencyes;
|
||||||
|
|
||||||
DependenciesScanner *_scaner;
|
DependenciesScanner *_scaner;
|
||||||
FileManager *_fileManager;
|
FileManager *_fileManager;
|
||||||
|
PluginsParser* _pluginsParser;
|
||||||
ConfigParser *_cqt;
|
ConfigParser *_cqt;
|
||||||
MetaFileManager *_metaFileManager;
|
MetaFileManager *_metaFileManager;
|
||||||
|
|
||||||
@ -38,39 +46,30 @@ class DEPLOYSHARED_EXPORT Extracter {
|
|||||||
bool extractQmlAll();
|
bool extractQmlAll();
|
||||||
bool extractQmlFromSource();
|
bool extractQmlFromSource();
|
||||||
/**
|
/**
|
||||||
* @brief extractLib
|
* @brief extractLib
|
||||||
* @param file file of lib
|
* @param file file of lib
|
||||||
* @param mask extraction mask. Used to filter extracts objects
|
* @param mask extraction mask. Used to filter extracts objects
|
||||||
*/
|
*/
|
||||||
void extractLib(const QString & file, DependencyMap *depMap, const QString& mask = "");
|
void extractLib(const QString & file, DependencyMap *depMap, const QString& mask = "");
|
||||||
|
|
||||||
bool deployMSVC();
|
bool deployMSVC();
|
||||||
bool extractWebEngine();
|
bool extractWebEngine();
|
||||||
|
|
||||||
|
|
||||||
bool copyPlugin(const QString &plugin, const QString &package);
|
|
||||||
void copyPlugins(const QStringList &list, const QString &package);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief compress - this function join all target dependecies in to one struct
|
* @brief compress - this function join all target dependecies in to one struct
|
||||||
*/
|
*/
|
||||||
void compress();
|
void compress();
|
||||||
void extractAllTargets();
|
void extractAllTargets();
|
||||||
void extractPlugins();
|
void extractPlugins();
|
||||||
|
|
||||||
void copyFiles();
|
void copyFiles();
|
||||||
void copyTr();
|
void copyTr();
|
||||||
void copyExtraPlugins(const QString &package);
|
|
||||||
void copyLibs(const QSet<QString> &files, const QString &package);
|
void copyLibs(const QSet<QString> &files, const QString &package);
|
||||||
|
|
||||||
bool isWebEngine(const QString& package) const;
|
bool isWebEngine(const QString& package) const;
|
||||||
void extractPluginLib(const QString &item, const QString &package);
|
void extractPluginLib(const QString &item, const QString &package);
|
||||||
|
|
||||||
public:
|
|
||||||
explicit Extracter(FileManager *fileManager, ConfigParser * cqt, DependenciesScanner *_scaner);
|
|
||||||
void deploy();
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
friend class deploytest;
|
friend class deploytest;
|
||||||
|
void copyExtraPlugins(const QString &package);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // EXTRACTER_H_H
|
#endif // EXTRACTER_H_H
|
||||||
|
@ -67,7 +67,7 @@ bool FileManager::addToDeployed(const QString& path) {
|
|||||||
|
|
||||||
auto completeSufix = info.completeSuffix();
|
auto completeSufix = info.completeSuffix();
|
||||||
if (info.isFile() && (completeSufix.isEmpty() || completeSufix.toLower() == "run"
|
if (info.isFile() && (completeSufix.isEmpty() || completeSufix.toLower() == "run"
|
||||||
|| completeSufix.toLower() == "sh")) {
|
|| completeSufix.toLower() == "sh")) {
|
||||||
|
|
||||||
if (!QFile::setPermissions(path, static_cast<QFile::Permission>(0x7777))) {
|
if (!QFile::setPermissions(path, static_cast<QFile::Permission>(0x7777))) {
|
||||||
QuasarAppUtils::Params::log("permishens set fail", QuasarAppUtils::Warning);
|
QuasarAppUtils::Params::log("permishens set fail", QuasarAppUtils::Warning);
|
||||||
@ -147,7 +147,7 @@ bool FileManager::strip(const QString &dir) const {
|
|||||||
|
|
||||||
|
|
||||||
bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
||||||
QStringList *masks, bool isMove, bool targetIsFile) {
|
QStringList *masks, bool isMove, bool targetIsFile) {
|
||||||
|
|
||||||
auto info = QFileInfo(file);
|
auto info = QFileInfo(file);
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QuasarAppUtils::Params::log(((isMove)? "move :": "copy :") + file,
|
QuasarAppUtils::Params::log(((isMove)? "move :": "copy :") + file,
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
QFile sourceFile(file);
|
QFile sourceFile(file);
|
||||||
auto sourceFileAbsalutePath = QFileInfo(file).absoluteFilePath();
|
auto sourceFileAbsalutePath = QFileInfo(file).absoluteFilePath();
|
||||||
|
|
||||||
@ -198,13 +198,13 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
|||||||
sourceFile.copy(tergetFile))) {
|
sourceFile.copy(tergetFile))) {
|
||||||
|
|
||||||
QuasarAppUtils::Params::log("Qt Operation fail " + file + " >> " + tergetFile +
|
QuasarAppUtils::Params::log("Qt Operation fail " + file + " >> " + tergetFile +
|
||||||
" Qt error: " + sourceFile.errorString(),
|
" Qt error: " + sourceFile.errorString(),
|
||||||
QuasarAppUtils::Warning);
|
QuasarAppUtils::Warning);
|
||||||
|
|
||||||
bool tarExits = QFileInfo(tergetFile).exists();
|
bool tarExits = QFileInfo(tergetFile).exists();
|
||||||
|
|
||||||
if ((!tarExits) ||
|
if ((!tarExits) ||
|
||||||
(tarExits && !QuasarAppUtils::Params::isEndable("noOverwrite"))) {
|
(tarExits && !QuasarAppUtils::Params::isEndable("noOverwrite"))) {
|
||||||
|
|
||||||
std::ifstream src(file.toStdString(),
|
std::ifstream src(file.toStdString(),
|
||||||
std::ios::binary);
|
std::ios::binary);
|
||||||
@ -216,8 +216,8 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
|||||||
|
|
||||||
if (!QFileInfo::exists(tergetFile)) {
|
if (!QFileInfo::exists(tergetFile)) {
|
||||||
QuasarAppUtils::Params::log("std Operation fail file not copied. "
|
QuasarAppUtils::Params::log("std Operation fail file not copied. "
|
||||||
"Сheck if you have access to the target dir",
|
"Сheck if you have access to the target dir",
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -230,7 +230,7 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
|||||||
|
|
||||||
if (QFileInfo(tergetFile).exists()) {
|
if (QFileInfo(tergetFile).exists()) {
|
||||||
QuasarAppUtils::Params::log(tergetFile + " already exists!",
|
QuasarAppUtils::Params::log(tergetFile + " already exists!",
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,14 +262,14 @@ bool FileManager::smartCopyFile(const QString &file,
|
|||||||
|
|
||||||
if (!copyFile(file, target, mask, ifFileTarget)) {
|
if (!copyFile(file, target, mask, ifFileTarget)) {
|
||||||
QuasarAppUtils::Params::log("not copy target to bin dir " + file,
|
QuasarAppUtils::Params::log("not copy target to bin dir " + file,
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!copyFile(file, target, mask, ifFileTarget)) {
|
if (!copyFile(file, target, mask, ifFileTarget)) {
|
||||||
QuasarAppUtils::Params::log("not copy target to bin dir " + file,
|
QuasarAppUtils::Params::log("not copy target to bin dir " + file,
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ bool FileManager::moveFile(const QString &file, const QString &target, QStringLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FileManager::copyFolder(const QString &from, const QString &to, const QStringList &filter,
|
bool FileManager::copyFolder(const QString &from, const QString &to, const QStringList &filter,
|
||||||
QStringList *listOfCopiedItems, QStringList *mask) {
|
QStringList *listOfCopiedItems, QStringList *mask) {
|
||||||
|
|
||||||
QDir fromDir(from);
|
QDir fromDir(from);
|
||||||
|
|
||||||
@ -372,16 +372,16 @@ bool FileManager::moveFolder(const QString &from, const QString &to, const QStri
|
|||||||
|
|
||||||
void FileManager::clear(const QString& targetDir, bool force) {
|
void FileManager::clear(const QString& targetDir, bool force) {
|
||||||
QuasarAppUtils::Params::log( "clear start!",
|
QuasarAppUtils::Params::log( "clear start!",
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
if (force) {
|
if (force) {
|
||||||
QuasarAppUtils::Params::log("clear force! " + targetDir,
|
QuasarAppUtils::Params::log("clear force! " + targetDir,
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
if (QDir(targetDir).removeRecursively()) {
|
if (QDir(targetDir).removeRecursively()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QuasarAppUtils::Params::log("Remove target Dir fail, try remove old deployemend files",
|
QuasarAppUtils::Params::log("Remove target Dir fail, try remove old deployemend files",
|
||||||
QuasarAppUtils::Warning);
|
QuasarAppUtils::Warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<int, QFileInfo> sortedOldData;
|
QMap<int, QFileInfo> sortedOldData;
|
||||||
@ -400,7 +400,7 @@ void FileManager::clear(const QString& targetDir, bool force) {
|
|||||||
if (index.value().isFile()) {
|
if (index.value().isFile()) {
|
||||||
if (removeFile(index.value())) {
|
if (removeFile(index.value())) {
|
||||||
QuasarAppUtils::Params::log("Remove " + index.value().absoluteFilePath() + " because it is deployed file",
|
QuasarAppUtils::Params::log("Remove " + index.value().absoluteFilePath() + " because it is deployed file",
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -408,7 +408,7 @@ void FileManager::clear(const QString& targetDir, bool force) {
|
|||||||
if (!qdir.entryList(QDir::NoDotAndDotDot | QDir::AllEntries).count()) {
|
if (!qdir.entryList(QDir::NoDotAndDotDot | QDir::AllEntries).count()) {
|
||||||
qdir.removeRecursively();
|
qdir.removeRecursively();
|
||||||
QuasarAppUtils::Params::log("Remove " + index.value().absoluteFilePath() + " because it is empty",
|
QuasarAppUtils::Params::log("Remove " + index.value().absoluteFilePath() + " because it is empty",
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -417,20 +417,95 @@ void FileManager::clear(const QString& targetDir, bool force) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FileManager::copyFile(const QString &file, const QString &target,
|
bool FileManager::copyFile(const QString &file, const QString &target,
|
||||||
QStringList *masks, bool targetIsFile) {
|
QStringList *masks, bool targetIsFile) {
|
||||||
|
|
||||||
return fileActionPrivate(file, target, masks, false, targetIsFile);
|
return fileActionPrivate(file, target, masks, false, targetIsFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString FileManager::changeDistanation(const QString& absalutePath,
|
||||||
|
QString basePath,
|
||||||
|
int depch) {
|
||||||
|
|
||||||
|
auto prefixes = absalutePath.split(QRegExp("[\\/]"), QString::SkipEmptyParts);
|
||||||
|
depch = std::min(depch, prefixes.size());
|
||||||
|
while (depch) {
|
||||||
|
auto index = prefixes.size() - depch;
|
||||||
|
if (index >= 0) {
|
||||||
|
basePath += "/" + prefixes[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
depch--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return basePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FileManager::copyFiles(const QStringList &source,
|
||||||
|
const QString &to, int saveStructSize,
|
||||||
|
const QStringList &filter,
|
||||||
|
QStringList *listOfCopiedItems,
|
||||||
|
QStringList *mask) {
|
||||||
|
|
||||||
|
for (const auto &item : source) {
|
||||||
|
|
||||||
|
QFileInfo info(item);
|
||||||
|
|
||||||
|
QString skipFilter = "";
|
||||||
|
for (const auto &i: filter) {
|
||||||
|
if (info.fileName().contains(i, ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||||
|
skipFilter = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!skipFilter.isEmpty()) {
|
||||||
|
QuasarAppUtils::Params::log(
|
||||||
|
info.absoluteFilePath() + " ignored by filter " + skipFilter,
|
||||||
|
QuasarAppUtils::VerboseLvl::Info);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto config = DeployCore::_config;
|
||||||
|
|
||||||
|
LibInfo libInfo;
|
||||||
|
libInfo.setName(info.fileName());
|
||||||
|
libInfo.setPath(info.absolutePath());
|
||||||
|
libInfo.setPlatform(GeneralFile);
|
||||||
|
|
||||||
|
if (config)
|
||||||
|
if (auto rule = config->ignoreList.isIgnore(libInfo)) {
|
||||||
|
QuasarAppUtils::Params::log(
|
||||||
|
info.absoluteFilePath() + " ignored by rule " + rule->label,
|
||||||
|
QuasarAppUtils::VerboseLvl::Info);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto distanation = changeDistanation(info.absolutePath(), to, saveStructSize);
|
||||||
|
|
||||||
|
if (!copyFile(info.absoluteFilePath(), distanation , mask)) {
|
||||||
|
QuasarAppUtils::Params::log(
|
||||||
|
"not copied file " + distanation + "/" + info.fileName(),
|
||||||
|
QuasarAppUtils::VerboseLvl::Warning);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listOfCopiedItems) {
|
||||||
|
*listOfCopiedItems << distanation + "/" + info.fileName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool FileManager::removeFile(const QFileInfo &file) {
|
bool FileManager::removeFile(const QFileInfo &file) {
|
||||||
|
|
||||||
if (!QFile::remove(file.absoluteFilePath())) {
|
if (!QFile::remove(file.absoluteFilePath())) {
|
||||||
QuasarAppUtils::Params::log("Qt Operation fail (remove file) " + file.absoluteFilePath(),
|
QuasarAppUtils::Params::log("Qt Operation fail (remove file) " + file.absoluteFilePath(),
|
||||||
QuasarAppUtils::Warning);
|
QuasarAppUtils::Warning);
|
||||||
|
|
||||||
if (remove(file.absoluteFilePath().toLatin1())) {
|
if (remove(file.absoluteFilePath().toLatin1())) {
|
||||||
QuasarAppUtils::Params::log("std Operation fail file not removed." + file.absoluteFilePath(),
|
QuasarAppUtils::Params::log("std Operation fail file not removed." + file.absoluteFilePath(),
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,13 +23,39 @@ private:
|
|||||||
bool initDir(const QString &path);
|
bool initDir(const QString &path);
|
||||||
QSet<QString> _deployedFiles;
|
QSet<QString> _deployedFiles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief changeDistanation - this function create new distanation path.
|
||||||
|
* (merge base path and pathFrom with depth)
|
||||||
|
* @param absalutePath
|
||||||
|
* @param basePath
|
||||||
|
* @param depch
|
||||||
|
* @return the new path
|
||||||
|
*/
|
||||||
|
QString changeDistanation(const QString &absalutePath, QString basePath, int depch);
|
||||||
public:
|
public:
|
||||||
FileManager();
|
FileManager();
|
||||||
|
|
||||||
bool copyFile(const QString &file, const QString &target,
|
bool copyFile(const QString &file, const QString &target,
|
||||||
QStringList *mask = nullptr, bool targetIsFile = false);
|
QStringList *mask = nullptr, bool targetIsFile = false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief copyFiles - copy files (source) to (to)
|
||||||
|
* @param source - copy source files
|
||||||
|
* @param to - distanation folder
|
||||||
|
* @param saveStructSize - size of name of source file to save after copy. example:
|
||||||
|
* copy /Foo/A.txt /Bar/ (size 0) - result file copyed to /Bar/A.txt
|
||||||
|
* copy /Foo/A.txt /Bar/ (size 1) - to /Bar/Foo/A.txt
|
||||||
|
* @param filter - list of forbiden names for ignore files
|
||||||
|
* @param listOfCopiedItems - list of copyed files
|
||||||
|
* @param mask - mask of copyed files
|
||||||
|
* @return true if files copyed
|
||||||
|
*/
|
||||||
|
bool copyFiles(const QStringList &source, const QString &to, int saveStructSize = 0,
|
||||||
|
const QStringList &filter = QStringList(),
|
||||||
|
QStringList *listOfCopiedItems = nullptr,
|
||||||
|
QStringList *mask = nullptr);
|
||||||
|
|
||||||
|
|
||||||
bool removeFile(const QString &file);
|
bool removeFile(const QString &file);
|
||||||
bool removeFile(const QFileInfo &file);
|
bool removeFile(const QFileInfo &file);
|
||||||
|
|
||||||
|
@ -130,6 +130,10 @@ bool LibInfo::isValid() const {
|
|||||||
name.size() && path.size();
|
name.size() && path.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LibInfo::isScaned() const {
|
||||||
|
return allDep.size();
|
||||||
|
}
|
||||||
|
|
||||||
uint qHash(const LibInfo &info) {
|
uint qHash(const LibInfo &info) {
|
||||||
return qHash(info.fullPath());
|
return qHash(info.fullPath());
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
bool isScaned() const;
|
||||||
|
|
||||||
friend class DependenciesScanner;
|
friend class DependenciesScanner;
|
||||||
const QSet<LibInfo>& getAllDep() const;
|
const QSet<LibInfo>& getAllDep() const;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
* of this license document, but changing it is not allowed.
|
* of this license document, but changing it is not allowed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "deployconfig.h"
|
||||||
#include "pluginsparser.h"
|
#include "pluginsparser.h"
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <dependenciesscanner.h>
|
#include <dependenciesscanner.h>
|
||||||
@ -45,20 +46,50 @@ static const PluginModuleMapping pluginModuleMappings[] =
|
|||||||
{"geometryloaders", DeployCore::QtModule::Qt3DRendererModule},
|
{"geometryloaders", DeployCore::QtModule::Qt3DRendererModule},
|
||||||
{"webview", DeployCore::QtModule::QtWebViewModule},
|
{"webview", DeployCore::QtModule::QtWebViewModule},
|
||||||
{"xcbglintegrations", DeployCore::QtModule::QtGuiModule},
|
{"xcbglintegrations", DeployCore::QtModule::QtGuiModule},
|
||||||
{"wayland-decoration-client", DeployCore::QtModule::QtGuiModule},
|
{"wayland-decoration-client", DeployCore::QtModule::QtQuickModule},
|
||||||
{"wayland-graphics-integration-client", DeployCore::QtModule::QtGuiModule},
|
{"wayland-graphics-integration-client", DeployCore::QtModule::QtQuickModule},
|
||||||
{"wayland-graphics-integration-server", DeployCore::QtModule::QtGuiModule},
|
{"wayland-graphics-integration-server", DeployCore::QtModule::QtQuickModule},
|
||||||
{"wayland-shell-integration", DeployCore::QtModule::QtGuiModule},
|
{"wayland-shell-integration", DeployCore::QtModule::QtGuiModule},
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
quint64 PluginsParser::qtModuleForPlugin(const QString &subDirName) {
|
static const PlatformMapping platformMappings[] =
|
||||||
|
{
|
||||||
|
{"qminimal", Unix | Win },
|
||||||
|
{"qminimalegl", Unix | Win },
|
||||||
|
{"qoffscreen", Unix | Win},
|
||||||
|
{"qandroid", UnknownPlatform },
|
||||||
|
{"qbsdfb", UnknownPlatform },
|
||||||
|
{"qcocoa", UnknownPlatform },
|
||||||
|
{"qdirect2d", Win },
|
||||||
|
{"qdirectfb", UnknownPlatform },
|
||||||
|
{"qeglfs", Unix_ARM },
|
||||||
|
{"qhaiku", UnknownPlatform },
|
||||||
|
{"qios", UnknownPlatform },
|
||||||
|
{"qlinuxfb", Unix_ARM },
|
||||||
|
{"qmirclient", Unix },
|
||||||
|
{"qopenwf", Unix },
|
||||||
|
{"qqnx", UnknownPlatform },
|
||||||
|
{"qvnc", WebRemote },
|
||||||
|
{"qwasm", UnknownPlatform },
|
||||||
|
{"qwindows", Win },
|
||||||
|
{"qwinrt", Win },
|
||||||
|
{"qxcb", Unix },
|
||||||
|
{"webgl", WebGl },
|
||||||
|
{"qwayland-xcomposite-glx", Unix_x86_64},
|
||||||
|
{"qwayland-xcomposite-egl", Unix_x86_64},
|
||||||
|
{"qwayland-generic", Unix_x86_64},
|
||||||
|
{"qwayland-egl", Unix_x86_64}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
quint64 PluginsParser::qtModuleForPlugin(const QString &subDirName) const {
|
||||||
const auto end = std::end(pluginModuleMappings);
|
const auto end = std::end(pluginModuleMappings);
|
||||||
|
|
||||||
const auto result =
|
const auto result =
|
||||||
std::find_if(std::begin(pluginModuleMappings), end,
|
std::find_if(std::begin(pluginModuleMappings), end,
|
||||||
[&subDirName] (const PluginModuleMapping &m) {
|
[&subDirName] (const PluginModuleMapping &m) {
|
||||||
|
|
||||||
return subDirName == QLatin1String(m.directoryName);
|
return subDirName == QLatin1String(m.directoryName);
|
||||||
});
|
});
|
||||||
@ -66,23 +97,133 @@ quint64 PluginsParser::qtModuleForPlugin(const QString &subDirName) {
|
|||||||
return result != end ? result->module : 0; // "designer"
|
return result != end ? result->module : 0; // "designer"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Platform PluginsParser::platformForPlugin(const QString &name) const {
|
||||||
|
const auto end = std::end(platformMappings);
|
||||||
|
const auto result =
|
||||||
|
std::find_if(std::begin(platformMappings), end,
|
||||||
|
[&name] (const PlatformMapping &m) {
|
||||||
|
|
||||||
|
return name == QLatin1String(m._pluginName);
|
||||||
|
});
|
||||||
|
|
||||||
|
return (result != end) ? result->_platform : Platform::UnknownPlatform; // "designer"
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PluginsParser::getPluginNameFromFile(const QString &baseNaem) const {
|
||||||
|
|
||||||
|
if (baseNaem.left(3) == "lib") {
|
||||||
|
return baseNaem.right(baseNaem.size() - 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseNaem;
|
||||||
|
}
|
||||||
|
|
||||||
bool PluginsParser::scan(const QString& pluginPath,
|
bool PluginsParser::scan(const QString& pluginPath,
|
||||||
QStringList &resDependencies,
|
QStringList &resDependencies,
|
||||||
DeployCore::QtModule qtModules) {
|
DeployCore::QtModule qtModules,
|
||||||
|
const QString& package) {
|
||||||
|
|
||||||
auto plugins = QDir(pluginPath).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
auto plugins = QDir(pluginPath).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
|
|
||||||
QuasarAppUtils::Params::log("Modules Number :" + QString::number(qtModules), QuasarAppUtils::Info);
|
|
||||||
|
|
||||||
for (const auto &plugin: plugins) {
|
for (const auto &plugin: plugins) {
|
||||||
auto module = qtModuleForPlugin(plugin.fileName());
|
scanPluginGroup(plugin, resDependencies, package, qtModules);
|
||||||
if (qtModules & module) {
|
|
||||||
|
|
||||||
QuasarAppUtils::Params::log("deploye plugin : " + plugin.absoluteFilePath(), QuasarAppUtils::Info);
|
|
||||||
|
|
||||||
resDependencies.append(plugin.absoluteFilePath());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PluginsParser::addPlugins(const QStringList& list, const QString& package, QHash<QString, QSet<QString>>& container) {
|
||||||
|
const DeployConfig* cnf = DeployCore::_config;
|
||||||
|
|
||||||
|
for (const auto plugin: list) {
|
||||||
|
if (QFileInfo(cnf->qtDir.getPlugins() + "/" + plugin).isDir()) {
|
||||||
|
auto listPlugins = QDir(cnf->qtDir.getPlugins() + "/" + plugin).entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
||||||
|
|
||||||
|
for (const auto &plugin: listPlugins) {
|
||||||
|
QuasarAppUtils::Params::log("Disable plugin: " + plugin.baseName(), QuasarAppUtils::Debug);
|
||||||
|
container[package].insert(getPluginNameFromFile( plugin.baseName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
QuasarAppUtils::Params::log("Disable plugin: " + plugin, QuasarAppUtils::Debug);
|
||||||
|
container[package].insert(getPluginNameFromFile(plugin));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PluginsParser::initDeployPluginsList() {
|
||||||
|
const DeployConfig* cnf = DeployCore::_config;
|
||||||
|
for (auto package = cnf->packages().cbegin(); package != cnf->packages().cend(); ++package) {
|
||||||
|
|
||||||
|
auto distro = cnf->getDistroFromPackage(package.key());
|
||||||
|
|
||||||
|
QList<QString> desabledFromPlatform;
|
||||||
|
scanPlatforms(package.key(), desabledFromPlatform);
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
|
auto enablePlugins = distro.enabledPlugins().toList();
|
||||||
|
auto disablePlugins = distro.disabledPlugins().toList();
|
||||||
|
#else
|
||||||
|
auto enablePlugins = QStringList(distro.enabledPlugins().cbegin(), distro.enabledPlugins().cend());
|
||||||
|
auto disablePlugins = QStringList(distro.disabledPlugins().cbegin(), distro.disabledPlugins().cend());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
auto forbidenPlugins = defaultForbidenPlugins() + disablePlugins + desabledFromPlatform;
|
||||||
|
|
||||||
|
addPlugins(forbidenPlugins, package.key(), _disabledPlugins);
|
||||||
|
addPlugins(enablePlugins, package.key(), _enabledPlugins);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void PluginsParser::scanPlatforms(const QString& package, QList<QString>& disabledPlugins) {
|
||||||
|
const DeployConfig* cnf = DeployCore::_config;
|
||||||
|
auto platform = cnf->getPlatform(package);
|
||||||
|
|
||||||
|
QString platformPluginPath = cnf->qtDir.getPlugins() + "/platforms";
|
||||||
|
auto plugins = QDir(platformPluginPath).entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
||||||
|
|
||||||
|
for (const auto &plugin: plugins) {
|
||||||
|
|
||||||
|
auto pluginPlatform = platformForPlugin(getPluginNameFromFile(plugin.baseName()));
|
||||||
|
if (!(platform & pluginPlatform)) {
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log("platform : " + plugin.baseName() + " is disabled", QuasarAppUtils::Info);
|
||||||
|
disabledPlugins += getPluginNameFromFile(plugin.baseName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PluginsParser::scanPluginGroup(const QFileInfo& plugin,
|
||||||
|
QStringList &result,
|
||||||
|
const QString &package,
|
||||||
|
DeployCore::QtModule qtModules) const {
|
||||||
|
|
||||||
|
auto plugins = QDir(plugin.absoluteFilePath()).entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
||||||
|
auto module = qtModuleForPlugin(plugin.fileName());
|
||||||
|
|
||||||
|
for (const auto& info: plugins) {
|
||||||
|
if (isEnabledPlugin(getPluginNameFromFile(info.baseName()), package) ||
|
||||||
|
(!isDisabledPlugin(getPluginNameFromFile(info.baseName()), package) && (qtModules & module))) {
|
||||||
|
result += info.absoluteFilePath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PluginsParser::isDisabledPlugin(const QString &plugin, const QString &package) const {
|
||||||
|
return _disabledPlugins[package].contains(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PluginsParser::isEnabledPlugin(const QString &plugin, const QString &package) const {
|
||||||
|
return _enabledPlugins[package].contains(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList PluginsParser::defaultForbidenPlugins() {
|
||||||
|
return {
|
||||||
|
"qtvirtualkeyboardplugin",
|
||||||
|
"virtualkeyboard",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,18 +20,56 @@ struct DEPLOYSHARED_EXPORT PluginModuleMapping
|
|||||||
quint64 module;
|
quint64 module;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct DEPLOYSHARED_EXPORT PlatformMapping
|
||||||
|
{
|
||||||
|
const char *_pluginName;
|
||||||
|
Platform _platform;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The PluginsParser class - scaner of plugins
|
||||||
|
*/
|
||||||
class DEPLOYSHARED_EXPORT PluginsParser
|
class DEPLOYSHARED_EXPORT PluginsParser
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
DependenciesScanner *_libScaner = nullptr;
|
|
||||||
|
|
||||||
quint64 qtModuleForPlugin(const QString &subDirName);
|
|
||||||
public:
|
public:
|
||||||
PluginsParser();
|
PluginsParser();
|
||||||
bool scan(const QString &pluginPath, QStringList& resDependencies,
|
bool scan(const QString &pluginPath, QStringList& resDependencies,
|
||||||
DeployCore::QtModule qtModules);
|
DeployCore::QtModule qtModules, const QString &package);
|
||||||
|
|
||||||
|
|
||||||
|
bool initDeployPluginsList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief defaultForbidenPlugins - this method return list of forbiden plugins
|
||||||
|
* forbidenPlugin - it is a plugin that depends on several Qt modules and significantly increases the size of the distribution.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
static QStringList defaultForbidenPlugins();
|
||||||
|
private:
|
||||||
|
DependenciesScanner *_libScaner = nullptr;
|
||||||
|
QHash<QString, QSet<QString>> _disabledPlugins;
|
||||||
|
QHash<QString, QSet<QString>> _enabledPlugins;
|
||||||
|
|
||||||
|
quint64 qtModuleForPlugin(const QString &subDirName) const;
|
||||||
|
Platform platformForPlugin(const QString &name) const;
|
||||||
|
|
||||||
|
bool copyPlugin(const QString &plugin, const QString &package);
|
||||||
|
void copyExtraPlugins(const QString &package);
|
||||||
|
void copyPlugins(const QStringList &list, const QString &package);
|
||||||
|
QString getPluginNameFromFile(const QString& baseNaem) const;
|
||||||
|
|
||||||
|
void scanPlatforms(const QString &package, QList<QString> &disabledPlugins);
|
||||||
|
void scanPluginGroup(const QFileInfo &pluginFolder,
|
||||||
|
QStringList &result,
|
||||||
|
const QString &package,
|
||||||
|
DeployCore::QtModule qtModules) const;
|
||||||
|
bool isDisabledPlugin(const QString &plugin, const QString &package) const;
|
||||||
|
bool isEnabledPlugin(const QString &plugin, const QString &package) const;
|
||||||
|
|
||||||
|
void addPlugins(const QStringList &list,
|
||||||
|
const QString &package,
|
||||||
|
QHash<QString, QSet<QString>> &container);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QTMODULES_H
|
#endif // QTMODULES_H
|
||||||
|
@ -50,7 +50,7 @@ void LibCreator::initLinux64() {
|
|||||||
"libgcc_s.so.1",
|
"libgcc_s.so.1",
|
||||||
"libc.so.6",
|
"libc.so.6",
|
||||||
},
|
},
|
||||||
Platform::Unix64);
|
Platform::Unix_x86_64);
|
||||||
createLib(":/linux64.so", {
|
createLib(":/linux64.so", {
|
||||||
"libQt5Core.so.5",
|
"libQt5Core.so.5",
|
||||||
"libpthread.so.0",
|
"libpthread.so.0",
|
||||||
@ -60,7 +60,7 @@ void LibCreator::initLinux64() {
|
|||||||
"libc.so.6",
|
"libc.so.6",
|
||||||
|
|
||||||
},
|
},
|
||||||
Platform::Unix64);
|
Platform::Unix_x86_64);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,5 +13,11 @@ Modules::Modules()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Modules &Modules::instance() {
|
||||||
|
static Modules* val = new Modules();
|
||||||
|
|
||||||
|
return *val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +29,10 @@
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Modules();
|
Modules();
|
||||||
|
|
||||||
|
static Modules& instance();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TestModule Modules::instance()
|
||||||
|
|
||||||
#endif // MODULES_H
|
#endif // MODULES_H
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -17,18 +17,19 @@ class ModulesQt513
|
|||||||
public:
|
public:
|
||||||
ModulesQt513();
|
ModulesQt513();
|
||||||
|
|
||||||
static QSet<QString> ignoreFilter(const QSet<QString>& input, const QString& filter);
|
virtual QSet<QString> ignoreFilter(const QSet<QString>& input, const QString& filter) const;
|
||||||
static QSet<QString> onlyC(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> replace(const QSet<QString> &data, const QMap<QString, QString>& replaceMap) const;
|
||||||
static QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR);
|
|
||||||
static QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR);
|
|
||||||
static QSet<QString> qmlLibsExtractPlugins(const QString &distDir = DISTRO_DIR);
|
|
||||||
static QSet<QString> separetedPackageslibs(const QString &distDir = DISTRO_DIR);
|
|
||||||
|
|
||||||
static QSet<QString> outTestLibs(const QString &distDir = DISTRO_DIR);
|
|
||||||
|
|
||||||
static QSet<QString> qtWithoutTr(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> onlyC(const QString &distDir = DISTRO_DIR) const;
|
||||||
static QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR) const;
|
||||||
static QSet<QString> testEmptyParamsTree(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR) const;
|
||||||
|
virtual QSet<QString> testDistroLibs(const QString &distDir = DISTRO_DIR) const;
|
||||||
|
virtual QSet<QString> testOutLibs(const QString &distDir = DISTRO_DIR) const;
|
||||||
|
|
||||||
|
virtual QSet<QString> qtWithoutTr(const QString &distDir = DISTRO_DIR) const;
|
||||||
|
virtual QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR) const;
|
||||||
|
virtual QSet<QString> testEmptyParamsTree(const QString &distDir = DISTRO_DIR) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -13,34 +13,30 @@ ModulesQt514::ModulesQt514()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qtLibs(const QString &distDir)
|
QSet<QString> ModulesQt514::qtLibs(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
auto res = ModulesQt513::qtLibs(distDir);
|
auto res = ModulesQt513::qtLibs(distDir);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
res += utils.createTree({
|
res -= utils.createTree({
|
||||||
{"./" + distDir + "/Qt5QmlModels.dll"},
|
|
||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
res += utils.createTree({
|
res += utils.createTree({
|
||||||
{"./" + distDir + "/lib/libQt5QmlModels.so"},
|
|
||||||
{"./" + distDir + "/plugins/wayland-graphics-integration-client/libvulkan-server.so"},
|
|
||||||
{"./" + distDir + "/plugins/wayland-graphics-integration-server/libvulkan-server.so"},
|
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::onlyC(const QString &distDir)
|
QSet<QString> ModulesQt514::onlyC(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
auto res = ModulesQt513::onlyC(distDir);
|
auto res = ModulesQt513::onlyC(distDir);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qmlLibs(const QString &distDir)
|
QSet<QString> ModulesQt514::qmlLibs(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
|
|
||||||
@ -63,84 +59,22 @@ QSet<QString> ModulesQt514::qmlLibs(const QString &distDir)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qmlLibsExtractPlugins(const QString &distDir)
|
QSet<QString> ModulesQt514::qtWithoutTr(const QString &distDir) const
|
||||||
{
|
|
||||||
auto res = ModulesQt513::qmlLibsExtractPlugins(distDir);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::separetedPackageslibs(const QString &distDir)
|
|
||||||
{
|
|
||||||
TestUtils utils;
|
|
||||||
auto res = ModulesQt513::separetedPackageslibs(distDir);
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
res += utils.createTree(
|
|
||||||
{
|
|
||||||
"./" + distDir + "/lolLib/Qt5QmlModels.dll",
|
|
||||||
"./" + distDir + "/package2/ZzZ/Qt5QmlModels.dll",
|
|
||||||
"./" + distDir + "/package2/ZzZ/Qt5QmlWorkerScript.dll",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
#else
|
|
||||||
res += utils.createTree(
|
|
||||||
{
|
|
||||||
"./" + distDir + "/lolLib/libQt5QmlModels.so",
|
|
||||||
"./" + distDir + "/p/wayland-graphics-integration-client/libvulkan-server.so",
|
|
||||||
"./" + distDir + "/p/wayland-graphics-integration-server/libvulkan-server.so",
|
|
||||||
"./" + distDir + "/package2/ZzZ/lib/libQt5QmlModels.so",
|
|
||||||
"./" + distDir + "/package2/ZzZ/lib/libQt5QmlWorkerScript.so",
|
|
||||||
"./" + distDir + "/package2/ZzZ/plugins/wayland-graphics-integration-client/libvulkan-server.so",
|
|
||||||
"./" + distDir + "/package2/ZzZ/plugins/wayland-graphics-integration-server/libvulkan-server.so",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::outTestLibs(const QString &distDir)
|
|
||||||
{
|
|
||||||
TestUtils utils;
|
|
||||||
auto res = ModulesQt513::outTestLibs(distDir);
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
res += utils.createTree({
|
|
||||||
"./" + distDir + "/lolLib/Qt5QmlModels.dll",
|
|
||||||
"./" + distDir + "/lolLib/Qt5QmlWorkerScript.dll",
|
|
||||||
});
|
|
||||||
#else
|
|
||||||
res += utils.createTree({
|
|
||||||
"./" + distDir + "/lolLib/libQt5QmlModels.so",
|
|
||||||
"./" + distDir + "/lolLib/libQt5QmlWorkerScript.so",
|
|
||||||
"./" + distDir + "/p/wayland-graphics-integration-client/libvulkan-server.so",
|
|
||||||
"./" + distDir + "/p/wayland-graphics-integration-server/libvulkan-server.so"
|
|
||||||
});
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qtWithoutTr(const QString &distDir)
|
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
auto res = ModulesQt513::qtWithoutTr(distDir);
|
auto res = ModulesQt513::qtWithoutTr(distDir);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
res += utils.createTree({
|
res += utils.createTree({
|
||||||
{"./" + distDir + "/Qt5QmlModels.dll"},
|
|
||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
res += utils.createTree({
|
res += utils.createTree({
|
||||||
{"./" + distDir + "/lib/libQt5QmlModels.so"},
|
|
||||||
{"./" + distDir + "/plugins/wayland-graphics-integration-client/libvulkan-server.so"},
|
|
||||||
{"./" + distDir + "/plugins/wayland-graphics-integration-server/libvulkan-server.so"},
|
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qtWebEngine(const QString &distDir)
|
QSet<QString> ModulesQt514::qtWebEngine(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
|
|
||||||
@ -151,8 +85,6 @@ QSet<QString> ModulesQt514::qtWebEngine(const QString &distDir)
|
|||||||
res += utils.createTree({
|
res += utils.createTree({
|
||||||
"./" + distDir + "/lib/libQt5QmlModels.so",
|
"./" + distDir + "/lib/libQt5QmlModels.so",
|
||||||
"./" + distDir + "/lib/libQt5QmlWorkerScript.so",
|
"./" + distDir + "/lib/libQt5QmlWorkerScript.so",
|
||||||
"./" + distDir + "/plugins/wayland-graphics-integration-client/libvulkan-server.so",
|
|
||||||
"./" + distDir + "/plugins/wayland-graphics-integration-server/libvulkan-server.so",
|
|
||||||
"./" + distDir + "/qml/QtQml/WorkerScript.2/libworkerscriptplugin.so",
|
"./" + distDir + "/qml/QtQml/WorkerScript.2/libworkerscriptplugin.so",
|
||||||
"./" + distDir + "/qml/QtQml/WorkerScript.2/plugins.qmltypes",
|
"./" + distDir + "/qml/QtQml/WorkerScript.2/plugins.qmltypes",
|
||||||
"./" + distDir + "/qml/QtQml/WorkerScript.2/qmldir",
|
"./" + distDir + "/qml/QtQml/WorkerScript.2/qmldir",
|
||||||
|
@ -14,16 +14,12 @@ class ModulesQt514 : public ModulesQt513
|
|||||||
public:
|
public:
|
||||||
ModulesQt514();
|
ModulesQt514();
|
||||||
|
|
||||||
static QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR);
|
QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR) const override;
|
||||||
static QSet<QString> onlyC(const QString &distDir = DISTRO_DIR);
|
QSet<QString> onlyC(const QString &distDir = DISTRO_DIR) const override;
|
||||||
static QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR);
|
QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR) const override;
|
||||||
static QSet<QString> qmlLibsExtractPlugins(const QString &distDir = DISTRO_DIR);
|
|
||||||
static QSet<QString> separetedPackageslibs(const QString &distDir = DISTRO_DIR);
|
|
||||||
|
|
||||||
static QSet<QString> outTestLibs(const QString &distDir = DISTRO_DIR);
|
QSet<QString> qtWithoutTr(const QString &distDir = DISTRO_DIR) const override;
|
||||||
|
QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR) const override;
|
||||||
static QSet<QString> qtWithoutTr(const QString &distDir = DISTRO_DIR);
|
|
||||||
static QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MODULESQT514_H
|
#endif // MODULESQT514_H
|
||||||
|
File diff suppressed because it is too large
Load Diff
2
doc/wiki
2
doc/wiki
@ -1 +1 @@
|
|||||||
Subproject commit 68f4daac00f7780cbae69b18ed83d0837fd93e04
|
Subproject commit 878881c535ffddcf17ce22c02c59a69f8842c8fc
|
Loading…
x
Reference in New Issue
Block a user