mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-07 06:59:35 +00:00
rename prefix to package
This commit is contained in:
parent
5ab1f83e58
commit
4ec4ea6728
@ -4,7 +4,7 @@
|
|||||||
"binDir": "./",
|
"binDir": "./",
|
||||||
"qmlDir": [
|
"qmlDir": [
|
||||||
[
|
[
|
||||||
"prefix2",
|
"package2",
|
||||||
"./TestQMLWidgets/"
|
"./TestQMLWidgets/"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -25,13 +25,13 @@
|
|||||||
"extraLibs": "myExtraLib (libssl)",
|
"extraLibs": "myExtraLib (libssl)",
|
||||||
"extraPlugin": "myExtraPulgin (platforms)",
|
"extraPlugin": "myExtraPulgin (platforms)",
|
||||||
"targetDir": "./Distro",
|
"targetDir": "./Distro",
|
||||||
"targetPrefix": [
|
"targetPackage": [
|
||||||
[
|
[
|
||||||
"/prefix1/",
|
"/package1/",
|
||||||
"TestOnlyC"
|
"TestOnlyC"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"/prefix2/",
|
"/package2/",
|
||||||
"TestQMLWidgets"
|
"TestQMLWidgets"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@ -49,8 +49,8 @@
|
|||||||
"noAutoCheckQmake": false,
|
"noAutoCheckQmake": false,
|
||||||
"name": [
|
"name": [
|
||||||
[
|
[
|
||||||
"prefix2",
|
"package2",
|
||||||
"prefix2Application"
|
"package2Application"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"mainApplication"
|
"mainApplication"
|
||||||
@ -58,16 +58,16 @@
|
|||||||
],
|
],
|
||||||
"description": [
|
"description": [
|
||||||
[
|
[
|
||||||
"prefix2",
|
"package2",
|
||||||
"this is description for prefix 'prefix2'"
|
"this is description for package 'package2'"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"this is description for default prefix"
|
"this is description for default package"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"deployVersion": [
|
"deployVersion": [
|
||||||
[
|
[
|
||||||
"prefix2",
|
"package2",
|
||||||
"1.0.0"
|
"1.0.0"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -76,7 +76,7 @@
|
|||||||
],
|
],
|
||||||
"releaseDate": [
|
"releaseDate": [
|
||||||
[
|
[
|
||||||
"prefix2",
|
"package2",
|
||||||
"yyyy-MM-dd"
|
"yyyy-MM-dd"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -85,7 +85,7 @@
|
|||||||
],
|
],
|
||||||
"icon": [
|
"icon": [
|
||||||
[
|
[
|
||||||
"prefix2",
|
"package2",
|
||||||
"/path/icon.png"
|
"/path/icon.png"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -94,8 +94,8 @@
|
|||||||
],
|
],
|
||||||
"publisher": [
|
"publisher": [
|
||||||
[
|
[
|
||||||
"prefix2",
|
"package2",
|
||||||
"team of prefix2"
|
"team of package2"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"main team"
|
"main team"
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
"extraLibs": "myExtraLib (libssl)",
|
"extraLibs": "myExtraLib (libssl)",
|
||||||
"extraPlugin": "myExtraPulgin (platforms)",
|
"extraPlugin": "myExtraPulgin (platforms)",
|
||||||
"targetDir": "./Distro",
|
"targetDir": "./Distro",
|
||||||
"targetPrefix": "",
|
"targetPackage": "",
|
||||||
"noStrip": false,
|
"noStrip": false,
|
||||||
"extractPlugins": false,
|
"extractPlugins": false,
|
||||||
"noTranslations": false,
|
"noTranslations": false,
|
||||||
|
@ -128,7 +128,7 @@ QString iDistribution::findProcess(const QString &env, const QString& proc) cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
QMap<int ,QPair<QString, const DistroModule*>>
|
QMap<int ,QPair<QString, const DistroModule*>>
|
||||||
iDistribution::sortPrefixes(const QHash<QString, DistroModule> &input) {
|
iDistribution::sortPackages(const QHash<QString, DistroModule> &input) {
|
||||||
QMap<int ,QPair<QString, const DistroModule *>> result;
|
QMap<int ,QPair<QString, const DistroModule *>> result;
|
||||||
for (auto it = input.cbegin(); it != input.cend(); ++it ) {
|
for (auto it = input.cbegin(); it != input.cend(); ++it ) {
|
||||||
result.insertMulti(0xFFFF - it.key().size(), {it.key(), &it.value()});
|
result.insertMulti(0xFFFF - it.key().size(), {it.key(), &it.value()});
|
||||||
|
@ -45,7 +45,7 @@ protected:
|
|||||||
|
|
||||||
QString findProcess(const QString& env, const QString& proc) const;
|
QString findProcess(const QString& env, const QString& proc) const;
|
||||||
|
|
||||||
QMap<int, QPair<QString, const DistroModule *>> sortPrefixes(const QHash<QString, DistroModule> &input);
|
QMap<int, QPair<QString, const DistroModule *>> sortPackages(const QHash<QString, DistroModule> &input);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QString _location = "Temp Template";
|
QString _location = "Temp Template";
|
||||||
|
@ -68,7 +68,7 @@ bool QIF::deployTemplate() {
|
|||||||
if (customTemplate.isEmpty()) {
|
if (customTemplate.isEmpty()) {
|
||||||
// default template
|
// default template
|
||||||
|
|
||||||
auto sortedMap = sortPrefixes(cfg->prefixes());
|
auto sortedMap = sortPackages(cfg->packages());
|
||||||
|
|
||||||
for (auto &it : sortedMap) {
|
for (auto &it : sortedMap) {
|
||||||
auto package = it.second;
|
auto package = it.second;
|
||||||
|
@ -22,18 +22,18 @@
|
|||||||
#include <Distributions/defaultdistro.h>
|
#include <Distributions/defaultdistro.h>
|
||||||
#include <Distributions/qif.h>
|
#include <Distributions/qif.h>
|
||||||
/**
|
/**
|
||||||
* this function init prefixes of project
|
* this function init packages of project
|
||||||
* inputParamsList - list of parameters
|
* inputParamsList - list of parameters
|
||||||
* patern : value;prefix
|
* patern : value;package
|
||||||
* mainContainer - container for insert data, usually it is prefixes map.
|
* mainContainer - container for insert data, usually it is packages map.
|
||||||
* seterFunc - this is method of item of mainConteiner for set value from inputParamsList
|
* seterFunc - this is method of item of mainConteiner for set value from inputParamsList
|
||||||
* important : prefix in inputParamsList must be second.
|
* important : package in inputParamsList must be second.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static QString defaultPrefix = "";
|
static QString defaultPackage = "";
|
||||||
|
|
||||||
template<typename Container, typename Setter>
|
template<typename Container, typename Setter>
|
||||||
bool parsePrefixesPrivate(Container& mainContainer,
|
bool parsePackagesPrivate(Container& mainContainer,
|
||||||
const QStringList &inputParamsList,
|
const QStringList &inputParamsList,
|
||||||
Setter setter) {
|
Setter setter) {
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ bool parsePrefixesPrivate(Container& mainContainer,
|
|||||||
auto first = pair.value(0, "");
|
auto first = pair.value(0, "");
|
||||||
auto second = pair.value(1, "");
|
auto second = pair.value(1, "");
|
||||||
if (pair.size() == 1)
|
if (pair.size() == 1)
|
||||||
(mainContainer[defaultPrefix].*setter)(first);
|
(mainContainer[defaultPackage].*setter)(first);
|
||||||
else {
|
else {
|
||||||
first = PathUtils::toFullPath(first);
|
first = PathUtils::toFullPath(first);
|
||||||
if (!mainContainer.contains(first)) {
|
if (!mainContainer.contains(first)) {
|
||||||
@ -140,7 +140,7 @@ const DeployConfig *ConfigParser::config() const {
|
|||||||
return &_config;
|
return &_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIX ME. if prefix contains the path separators then prefix rewrite to RelativeLink of configFile location
|
// FIX ME. if package contains the path separators then package rewrite to RelativeLink of configFile location
|
||||||
QJsonValue ConfigParser::writeKeyArray(int separatorLvl, const QString ¶meter,
|
QJsonValue ConfigParser::writeKeyArray(int separatorLvl, const QString ¶meter,
|
||||||
const QString &confFileDir) const {
|
const QString &confFileDir) const {
|
||||||
|
|
||||||
@ -288,11 +288,11 @@ bool ConfigParser::loadFromFile(const QString& confFile) {
|
|||||||
|
|
||||||
bool ConfigParser::initDistroStruct() {
|
bool ConfigParser::initDistroStruct() {
|
||||||
|
|
||||||
if (!initPrefixes()) {
|
if (!initPackages()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &mainDistro = _config.prefixesEdit();
|
auto &mainDistro = _config.packagesEdit();
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
|
|
||||||
@ -331,68 +331,68 @@ bool ConfigParser::initDistroStruct() {
|
|||||||
split(DeployCore::getSeparator(0), QString::SkipEmptyParts);
|
split(DeployCore::getSeparator(0), QString::SkipEmptyParts);
|
||||||
|
|
||||||
auto erroLog = [](const QString &flag){
|
auto erroLog = [](const QString &flag){
|
||||||
QuasarAppUtils::Params::verboseLog(QString("Set %0 fail, becouse you try set %0 for not inited prefix."
|
QuasarAppUtils::Params::verboseLog(QString("Set %0 fail, becouse you try set %0 for not inited package."
|
||||||
" Use 'targetPrefix' flag for init the prefixes").arg(flag),
|
" Use 'targetPackage' flag for init the packages").arg(flag),
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
};
|
};
|
||||||
|
|
||||||
// init distro stucts for all targets
|
// init distro stucts for all targets
|
||||||
if (binOut.size() && !parsePrefixesPrivate(mainDistro, binOut, &DistroModule::setBinOutDir)) {
|
if (binOut.size() && !parsePackagesPrivate(mainDistro, binOut, &DistroModule::setBinOutDir)) {
|
||||||
erroLog("binOut");
|
erroLog("binOut");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libOut.size() && !parsePrefixesPrivate(mainDistro, libOut, &DistroModule::setLibOutDir)) {
|
if (libOut.size() && !parsePackagesPrivate(mainDistro, libOut, &DistroModule::setLibOutDir)) {
|
||||||
erroLog("libOut");
|
erroLog("libOut");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qmlOut.size() && !parsePrefixesPrivate(mainDistro, qmlOut, &DistroModule::setQmlOutDir)) {
|
if (qmlOut.size() && !parsePackagesPrivate(mainDistro, qmlOut, &DistroModule::setQmlOutDir)) {
|
||||||
erroLog("qmlOut");
|
erroLog("qmlOut");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trOut.size() && !parsePrefixesPrivate(mainDistro, trOut, &DistroModule::setTrOutDir)) {
|
if (trOut.size() && !parsePackagesPrivate(mainDistro, trOut, &DistroModule::setTrOutDir)) {
|
||||||
erroLog("trOut");
|
erroLog("trOut");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pluginOut.size() && !parsePrefixesPrivate(mainDistro, pluginOut, &DistroModule::setPluginsOutDir)) {
|
if (pluginOut.size() && !parsePackagesPrivate(mainDistro, pluginOut, &DistroModule::setPluginsOutDir)) {
|
||||||
erroLog("pluginOut");
|
erroLog("pluginOut");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recOut.size() && !parsePrefixesPrivate(mainDistro, recOut, &DistroModule::setResOutDir)) {
|
if (recOut.size() && !parsePackagesPrivate(mainDistro, recOut, &DistroModule::setResOutDir)) {
|
||||||
erroLog("recOut");
|
erroLog("recOut");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.size() && !parsePrefixesPrivate(mainDistro, name, &DistroModule::setName)) {
|
if (name.size() && !parsePackagesPrivate(mainDistro, name, &DistroModule::setName)) {
|
||||||
erroLog("name");
|
erroLog("name");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (description.size() && !parsePrefixesPrivate(mainDistro, description, &DistroModule::setDescription)) {
|
if (description.size() && !parsePackagesPrivate(mainDistro, description, &DistroModule::setDescription)) {
|
||||||
erroLog("description");
|
erroLog("description");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deployVersion.size() && !parsePrefixesPrivate(mainDistro, deployVersion, &DistroModule::setVersion)) {
|
if (deployVersion.size() && !parsePackagesPrivate(mainDistro, deployVersion, &DistroModule::setVersion)) {
|
||||||
erroLog("deployVersion");
|
erroLog("deployVersion");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (releaseDate.size() && !parsePrefixesPrivate(mainDistro, releaseDate, &DistroModule::setReleaseData)) {
|
if (releaseDate.size() && !parsePackagesPrivate(mainDistro, releaseDate, &DistroModule::setReleaseData)) {
|
||||||
erroLog("releaseDate");
|
erroLog("releaseDate");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icon.size() && !parsePrefixesPrivate(mainDistro, icon, &DistroModule::setIcon)) {
|
if (icon.size() && !parsePackagesPrivate(mainDistro, icon, &DistroModule::setIcon)) {
|
||||||
erroLog("icon");
|
erroLog("icon");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publisher.size() && !parsePrefixesPrivate(mainDistro, publisher, &DistroModule::setPublisher)) {
|
if (publisher.size() && !parsePackagesPrivate(mainDistro, publisher, &DistroModule::setPublisher)) {
|
||||||
erroLog("Publisher");
|
erroLog("Publisher");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -400,38 +400,38 @@ bool ConfigParser::initDistroStruct() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfigParser::initPrefixes() {
|
bool ConfigParser::initPackages() {
|
||||||
|
|
||||||
defaultPrefix = "";
|
defaultPackage = "";
|
||||||
|
|
||||||
if (QuasarAppUtils::Params::isEndable("targetPrefix")) {
|
if (QuasarAppUtils::Params::isEndable("targetPackage")) {
|
||||||
auto tar_prefixes_array = QuasarAppUtils::Params::getStrArg("targetPrefix", "").
|
auto tar_packages_array = QuasarAppUtils::Params::getStrArg("targetPackage", "").
|
||||||
split(DeployCore::getSeparator(0));
|
split(DeployCore::getSeparator(0));
|
||||||
|
|
||||||
|
|
||||||
QSet<QString> configuredTargets;
|
QSet<QString> configuredTargets;
|
||||||
for (auto& str: tar_prefixes_array) {
|
for (auto& str: tar_packages_array) {
|
||||||
auto pair = str.split(DeployCore::getSeparator(1));
|
auto pair = str.split(DeployCore::getSeparator(1));
|
||||||
auto prefix = PathUtils::toFullPath(pair.value(0, ""));
|
auto package = PathUtils::toFullPath(pair.value(0, ""));
|
||||||
|
|
||||||
auto list = _config.getTargetsListByFilter(pair.value(1, ""));
|
auto list = _config.getTargetsListByFilter(pair.value(1, ""));
|
||||||
|
|
||||||
for (auto it = list.begin(); it != list.end(); ++it) {
|
for (auto it = list.begin(); it != list.end(); ++it) {
|
||||||
if (!configuredTargets.contains(it.key())) {
|
if (!configuredTargets.contains(it.key())) {
|
||||||
configuredTargets.insert(it.key());
|
configuredTargets.insert(it.key());
|
||||||
it.value()->setSufix(prefix);
|
it.value()->setSufix(package);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_config.prefixesEdit().insert(prefix, {});
|
_config.packagesEdit().insert(package, {});
|
||||||
|
|
||||||
if (pair.size() != 2) {
|
if (pair.size() != 2) {
|
||||||
defaultPrefix = prefix;
|
defaultPackage = package;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QuasarAppUtils::Params::verboseLog(
|
QuasarAppUtils::Params::verboseLog(
|
||||||
"Set Default Prefix to " + defaultPrefix,
|
"Set Default Package to " + defaultPackage,
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,15 +449,15 @@ bool ConfigParser::initQmlInput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto erroLog = [](const QString &flag){
|
auto erroLog = [](const QString &flag){
|
||||||
QuasarAppUtils::Params::verboseLog(QString("Set %0 fail, becouse you try set %0 for not inited prefix."
|
QuasarAppUtils::Params::verboseLog(QString("Set %0 fail, becouse you try set %0 for not inited package."
|
||||||
" Use 'targetPrefix' flag for init the prefixes").arg(flag),
|
" Use 'targetPackage' flag for init the packages").arg(flag),
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
};
|
};
|
||||||
|
|
||||||
// init distro stucts for all targets
|
// init distro stucts for all targets
|
||||||
_config.deployQml = qmlDir.size();
|
_config.deployQml = qmlDir.size();
|
||||||
|
|
||||||
if (qmlDir.size() && !parsePrefixesPrivate(_config.prefixesEdit(), qmlDir, &DistroModule::addQmlInput)) {
|
if (qmlDir.size() && !parsePackagesPrivate(_config.packagesEdit(), qmlDir, &DistroModule::addQmlInput)) {
|
||||||
erroLog("qmlDir");
|
erroLog("qmlDir");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1162,7 +1162,7 @@ bool ConfigParser::smartMoveTargets() {
|
|||||||
auto newTargetKey = targetPath + "/" + target.fileName();
|
auto newTargetKey = targetPath + "/" + target.fileName();
|
||||||
temp.unite(moveTarget(i.value(), newTargetKey));
|
temp.unite(moveTarget(i.value(), newTargetKey));
|
||||||
|
|
||||||
_config.prefixesEdit()[i.value().getSufix()].addTarget(newTargetKey);
|
_config.packagesEdit()[i.value().getSufix()].addTarget(newTargetKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,12 +35,12 @@ private:
|
|||||||
DependenciesScanner *_scaner;
|
DependenciesScanner *_scaner;
|
||||||
Packing * _packing;
|
Packing * _packing;
|
||||||
|
|
||||||
QHash<QString, QString> _Targetprefixes;
|
QHash<QString, QString> _Targetpackages;
|
||||||
|
|
||||||
bool createFromDeploy(const QString& file) const;
|
bool createFromDeploy(const QString& file) const;
|
||||||
bool loadFromFile(const QString& file);
|
bool loadFromFile(const QString& file);
|
||||||
bool initDistroStruct();
|
bool initDistroStruct();
|
||||||
bool initPrefixes();
|
bool initPackages();
|
||||||
bool parseDeployMode();
|
bool parseDeployMode();
|
||||||
bool parseInfoMode();
|
bool parseInfoMode();
|
||||||
bool parseInitMode();
|
bool parseInitMode();
|
||||||
|
@ -28,31 +28,31 @@ void DeployConfig::setTargetDir(const QString &target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DistroModule DeployConfig::getDistro(const QString &target) const {
|
DistroModule DeployConfig::getDistro(const QString &target) const {
|
||||||
return _prefixes.value(_targets.value(target).getSufix());
|
return _packages.value(_targets.value(target).getSufix());
|
||||||
}
|
}
|
||||||
|
|
||||||
DistroModule DeployConfig::getDistroFromPrefix(const QString &prefix) const {
|
DistroModule DeployConfig::getDistroFromPackage(const QString &package) const {
|
||||||
if (_prefixes.contains(prefix)) {
|
if (_packages.contains(package)) {
|
||||||
return _prefixes[prefix];
|
return _packages[package];
|
||||||
}
|
}
|
||||||
|
|
||||||
return _prefixes.value("");
|
return _packages.value("");
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<QString, TargetInfo> &DeployConfig::targetsEdit() {
|
QHash<QString, TargetInfo> &DeployConfig::targetsEdit() {
|
||||||
return _targets;
|
return _targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<QString, DistroModule> &DeployConfig::prefixesEdit() {
|
QHash<QString, DistroModule> &DeployConfig::packagesEdit() {
|
||||||
return _prefixes;
|
return _packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QHash<QString, TargetInfo> &DeployConfig::targets() const {
|
const QHash<QString, TargetInfo> &DeployConfig::targets() const {
|
||||||
return _targets;
|
return _targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QHash<QString, DistroModule> &DeployConfig::prefixes() const {
|
const QHash<QString, DistroModule> &DeployConfig::packages() const {
|
||||||
return _prefixes;
|
return _packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,17 +74,17 @@ public:
|
|||||||
DistroModule getDistro(const QString& target) const;
|
DistroModule getDistro(const QString& target) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief getDistroFromPrefix
|
* @brief getDistroFromPackage
|
||||||
* @param prefix
|
* @param package
|
||||||
* @return distro struct from prefix
|
* @return distro struct from package
|
||||||
*/
|
*/
|
||||||
DistroModule getDistroFromPrefix(const QString& prefix) const;
|
DistroModule getDistroFromPackage(const QString& package) const;
|
||||||
|
|
||||||
const QHash<QString, TargetInfo>& targets() const;
|
const QHash<QString, TargetInfo>& targets() const;
|
||||||
const QHash<QString, DistroModule>& prefixes() const;
|
const QHash<QString, DistroModule>& packages() const;
|
||||||
|
|
||||||
QHash<QString, TargetInfo>& targetsEdit();
|
QHash<QString, TargetInfo>& targetsEdit();
|
||||||
QHash<QString, DistroModule>& prefixesEdit();
|
QHash<QString, DistroModule>& packagesEdit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -96,12 +96,12 @@ private:
|
|||||||
QHash<QString, TargetInfo> _targets;
|
QHash<QString, TargetInfo> _targets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief prefixes
|
* @brief packages
|
||||||
* key - prefix
|
* key - package
|
||||||
* value struvture of prefix
|
* value struvture of package
|
||||||
* default prefix is empty value
|
* default package is empty value
|
||||||
*/
|
*/
|
||||||
QHash<QString, DistroModule> _prefixes;
|
QHash<QString, DistroModule> _packages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief targetDir - targe directory (this folder conteins all files of distrebution kit)
|
* @brief targetDir - targe directory (this folder conteins all files of distrebution kit)
|
||||||
|
@ -179,7 +179,7 @@ QString DeployCore::help() {
|
|||||||
{ " -binDir [params] : A folder which includes deployable files (recursive search)." },
|
{ " -binDir [params] : A folder which includes deployable files (recursive search)." },
|
||||||
{ " | WARNING: this flag supports 'so', 'dll' and 'exe' files only." },
|
{ " | WARNING: this flag supports 'so', 'dll' and 'exe' files only." },
|
||||||
{ " | Use '-bin' flag if you want to deploy linux binary files" },
|
{ " | Use '-bin' flag if you want to deploy linux binary files" },
|
||||||
{ " -qmlDir [prefix;path,path]: Qml data dir. For example -qmlDir ~/my/project/qml" },
|
{ " -qmlDir [package;path,path]: Qml data dir. For example -qmlDir ~/my/project/qml" },
|
||||||
{ " deploySystem : Deploys all libs" },
|
{ " deploySystem : Deploys all libs" },
|
||||||
{ " deploySystem-with-libc : Skip Deploys system core libs libs" },
|
{ " deploySystem-with-libc : Skip Deploys system core libs libs" },
|
||||||
{ " -qmake [params] : Qmake path." },
|
{ " -qmake [params] : Qmake path." },
|
||||||
@ -201,7 +201,7 @@ QString DeployCore::help() {
|
|||||||
{ " -extraPlugin[list,params]: Sets an additional path to extraPlugin of an app" },
|
{ " -extraPlugin[list,params]: Sets an additional path to extraPlugin of an app" },
|
||||||
{ " -recursiveDepth [params] : Sets the Depth of recursive search of libs (default 0)" },
|
{ " -recursiveDepth [params] : Sets the Depth of recursive search of libs (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)" },
|
||||||
{ " -targetPrefix [tar1;path,path]: Sets prefix for target( by default it is empty value)" },
|
{ " -targetPackage [tar1;path,path]: Sets package for target( by default it is empty value)" },
|
||||||
{ " noStrip : Skips strip step" },
|
{ " noStrip : Skips strip step" },
|
||||||
{ " extractPlugins | This flag will cause cqtdeployer to retrieve dependencies from plugins." },
|
{ " extractPlugins | This flag will cause cqtdeployer to retrieve dependencies from plugins." },
|
||||||
{ " : Starting with version 1.4, this option has been disabled by default,"},
|
{ " : Starting with version 1.4, this option has been disabled by default,"},
|
||||||
@ -210,19 +210,19 @@ QString DeployCore::help() {
|
|||||||
{ " noTranslations : Skips the translations files." },
|
{ " noTranslations : Skips the translations files." },
|
||||||
{ " | It doesn't work without qmake and inside a snap package" },
|
{ " | It doesn't work without qmake and inside a snap package" },
|
||||||
{ " -noAutoCheckQmake : Disables automatic search of paths to qmake in executable files." },
|
{ " -noAutoCheckQmake : Disables automatic search of paths to qmake in executable files." },
|
||||||
{ " -qmlOut [prefix;val,val] : Sets path to qml out directory" },
|
{ " -qmlOut [package;val,val] : Sets path to qml out directory" },
|
||||||
{ " -libOut [prefix;val,val] : Sets path to libraries out directory" },
|
{ " -libOut [package;val,val] : Sets path to libraries out directory" },
|
||||||
{ " -trOut [prefix;val,val] : Sets path to translations out directory" },
|
{ " -trOut [package;val,val] : Sets path to translations out directory" },
|
||||||
{ " -pluginOut [prefix;val,val]: Sets path to plugins out directory" },
|
{ " -pluginOut [package;val,val]: Sets path to plugins out directory" },
|
||||||
{ " -binOut [prefix;val,val] : Sets path to binary out directory" },
|
{ " -binOut [package;val,val] : Sets path to binary out directory" },
|
||||||
{ " -recOut [prefix;val,val] : Sets path to recurses out directory" },
|
{ " -recOut [package;val,val] : Sets path to recurses out directory" },
|
||||||
|
|
||||||
{ " -name [prefix;val,val] : Sets name for prefix. If this if you do not specify a prefix, the value will be assigned to the default prefix ("")" },
|
{ " -name [package;val,val] : Sets name for package. If this if you do not specify a package, the value will be assigned to the default package ("")" },
|
||||||
{ " -description [prefix;val,val] : Sets description for prefix" },
|
{ " -description [package;val,val] : Sets description for package" },
|
||||||
{ " -deployVersion [prefix;val,val] : Sets version for prefix" },
|
{ " -deployVersion [package;val,val] : Sets version for package" },
|
||||||
{ " -releaseDate [prefix;val,val] : Sets release date for prefix" },
|
{ " -releaseDate [package;val,val] : Sets release date for package" },
|
||||||
{ " -icon [prefix;val,val] : Sets path to icon for prefix" },
|
{ " -icon [package;val,val] : Sets path to icon for package" },
|
||||||
{ " -publisher [prefix;val,val]: Sets Publisher for prefix" },
|
{ " -publisher [package;val,val]: Sets Publisher for package" },
|
||||||
|
|
||||||
{ " -qif [params] : Create the QIF installer for deployement programm" },
|
{ " -qif [params] : Create the QIF installer for deployement programm" },
|
||||||
{ " : By default params value is 'Default'" },
|
{ " : By default params value is 'Default'" },
|
||||||
@ -263,7 +263,7 @@ QStringList DeployCore::helpKeys() {
|
|||||||
"extraPlugin",
|
"extraPlugin",
|
||||||
"recursiveDepth",
|
"recursiveDepth",
|
||||||
"targetDir",
|
"targetDir",
|
||||||
"targetPrefix",
|
"targetPackage",
|
||||||
"noStrip",
|
"noStrip",
|
||||||
"extractPlugins",
|
"extractPlugins",
|
||||||
"noTranslations",
|
"noTranslations",
|
||||||
|
@ -37,8 +37,8 @@ bool Extracter::deployMSVC() {
|
|||||||
return _fileManager->copyFile(msvcInstaller, DeployCore::_config->getTargetDir());
|
return _fileManager->copyFile(msvcInstaller, DeployCore::_config->getTargetDir());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Extracter::isWebEngine(const QString &prefix) const {
|
bool Extracter::isWebEngine(const QString &package) const {
|
||||||
auto qtModules = _prefixDependencyes.value(prefix).qtModules();
|
auto qtModules = _packageDependencyes.value(package).qtModules();
|
||||||
|
|
||||||
return static_cast<quint64>(qtModules) & static_cast<quint64>(DeployCore::QtModule::QtWebEngineModule);
|
return static_cast<quint64>(qtModules) & static_cast<quint64>(DeployCore::QtModule::QtWebEngineModule);
|
||||||
}
|
}
|
||||||
@ -47,10 +47,10 @@ bool Extracter::extractWebEngine() {
|
|||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
|
|
||||||
for (auto i = cnf->prefixes().cbegin(); i != cnf->prefixes().cend(); ++i) {
|
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
||||||
|
|
||||||
const auto &prefix = i.key();
|
const auto &package = i.key();
|
||||||
if (isWebEngine(prefix)) {
|
if (isWebEngine(package)) {
|
||||||
auto webEngeneBin = DeployCore::_config->qtDir.getLibexecs();
|
auto webEngeneBin = DeployCore::_config->qtDir.getLibexecs();
|
||||||
if (DeployCore::_config->qtDir.getQtPlatform() & Platform::Unix) {
|
if (DeployCore::_config->qtDir.getQtPlatform() & Platform::Unix) {
|
||||||
webEngeneBin += "/QtWebEngineProcess";
|
webEngeneBin += "/QtWebEngineProcess";
|
||||||
@ -58,8 +58,8 @@ bool Extracter::extractWebEngine() {
|
|||||||
webEngeneBin += "/QtWebEngineProcess.exe";
|
webEngeneBin += "/QtWebEngineProcess.exe";
|
||||||
}
|
}
|
||||||
|
|
||||||
auto destWebEngine = DeployCore::_config->getTargetDir() + prefix + DeployCore::_config->prefixes()[prefix].getBinOutDir();
|
auto destWebEngine = DeployCore::_config->getTargetDir() + package + DeployCore::_config->packages()[package].getBinOutDir();
|
||||||
auto resOut = DeployCore::_config->getTargetDir() + prefix + DeployCore::_config->prefixes()[prefix].getResOutDir();
|
auto resOut = DeployCore::_config->getTargetDir() + package + DeployCore::_config->packages()[package].getResOutDir();
|
||||||
auto res = DeployCore::_config->qtDir.getResources();
|
auto res = DeployCore::_config->qtDir.getResources();
|
||||||
|
|
||||||
if (!_fileManager->copyFile(webEngeneBin, destWebEngine)) {
|
if (!_fileManager->copyFile(webEngeneBin, destWebEngine)) {
|
||||||
@ -75,13 +75,13 @@ bool Extracter::extractWebEngine() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Extracter::copyPlugin(const QString &plugin, const QString& prefix) {
|
bool Extracter::copyPlugin(const QString &plugin, const QString& package) {
|
||||||
|
|
||||||
QStringList listItems;
|
QStringList listItems;
|
||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
auto targetPath = cnf->getTargetDir() + prefix;
|
auto targetPath = cnf->getTargetDir() + package;
|
||||||
auto distro = cnf->getDistroFromPrefix(prefix);
|
auto distro = cnf->getDistroFromPackage(package);
|
||||||
|
|
||||||
|
|
||||||
auto pluginPath = targetPath + distro.getPluginsOutDir() +
|
auto pluginPath = targetPath + distro.getPluginsOutDir() +
|
||||||
@ -94,21 +94,21 @@ bool Extracter::copyPlugin(const QString &plugin, const QString& prefix) {
|
|||||||
|
|
||||||
for (const auto &item : listItems) {
|
for (const auto &item : listItems) {
|
||||||
if (QuasarAppUtils::Params::isEndable("extractPlugins")) {
|
if (QuasarAppUtils::Params::isEndable("extractPlugins")) {
|
||||||
extract(item, &_prefixDependencyes[prefix]);
|
extract(item, &_packageDependencyes[package]);
|
||||||
} else {
|
} else {
|
||||||
extract(item, &_prefixDependencyes[prefix], "Qt");
|
extract(item, &_packageDependencyes[package], "Qt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extracter::copyExtraPlugins(const QString& prefix) {
|
void Extracter::copyExtraPlugins(const QString& package) {
|
||||||
QFileInfo info;
|
QFileInfo info;
|
||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
auto targetPath = cnf->getTargetDir() + prefix;
|
auto targetPath = cnf->getTargetDir() + package;
|
||||||
auto distro = cnf->getDistroFromPrefix(prefix);
|
auto distro = cnf->getDistroFromPackage(package);
|
||||||
|
|
||||||
for (auto extraPlugin : DeployCore::_config->extraPlugins) {
|
for (auto extraPlugin : DeployCore::_config->extraPlugins) {
|
||||||
|
|
||||||
@ -118,37 +118,37 @@ void Extracter::copyExtraPlugins(const QString& prefix) {
|
|||||||
|
|
||||||
info.setFile(extraPlugin);
|
info.setFile(extraPlugin);
|
||||||
if (info.isDir() && DeployCore::_config->qtDir.isQt(info.absoluteFilePath())) {
|
if (info.isDir() && DeployCore::_config->qtDir.isQt(info.absoluteFilePath())) {
|
||||||
copyPlugin(info.absoluteFilePath(), prefix);
|
copyPlugin(info.absoluteFilePath(), package);
|
||||||
|
|
||||||
} else if (info.exists()) {
|
} else if (info.exists()) {
|
||||||
_fileManager->copyFile(info.absoluteFilePath(),
|
_fileManager->copyFile(info.absoluteFilePath(),
|
||||||
targetPath + distro.getPluginsOutDir());
|
targetPath + distro.getPluginsOutDir());
|
||||||
|
|
||||||
if (QuasarAppUtils::Params::isEndable("extractPlugins")) {
|
if (QuasarAppUtils::Params::isEndable("extractPlugins")) {
|
||||||
extract(info.absoluteFilePath(), &_prefixDependencyes[prefix]);
|
extract(info.absoluteFilePath(), &_packageDependencyes[package]);
|
||||||
} else {
|
} else {
|
||||||
extract(info.absoluteFilePath(), &_prefixDependencyes[prefix], "Qt");
|
extract(info.absoluteFilePath(), &_packageDependencyes[package], "Qt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extracter::copyPlugins(const QStringList &list, const QString& prefix) {
|
void Extracter::copyPlugins(const QStringList &list, const QString& package) {
|
||||||
for (const auto &plugin : list) {
|
for (const auto &plugin : list) {
|
||||||
if (!copyPlugin(plugin, prefix)) {
|
if (!copyPlugin(plugin, package)) {
|
||||||
qWarning() << plugin << " not copied!";
|
qWarning() << plugin << " not copied!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
copyExtraPlugins(prefix);
|
copyExtraPlugins(package);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extracter::extractAllTargets() {
|
void Extracter::extractAllTargets() {
|
||||||
auto cfg = DeployCore::_config;
|
auto cfg = DeployCore::_config;
|
||||||
for (auto i = cfg->prefixes().cbegin(); i != cfg->prefixes().cend(); ++i) {
|
for (auto i = cfg->packages().cbegin(); i != cfg->packages().cend(); ++i) {
|
||||||
_prefixDependencyes[i.key()] = {};
|
_packageDependencyes[i.key()] = {};
|
||||||
|
|
||||||
for (const auto &target : i.value().targets()) {
|
for (const auto &target : i.value().targets()) {
|
||||||
extract(target, &_prefixDependencyes[i.key()]);
|
extract(target, &_packageDependencyes[i.key()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,19 +167,19 @@ void Extracter::extractPlugins() {
|
|||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
PluginsParser pluginsParser;
|
PluginsParser pluginsParser;
|
||||||
|
|
||||||
for (auto i = cnf->prefixes().cbegin(); i != cnf->prefixes().cend(); ++i) {
|
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
||||||
auto distro = cnf->getDistroFromPrefix(i.key());
|
auto distro = cnf->getDistroFromPackage(i.key());
|
||||||
|
|
||||||
QStringList plugins;
|
QStringList plugins;
|
||||||
pluginsParser.scan(cnf->qtDir.getPlugins(), plugins, _prefixDependencyes[i.key()].qtModules());
|
pluginsParser.scan(cnf->qtDir.getPlugins(), plugins, _packageDependencyes[i.key()].qtModules());
|
||||||
copyPlugins(plugins, i.key());
|
copyPlugins(plugins, i.key());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extracter::copyLibs(const QSet<QString> &files, const QString& prefix) {
|
void Extracter::copyLibs(const QSet<QString> &files, const QString& package) {
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
auto targetPath = cnf->getTargetDir() + prefix;
|
auto targetPath = cnf->getTargetDir() + package;
|
||||||
auto distro = cnf->getDistroFromPrefix(prefix);
|
auto distro = cnf->getDistroFromPackage(package);
|
||||||
|
|
||||||
for (const auto &file : files) {
|
for (const auto &file : files) {
|
||||||
if (!_fileManager->smartCopyFile(file, targetPath + distro.getLibOutDir())) {
|
if (!_fileManager->smartCopyFile(file, targetPath + distro.getLibOutDir())) {
|
||||||
@ -191,12 +191,12 @@ void Extracter::copyLibs(const QSet<QString> &files, const QString& prefix) {
|
|||||||
void Extracter::copyFiles() {
|
void Extracter::copyFiles() {
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
|
|
||||||
for (auto i = cnf->prefixes().cbegin(); i != cnf->prefixes().cend(); ++i) {
|
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
||||||
|
|
||||||
copyLibs(_prefixDependencyes[i.key()].neadedLibs(), i.key());
|
copyLibs(_packageDependencyes[i.key()].neadedLibs(), i.key());
|
||||||
|
|
||||||
if (QuasarAppUtils::Params::isEndable("deploySystem")) {
|
if (QuasarAppUtils::Params::isEndable("deploySystem")) {
|
||||||
copyLibs(_prefixDependencyes[i.key()].systemLibs(), i.key());
|
copyLibs(_packageDependencyes[i.key()].systemLibs(), i.key());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!QuasarAppUtils::Params::isEndable("noStrip") && !_fileManager->strip(cnf->getTargetDir())) {
|
if (!QuasarAppUtils::Params::isEndable("noStrip") && !_fileManager->strip(cnf->getTargetDir())) {
|
||||||
@ -211,8 +211,8 @@ void Extracter::copyTr() {
|
|||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
|
|
||||||
for (auto i = cnf->prefixes().cbegin(); i != cnf->prefixes().cend(); ++i) {
|
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
||||||
if (!copyTranslations(DeployCore::extractTranslation(_prefixDependencyes[i.key()].neadedLibs()),
|
if (!copyTranslations(DeployCore::extractTranslation(_packageDependencyes[i.key()].neadedLibs()),
|
||||||
i.key())) {
|
i.key())) {
|
||||||
QuasarAppUtils::Params::verboseLog("Failed to copy standard Qt translations",
|
QuasarAppUtils::Params::verboseLog("Failed to copy standard Qt translations",
|
||||||
QuasarAppUtils::Warning);
|
QuasarAppUtils::Warning);
|
||||||
@ -254,7 +254,7 @@ void Extracter::deploy() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Extracter::copyTranslations(const QStringList &list, const QString& prefix) {
|
bool Extracter::copyTranslations(const QStringList &list, const QString& package) {
|
||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
|
|
||||||
@ -270,14 +270,14 @@ bool Extracter::copyTranslations(const QStringList &list, const QString& prefix)
|
|||||||
|
|
||||||
auto listItems = dir.entryInfoList(filters, QDir::Files | QDir::NoDotAndDotDot);
|
auto listItems = dir.entryInfoList(filters, QDir::Files | QDir::NoDotAndDotDot);
|
||||||
|
|
||||||
auto targetPath = cnf->getTargetDir() + prefix;
|
auto targetPath = cnf->getTargetDir() + package;
|
||||||
auto distro = cnf->getDistroFromPrefix(prefix);
|
auto distro = cnf->getDistroFromPackage(package);
|
||||||
|
|
||||||
for (const auto &i: listItems) {
|
for (const auto &i: listItems) {
|
||||||
_fileManager->copyFile(i.absoluteFilePath(), targetPath + distro.getTrOutDir());
|
_fileManager->copyFile(i.absoluteFilePath(), targetPath + distro.getTrOutDir());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isWebEngine(prefix)) {
|
if (isWebEngine(package)) {
|
||||||
auto trOut = targetPath + distro.getTrOutDir();
|
auto trOut = targetPath + distro.getTrOutDir();
|
||||||
auto tr = DeployCore::_config->qtDir.getTranslations() + "/qtwebengine_locales";
|
auto tr = DeployCore::_config->qtDir.getTranslations() + "/qtwebengine_locales";
|
||||||
_fileManager->copyFolder(tr, trOut + "/qtwebengine_locales");
|
_fileManager->copyFolder(tr, trOut + "/qtwebengine_locales");
|
||||||
@ -351,9 +351,9 @@ bool Extracter::extractQmlAll() {
|
|||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
|
|
||||||
|
|
||||||
for (auto i = cnf->prefixes().cbegin(); i != cnf->prefixes().cend(); ++i) {
|
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
||||||
auto targetPath = cnf->getTargetDir() + i.key();
|
auto targetPath = cnf->getTargetDir() + i.key();
|
||||||
auto distro = cnf->getDistroFromPrefix(i.key());
|
auto distro = cnf->getDistroFromPackage(i.key());
|
||||||
|
|
||||||
QStringList listItems;
|
QStringList listItems;
|
||||||
|
|
||||||
@ -365,9 +365,9 @@ bool Extracter::extractQmlAll() {
|
|||||||
|
|
||||||
for (const auto &item : listItems) {
|
for (const auto &item : listItems) {
|
||||||
if (QuasarAppUtils::Params::isEndable("extractPlugins")) {
|
if (QuasarAppUtils::Params::isEndable("extractPlugins")) {
|
||||||
extract(item, &_prefixDependencyes[i.key()]);
|
extract(item, &_packageDependencyes[i.key()]);
|
||||||
} else {
|
} else {
|
||||||
extract(item, &_prefixDependencyes[i.key()], "Qt");
|
extract(item, &_packageDependencyes[i.key()], "Qt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,9 +380,9 @@ bool Extracter::extractQmlFromSource(const QString& sourceDir) {
|
|||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
|
|
||||||
for (auto i = cnf->prefixes().cbegin(); i != cnf->prefixes().cend(); ++i) {
|
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
||||||
auto targetPath = cnf->getTargetDir() + i.key();
|
auto targetPath = cnf->getTargetDir() + i.key();
|
||||||
auto distro = cnf->getDistroFromPrefix(i.key());
|
auto distro = cnf->getDistroFromPackage(i.key());
|
||||||
|
|
||||||
QStringList plugins;
|
QStringList plugins;
|
||||||
QStringList listItems;
|
QStringList listItems;
|
||||||
@ -419,9 +419,9 @@ bool Extracter::extractQmlFromSource(const QString& sourceDir) {
|
|||||||
|
|
||||||
for (const auto &item : listItems) {
|
for (const auto &item : listItems) {
|
||||||
if (QuasarAppUtils::Params::isEndable("extractPlugins")) {
|
if (QuasarAppUtils::Params::isEndable("extractPlugins")) {
|
||||||
extract(item, &_prefixDependencyes[i.key()]);
|
extract(item, &_packageDependencyes[i.key()]);
|
||||||
} else {
|
} else {
|
||||||
extract(item, &_prefixDependencyes[i.key()], "Qt");
|
extract(item, &_packageDependencyes[i.key()], "Qt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class MetaFileManager;
|
|||||||
class DEPLOYSHARED_EXPORT Extracter {
|
class DEPLOYSHARED_EXPORT Extracter {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QHash<QString, DependencyMap> _prefixDependencyes;
|
QHash<QString, DependencyMap> _packageDependencyes;
|
||||||
|
|
||||||
DependenciesScanner *_scaner;
|
DependenciesScanner *_scaner;
|
||||||
FileManager *_fileManager;
|
FileManager *_fileManager;
|
||||||
@ -30,7 +30,7 @@ class DEPLOYSHARED_EXPORT Extracter {
|
|||||||
MetaFileManager *_metaFileManager;
|
MetaFileManager *_metaFileManager;
|
||||||
|
|
||||||
void extract(const QString &file, DependencyMap* depMap, const QString& mask = "");
|
void extract(const QString &file, DependencyMap* depMap, const QString& mask = "");
|
||||||
bool copyTranslations(const QStringList &list, const QString &prefix);
|
bool copyTranslations(const QStringList &list, const QString &package);
|
||||||
|
|
||||||
bool extractQml();
|
bool extractQml();
|
||||||
|
|
||||||
@ -48,8 +48,8 @@ class DEPLOYSHARED_EXPORT Extracter {
|
|||||||
bool extractWebEngine();
|
bool extractWebEngine();
|
||||||
|
|
||||||
|
|
||||||
bool copyPlugin(const QString &plugin, const QString &prefix);
|
bool copyPlugin(const QString &plugin, const QString &package);
|
||||||
void copyPlugins(const QStringList &list, const QString &prefix);
|
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
|
||||||
@ -59,10 +59,10 @@ class DEPLOYSHARED_EXPORT Extracter {
|
|||||||
void extractPlugins();
|
void extractPlugins();
|
||||||
void copyFiles();
|
void copyFiles();
|
||||||
void copyTr();
|
void copyTr();
|
||||||
void copyExtraPlugins(const QString &prefix);
|
void copyExtraPlugins(const QString &package);
|
||||||
void copyLibs(const QSet<QString> &files, const QString &prefix);
|
void copyLibs(const QSet<QString> &files, const QString &package);
|
||||||
|
|
||||||
bool isWebEngine(const QString& prefix) const;
|
bool isWebEngine(const QString& package) const;
|
||||||
public:
|
public:
|
||||||
explicit Extracter(FileManager *fileManager, ConfigParser * cqt, DependenciesScanner *_scaner);
|
explicit Extracter(FileManager *fileManager, ConfigParser * cqt, DependenciesScanner *_scaner);
|
||||||
void deploy();
|
void deploy();
|
||||||
|
@ -174,7 +174,7 @@ bool MetaFileManager::createQConf(const QString &target) {
|
|||||||
|
|
||||||
QString content =
|
QString content =
|
||||||
"[Paths]\n"
|
"[Paths]\n"
|
||||||
"Prefix= ." + distro.getRootDir(distro.getBinOutDir()) + "\n"
|
"Package= ." + distro.getRootDir(distro.getBinOutDir()) + "\n"
|
||||||
"Libraries= ." + distro.getLibOutDir() + "\n"
|
"Libraries= ." + distro.getLibOutDir() + "\n"
|
||||||
"Plugins= ." + distro.getPluginsOutDir() + "\n"
|
"Plugins= ." + distro.getPluginsOutDir() + "\n"
|
||||||
"Imports= ." + distro.getQmlOutDir() + "\n"
|
"Imports= ." + distro.getQmlOutDir() + "\n"
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@ public:
|
|||||||
static QSet<QString> qtLibs();
|
static QSet<QString> qtLibs();
|
||||||
static QSet<QString> qmlLibs();
|
static QSet<QString> qmlLibs();
|
||||||
static QSet<QString> qmlLibsExtractPlugins();
|
static QSet<QString> qmlLibsExtractPlugins();
|
||||||
static QSet<QString> separetedPrefixeslibs();
|
static QSet<QString> separetedPackageslibs();
|
||||||
|
|
||||||
static QSet<QString> outTestLibs();
|
static QSet<QString> outTestLibs();
|
||||||
|
|
||||||
|
@ -97,8 +97,8 @@ private slots:
|
|||||||
// tested flags confFile
|
// tested flags confFile
|
||||||
void testConfFile();
|
void testConfFile();
|
||||||
|
|
||||||
// tested flags targetPrefix
|
// tested flags targetPackage
|
||||||
void testPrefixes();
|
void testPackages();
|
||||||
|
|
||||||
// tested flags qmlDir qmake
|
// tested flags qmlDir qmake
|
||||||
void testQt();
|
void testQt();
|
||||||
@ -613,15 +613,15 @@ void deploytest::testQIF() {
|
|||||||
bin += "," + target2;
|
bin += "," + target2;
|
||||||
bin += "," + target3;
|
bin += "," + target3;
|
||||||
|
|
||||||
auto prefixString = "/prefix1/;" + QFileInfo(target1).absoluteFilePath() + ",/prefix2/;" + QFileInfo(target2).absoluteFilePath();
|
auto packageString = "/package1/;" + QFileInfo(target1).absoluteFilePath() + ",/package2/;" + QFileInfo(target2).absoluteFilePath();
|
||||||
runTestParams({"-bin", bin, "force-clear",
|
runTestParams({"-bin", bin, "force-clear",
|
||||||
"-binOut", "/lol",
|
"-binOut", "/lol",
|
||||||
"-libOut", "/lolLib",
|
"-libOut", "/lolLib",
|
||||||
"-trOut", "/lolTr",
|
"-trOut", "/lolTr",
|
||||||
"-pluginOut", "/p",
|
"-pluginOut", "/p",
|
||||||
"-qmlOut", "/q",
|
"-qmlOut", "/q",
|
||||||
"-qmlDir", "prefix2;" + TestBinDir + "/../TestQMLWidgets",
|
"-qmlDir", "package2;" + TestBinDir + "/../TestQMLWidgets",
|
||||||
"-targetPrefix", prefixString, "qif"}, &comapareTree);
|
"-targetPackage", packageString, "qif"}, &comapareTree);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,9 +633,13 @@ void deploytest::testInit()
|
|||||||
runTestParams({"init"});
|
runTestParams({"init"});
|
||||||
runTestParams({});
|
runTestParams({});
|
||||||
|
|
||||||
|
QVERIFY(QFile(DEFAULT_COFIGURATION_FILE).remove());
|
||||||
|
|
||||||
runTestParams({"-init", "multiPackage"});
|
runTestParams({"-init", "multiPackage"});
|
||||||
runTestParams({});
|
runTestParams({});
|
||||||
|
|
||||||
|
QVERIFY(QFile(DEFAULT_COFIGURATION_FILE).remove());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void deploytest::testDependencyMap() {
|
void deploytest::testDependencyMap() {
|
||||||
@ -1336,24 +1340,24 @@ void deploytest::testConfFile() {
|
|||||||
QFile f("./" + DISTRO_DIR + "/bin/TestOnlyC");
|
QFile f("./" + DISTRO_DIR + "/bin/TestOnlyC");
|
||||||
comapareTree = utils.createTree(
|
comapareTree = utils.createTree(
|
||||||
{
|
{
|
||||||
"./" + DISTRO_DIR + "/prefix/TestOnlyC.sh",
|
"./" + DISTRO_DIR + "/package/TestOnlyC.sh",
|
||||||
"./" + DISTRO_DIR + "/prefix/bin/TestOnlyC",
|
"./" + DISTRO_DIR + "/package/bin/TestOnlyC",
|
||||||
"./" + DISTRO_DIR + "/prefix/bin/qt.conf"
|
"./" + DISTRO_DIR + "/package/bin/qt.conf"
|
||||||
});
|
});
|
||||||
QString target1 = TestBinDir + "TestOnlyC";
|
QString target1 = TestBinDir + "TestOnlyC";
|
||||||
|
|
||||||
#else
|
#else
|
||||||
QFile f("./" + DISTRO_DIR + "/TestOnlyC.exe");
|
QFile f("./" + DISTRO_DIR + "/TestOnlyC.exe");
|
||||||
comapareTree = utils.createTree(
|
comapareTree = utils.createTree(
|
||||||
{"./" + DISTRO_DIR + "/prefix/TestOnlyC.exe",
|
{"./" + DISTRO_DIR + "/package/TestOnlyC.exe",
|
||||||
"./" + DISTRO_DIR + "/prefix/qt.conf"});
|
"./" + DISTRO_DIR + "/package/qt.conf"});
|
||||||
QString target1 = TestBinDir + "TestOnlyC.exe";
|
QString target1 = TestBinDir + "TestOnlyC.exe";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
bin = target1;
|
bin = target1;
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "force-clear",
|
runTestParams({"-bin", bin, "force-clear",
|
||||||
"-targetPrefix", "prefix;Test",
|
"-targetPackage", "package;Test",
|
||||||
"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"}, &comapareTree);
|
"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"}, &comapareTree);
|
||||||
|
|
||||||
runTestParams({"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"},
|
runTestParams({"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json"},
|
||||||
@ -1364,34 +1368,34 @@ void deploytest::testConfFile() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void deploytest::testPrefixes() {
|
void deploytest::testPackages() {
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
QFile f("./" + DISTRO_DIR + "/bin/TestOnlyC");
|
QFile f("./" + DISTRO_DIR + "/bin/TestOnlyC");
|
||||||
auto comapareTree = utils.createTree(
|
auto comapareTree = utils.createTree(
|
||||||
{
|
{
|
||||||
"./" + DISTRO_DIR + "/prefix/TestOnlyC.sh",
|
"./" + DISTRO_DIR + "/package/TestOnlyC.sh",
|
||||||
"./" + DISTRO_DIR + "/prefix/bin/TestOnlyC",
|
"./" + DISTRO_DIR + "/package/bin/TestOnlyC",
|
||||||
"./" + DISTRO_DIR + "/prefix/bin/qt.conf"
|
"./" + DISTRO_DIR + "/package/bin/qt.conf"
|
||||||
});
|
});
|
||||||
QString target1 = TestBinDir + "TestOnlyC";
|
QString target1 = TestBinDir + "TestOnlyC";
|
||||||
|
|
||||||
#else
|
#else
|
||||||
QFile f("./" + DISTRO_DIR + "/TestOnlyC.exe");
|
QFile f("./" + DISTRO_DIR + "/TestOnlyC.exe");
|
||||||
auto comapareTree = utils.createTree(
|
auto comapareTree = utils.createTree(
|
||||||
{"./" + DISTRO_DIR + "/prefix/TestOnlyC.exe",
|
{"./" + DISTRO_DIR + "/package/TestOnlyC.exe",
|
||||||
"./" + DISTRO_DIR + "/prefix/qt.conf"});
|
"./" + DISTRO_DIR + "/package/qt.conf"});
|
||||||
QString target1 = TestBinDir + "TestOnlyC.exe";
|
QString target1 = TestBinDir + "TestOnlyC.exe";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
QString bin = target1;
|
QString bin = target1;
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "force-clear",
|
runTestParams({"-bin", bin, "force-clear",
|
||||||
"-targetPrefix", "/prefix/;Test"}, &comapareTree);
|
"-targetPackage", "/package/;Test"}, &comapareTree);
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "force-clear",
|
runTestParams({"-bin", bin, "force-clear",
|
||||||
"-targetPrefix", "/prefix/;" + QFileInfo(target1).absoluteFilePath()}, &comapareTree);
|
"-targetPackage", "/package/;" + QFileInfo(target1).absoluteFilePath()}, &comapareTree);
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
QString target2 = TestBinDir + "TestQMLWidgets";
|
QString target2 = TestBinDir + "TestQMLWidgets";
|
||||||
@ -1405,9 +1409,9 @@ void deploytest::testPrefixes() {
|
|||||||
bin += "," + target2;
|
bin += "," + target2;
|
||||||
bin += "," + target3;
|
bin += "," + target3;
|
||||||
|
|
||||||
auto prefixString = "/prefix1/;" + QFileInfo(target1).absoluteFilePath() + ",/prefix2/;" + QFileInfo(target2).absoluteFilePath();
|
auto packageString = "/package1/;" + QFileInfo(target1).absoluteFilePath() + ",/package2/;" + QFileInfo(target2).absoluteFilePath();
|
||||||
|
|
||||||
comapareTree = Modules::separetedPrefixeslibs();
|
comapareTree = Modules::separetedPackageslibs();
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "force-clear",
|
runTestParams({"-bin", bin, "force-clear",
|
||||||
"-binOut", "/lol",
|
"-binOut", "/lol",
|
||||||
@ -1415,27 +1419,27 @@ void deploytest::testPrefixes() {
|
|||||||
"-trOut", "/lolTr",
|
"-trOut", "/lolTr",
|
||||||
"-pluginOut", "/p",
|
"-pluginOut", "/p",
|
||||||
"-qmlOut", "/q",
|
"-qmlOut", "/q",
|
||||||
"-qmlDir", "prefix2;" + TestBinDir + "/../TestQMLWidgets",
|
"-qmlDir", "package2;" + TestBinDir + "/../TestQMLWidgets",
|
||||||
"-targetPrefix", prefixString}, &comapareTree);
|
"-targetPackage", packageString}, &comapareTree);
|
||||||
|
|
||||||
comapareTree -= utils.createTree({
|
comapareTree -= utils.createTree({
|
||||||
"./" + DISTRO_DIR + "/prefix2/bin/TestQMLWidgets",
|
"./" + DISTRO_DIR + "/package2/bin/TestQMLWidgets",
|
||||||
"./" + DISTRO_DIR + "/prefix2/bin/qt.conf",
|
"./" + DISTRO_DIR + "/package2/bin/qt.conf",
|
||||||
});
|
});
|
||||||
|
|
||||||
comapareTree += utils.createTree({
|
comapareTree += utils.createTree({
|
||||||
"./" + DISTRO_DIR + "/prefix2/testBin/TestQMLWidgets",
|
"./" + DISTRO_DIR + "/package2/testBin/TestQMLWidgets",
|
||||||
"./" + DISTRO_DIR + "/prefix2/testBin/qt.conf",
|
"./" + DISTRO_DIR + "/package2/testBin/qt.conf",
|
||||||
});
|
});
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "force-clear",
|
runTestParams({"-bin", bin, "force-clear",
|
||||||
"-binOut", "prefix2;/testBin,lol",
|
"-binOut", "package2;/testBin,lol",
|
||||||
"-libOut", "/lolLib",
|
"-libOut", "/lolLib",
|
||||||
"-trOut", "/lolTr",
|
"-trOut", "/lolTr",
|
||||||
"-pluginOut", "/p",
|
"-pluginOut", "/p",
|
||||||
"-qmlOut", "/q",
|
"-qmlOut", "/q",
|
||||||
"-qmlDir", "prefix2;" + TestBinDir + "/../TestQMLWidgets",
|
"-qmlDir", "package2;" + TestBinDir + "/../TestQMLWidgets",
|
||||||
"-targetPrefix", prefixString}, &comapareTree);
|
"-targetPackage", packageString}, &comapareTree);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2056,7 +2060,7 @@ void deploytest::testOutDirs() {
|
|||||||
auto runScript = file.readAll();
|
auto runScript = file.readAll();
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
QVERIFY(runScript.contains("Prefix= ./../"));
|
QVERIFY(runScript.contains("Package= ./../"));
|
||||||
QVERIFY(runScript.contains("Libraries= ./lolLib/"));
|
QVERIFY(runScript.contains("Libraries= ./lolLib/"));
|
||||||
QVERIFY(runScript.contains("Plugins= ./p/"));
|
QVERIFY(runScript.contains("Plugins= ./p/"));
|
||||||
QVERIFY(runScript.contains("Imports= ./q/"));
|
QVERIFY(runScript.contains("Imports= ./q/"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user