mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-30 03:34:34 +00:00
Merge branch 'v1.5' into task_396
This commit is contained in:
commit
0b1b36d7c2
@ -19,7 +19,7 @@ TEMPLATE = lib
|
|||||||
|
|
||||||
DEFINES += DEPLOY_LIBRARY
|
DEFINES += DEPLOY_LIBRARY
|
||||||
|
|
||||||
VERSION = 1.5.0.15
|
VERSION = 1.5.0.23
|
||||||
|
|
||||||
DEFINES += APP_VERSION='\\"$$VERSION\\"'
|
DEFINES += APP_VERSION='\\"$$VERSION\\"'
|
||||||
|
|
||||||
@ -63,6 +63,7 @@ SOURCES += \
|
|||||||
extracter.cpp \
|
extracter.cpp \
|
||||||
filemanager.cpp \
|
filemanager.cpp \
|
||||||
Distributions/idistribution.cpp \
|
Distributions/idistribution.cpp \
|
||||||
|
generalfiles_type.cpp \
|
||||||
ignorerule.cpp \
|
ignorerule.cpp \
|
||||||
metafilemanager.cpp \
|
metafilemanager.cpp \
|
||||||
packagecontrol.cpp \
|
packagecontrol.cpp \
|
||||||
@ -77,6 +78,7 @@ SOURCES += \
|
|||||||
qml.cpp \
|
qml.cpp \
|
||||||
libinfo.cpp \
|
libinfo.cpp \
|
||||||
qtdir.cpp \
|
qtdir.cpp \
|
||||||
|
targetdata.cpp \
|
||||||
targetinfo.cpp \
|
targetinfo.cpp \
|
||||||
zipcompresser.cpp
|
zipcompresser.cpp
|
||||||
|
|
||||||
@ -100,6 +102,7 @@ HEADERS += \
|
|||||||
extracter.h \
|
extracter.h \
|
||||||
filemanager.h \
|
filemanager.h \
|
||||||
Distributions/idistribution.h \
|
Distributions/idistribution.h \
|
||||||
|
generalfiles_type.h \
|
||||||
ignorerule.h \
|
ignorerule.h \
|
||||||
metafilemanager.h \
|
metafilemanager.h \
|
||||||
packagecontrol.h \
|
packagecontrol.h \
|
||||||
@ -114,6 +117,7 @@ HEADERS += \
|
|||||||
qml.h \
|
qml.h \
|
||||||
libinfo.h \
|
libinfo.h \
|
||||||
qtdir.h \
|
qtdir.h \
|
||||||
|
targetdata.h \
|
||||||
targetinfo.h \
|
targetinfo.h \
|
||||||
zipcompresser.h
|
zipcompresser.h
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
Deb::Deb(FileManager *fileManager):
|
Deb::Deb(FileManager *fileManager):
|
||||||
iDistribution(fileManager)
|
iDistribution(fileManager)
|
||||||
{
|
{
|
||||||
setLocation("tmp DEB");
|
setLocation("defaultDEBTemplate");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Deb::deployTemplate(PackageControl &pkg) {
|
bool Deb::deployTemplate(PackageControl &pkg) {
|
||||||
@ -87,7 +87,7 @@ QProcessEnvironment Deb::processEnvirement() const {
|
|||||||
|
|
||||||
QList<SystemCommandData> Deb::runCmd() {
|
QList<SystemCommandData> Deb::runCmd() {
|
||||||
QList<SystemCommandData> res;
|
QList<SystemCommandData> res;
|
||||||
for (const auto& dir: packageFolders) {
|
for (const auto& dir: qAsConst(packageFolders)) {
|
||||||
res.push_back({"dpkg-deb", QStringList{"--build", "--verbose"} << dir});
|
res.push_back({"dpkg-deb", QStringList{"--build", "--verbose"} << dir});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <deployconfig.h>
|
#include <deployconfig.h>
|
||||||
#include <distromodule.h>
|
#include <distromodule.h>
|
||||||
|
#include <quasarapp.h>
|
||||||
|
|
||||||
iDistribution::~iDistribution() = default;
|
iDistribution::~iDistribution() = default;
|
||||||
|
|
||||||
@ -46,11 +47,17 @@ bool iDistribution::unpackFile(const QFileInfo &resource,
|
|||||||
|
|
||||||
QByteArray inputData = file.readAll();
|
QByteArray inputData = file.readAll();
|
||||||
file.close();
|
file.close();
|
||||||
if (!QDir().mkpath(target))
|
if (!QDir().mkpath(target)) {
|
||||||
|
QuasarAppUtils::Params::log(QString("impossible to create path : %0 ").arg(target),
|
||||||
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
file.setFileName(target + "/" + resource.fileName());
|
file.setFileName(target + "/" + resource.fileName());
|
||||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||||
|
QuasarAppUtils::Params::log(QString("impossible to write in file: %0 ").arg(file.fileName()),
|
||||||
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,8 +202,8 @@ bool iDistribution::collectInfo(const DistroModule& pkg,
|
|||||||
cmdArray += ",";
|
cmdArray += ",";
|
||||||
bashArray += " ";
|
bashArray += " ";
|
||||||
}
|
}
|
||||||
cmdArray += "\"" + releativeLocation(pkg) + "/" + fileinfo.fileName() + "\"";
|
cmdArray += "\"" + releativeLocation(pkg) + "/" + fileinfo.baseName() + "\"";
|
||||||
bashArray += fileinfo.fileName();
|
bashArray += fileinfo.baseName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmdArray += "]";
|
cmdArray += "]";
|
||||||
@ -242,6 +249,10 @@ bool iDistribution::deployIcon(TemplateInfo &info ,const DistroModule& pkg) {
|
|||||||
QFileInfo iconInfo(pkg.icon());
|
QFileInfo iconInfo(pkg.icon());
|
||||||
info.Icon = releativeLocation(pkg) + "/icons/" + iconInfo.fileName();
|
info.Icon = releativeLocation(pkg) + "/icons/" + iconInfo.fileName();
|
||||||
if (!copyFile(pkg.icon(), localData + "/icons/", false)) {
|
if (!copyFile(pkg.icon(), localData + "/icons/", false)) {
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log(QString("fail to copy icon: %0 ").arg(pkg.icon()),
|
||||||
|
QuasarAppUtils::Error);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
QIF::QIF(FileManager *fileManager)
|
QIF::QIF(FileManager *fileManager)
|
||||||
:iDistribution(fileManager){
|
:iDistribution(fileManager){
|
||||||
|
|
||||||
setLocation("tmp QIF");
|
setLocation("defaultQIFWTemplate");
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,10 +10,11 @@
|
|||||||
|
|
||||||
ZipArhive::ZipArhive(FileManager *fileManager)
|
ZipArhive::ZipArhive(FileManager *fileManager)
|
||||||
:iDistribution(fileManager) {
|
:iDistribution(fileManager) {
|
||||||
setLocation("tmp zip");
|
setLocation("defaultZIPTemplate");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZipArhive::deployTemplate(PackageControl &pkg) {
|
bool ZipArhive::deployTemplate(PackageControl &pkg) {
|
||||||
|
|
||||||
// default template
|
// default template
|
||||||
const DeployConfig *cfg = DeployCore::_config;
|
const DeployConfig *cfg = DeployCore::_config;
|
||||||
|
|
||||||
|
@ -45,20 +45,16 @@ bool parsePackagesPrivate(Container& mainContainer,
|
|||||||
for (const auto& str: inputParamsList) {
|
for (const auto& str: inputParamsList) {
|
||||||
auto paramsList = str.split(DeployCore::getSeparator(1));
|
auto paramsList = str.split(DeployCore::getSeparator(1));
|
||||||
auto first = paramsList.value(0, "");
|
auto first = paramsList.value(0, "");
|
||||||
auto second = paramsList.value(1, "");
|
|
||||||
if (paramsList.size() == 1)
|
if (paramsList.size() == 1)
|
||||||
(valueLink(mainContainer, defaultPackage, DistroModule{defaultPackage}).*adder)(first);
|
(valueLink(mainContainer, defaultPackage, DistroModule{defaultPackage}).*adder)(first);
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
|
||||||
bool skipError = QuasarAppUtils::Params::isEndable("allowEmptyPackages");
|
bool skipError = QuasarAppUtils::Params::isEndable("allowEmptyPackages");
|
||||||
first = PathUtils::fullStripPath(first);
|
first = PathUtils::fullStripPath(first);
|
||||||
if (!skipError && !mainContainer.contains(first)) {
|
if (!skipError && !mainContainer.contains(first)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int i = 1; i < paramsList.size(); ++i) {
|
for (int i = 1; i < paramsList.size(); ++i) {
|
||||||
(valueLink(mainContainer, first, DistroModule{first}).*adder)(paramsList[i]);
|
(valueLink(mainContainer, first, DistroModule{first}).*adder)(paramsList[i]);
|
||||||
}
|
}
|
||||||
@ -137,6 +133,20 @@ bool ConfigParser::parseParams() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case RunMode::Template: {
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log("Extract defaults Templates ...",
|
||||||
|
QuasarAppUtils::Info);
|
||||||
|
|
||||||
|
if (!parseDeployMode()) {
|
||||||
|
QuasarAppUtils::Params::log("Extract defaults Templates is failed!",
|
||||||
|
QuasarAppUtils::Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DeployCore::_config = &_config;
|
DeployCore::_config = &_config;
|
||||||
@ -473,29 +483,32 @@ bool ConfigParser::initPackages() {
|
|||||||
|
|
||||||
|
|
||||||
for (auto& str: tar_packages_array) {
|
for (auto& str: tar_packages_array) {
|
||||||
auto pair = str.split(DeployCore::getSeparator(1));
|
auto paramsList = str.split(DeployCore::getSeparator(1));
|
||||||
auto package = PathUtils::fullStripPath(pair.value(0, ""));
|
auto package = PathUtils::fullStripPath(paramsList.value(0, ""));
|
||||||
|
|
||||||
auto list = _config.getTargetsListByFilter(pair.value(1, ""));
|
for (int i = 1; i < paramsList.size(); ++i) {
|
||||||
|
auto targetPattern = paramsList.value(i);
|
||||||
|
auto list = _config.getTargetsListByFilter(targetPattern);
|
||||||
|
|
||||||
if (!list.size()) {
|
if (!list.size()) {
|
||||||
auto warning = QString("You create the %0 package with the %1 pattern, "
|
auto warning = QString("You create the %0 package with the %1 pattern, "
|
||||||
"but no matches were found for this pattern. ").
|
"but no matches were found for this pattern. ").
|
||||||
arg(package, pair.value(1, ""));
|
arg(package, targetPattern);
|
||||||
QuasarAppUtils::Params::log(warning, QuasarAppUtils::Warning);
|
QuasarAppUtils::Params::log(warning, QuasarAppUtils::Warning);
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
for (auto it = list.begin(); it != list.end(); ++it) {
|
|
||||||
if (!configuredTargets.contains(it.key())) {
|
|
||||||
configuredTargets.insert(it.key());
|
|
||||||
it.value()->setPackage(package);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto it = list.begin(); it != list.end(); ++it) {
|
||||||
|
if (!configuredTargets.contains(it.key())) {
|
||||||
|
configuredTargets.insert(it.key());
|
||||||
|
it.value()->setPackage(package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_config.packagesEdit().insert(package, DistroModule{package});
|
||||||
}
|
}
|
||||||
|
|
||||||
_config.packagesEdit().insert(package, DistroModule{package});
|
if (paramsList.size() < 2) {
|
||||||
|
|
||||||
if (pair.size() != 2) {
|
|
||||||
defaultPackage = package;
|
defaultPackage = package;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -755,7 +768,10 @@ bool ConfigParser::setTargets(const QStringList &value) {
|
|||||||
|
|
||||||
if (targetInfo.isFile()) {
|
if (targetInfo.isFile()) {
|
||||||
|
|
||||||
_config.targetsEdit().unite(createTarget(QDir::fromNativeSeparators(i)));
|
auto target = createTarget(QDir::fromNativeSeparators(i));
|
||||||
|
if (!_config.targetsEdit().contains(target.target)) {
|
||||||
|
_config.targetsEdit().insert(target.target, target.targetInfo);
|
||||||
|
}
|
||||||
|
|
||||||
isfillList = true;
|
isfillList = true;
|
||||||
}
|
}
|
||||||
@ -807,7 +823,7 @@ bool ConfigParser::setTargetsInDir(const QString &dir, bool recursive) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
for (const auto &file : list) {
|
for (const auto &file : qAsConst(list)) {
|
||||||
|
|
||||||
if (file.isDir()) {
|
if (file.isDir()) {
|
||||||
result |= setTargetsInDir(file.absoluteFilePath(), recursive);
|
result |= setTargetsInDir(file.absoluteFilePath(), recursive);
|
||||||
@ -820,9 +836,13 @@ bool ConfigParser::setTargetsInDir(const QString &dir, bool recursive) {
|
|||||||
if (sufix.isEmpty() || name.contains(".dll", Qt::CaseInsensitive) ||
|
if (sufix.isEmpty() || name.contains(".dll", Qt::CaseInsensitive) ||
|
||||||
name.contains(".so", Qt::CaseInsensitive) || name.contains(".exe", Qt::CaseInsensitive)) {
|
name.contains(".so", Qt::CaseInsensitive) || name.contains(".exe", Qt::CaseInsensitive)) {
|
||||||
|
|
||||||
result = true;
|
|
||||||
|
|
||||||
_config.targetsEdit().unite(createTarget(QDir::fromNativeSeparators(file.absoluteFilePath())));
|
auto target = createTarget(QDir::fromNativeSeparators(file.absoluteFilePath()));
|
||||||
|
if (!_config.targetsEdit().contains(target.target)) {
|
||||||
|
_config.targetsEdit().insert(target.target, target.targetInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
result = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -831,13 +851,13 @@ bool ConfigParser::setTargetsInDir(const QString &dir, bool recursive) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<QString, TargetInfo> ConfigParser::createTarget(const QString &target) {
|
TargetData ConfigParser::createTarget(const QString &target) {
|
||||||
TargetInfo libinfo;
|
TargetInfo libinfo;
|
||||||
auto key = target;
|
auto key = target;
|
||||||
if (_scaner->fillLibInfo(libinfo, key)) {
|
if (_scaner->fillLibInfo(libinfo, key)) {
|
||||||
return {{libinfo.fullPath(), libinfo}};
|
return {libinfo.fullPath(), libinfo};
|
||||||
}
|
}
|
||||||
return {{key, {}}};
|
return {key, {}};
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<QString, TargetInfo>
|
QHash<QString, TargetInfo>
|
||||||
@ -884,6 +904,7 @@ void ConfigParser::initIgnoreList()
|
|||||||
};
|
};
|
||||||
|
|
||||||
_config.ignoreList.addRule(addRuleUnix("libc"));
|
_config.ignoreList.addRule(addRuleUnix("libc"));
|
||||||
|
_config.ignoreList.addRule(addRuleUnix("libstdc++"));
|
||||||
_config.ignoreList.addRule(addRuleUnix("ld-"));
|
_config.ignoreList.addRule(addRuleUnix("ld-"));
|
||||||
_config.ignoreList.addRule(addRuleUnix("libpthread"));
|
_config.ignoreList.addRule(addRuleUnix("libpthread"));
|
||||||
_config.ignoreList.addRule(addRuleUnix("libm"));
|
_config.ignoreList.addRule(addRuleUnix("libm"));
|
||||||
@ -897,7 +918,7 @@ void ConfigParser::initIgnoreList()
|
|||||||
_config.ignoreList.addRule(addRuleUnix("libBrokenLocale"));
|
_config.ignoreList.addRule(addRuleUnix("libBrokenLocale"));
|
||||||
_config.ignoreList.addRule(addRuleUnix("libSegFault"));
|
_config.ignoreList.addRule(addRuleUnix("libSegFault"));
|
||||||
_config.ignoreList.addRule(addRuleUnix("libanl"));
|
_config.ignoreList.addRule(addRuleUnix("libanl"));
|
||||||
_config.ignoreList.addRule(addRuleUnix("libcrypt"));
|
_config.ignoreList.addRule(addRuleUnix("libcrypt.so"));
|
||||||
_config.ignoreList.addRule(addRuleUnix("/gconv/"));
|
_config.ignoreList.addRule(addRuleUnix("/gconv/"));
|
||||||
_config.ignoreList.addRule(addRuleUnix("libnss"));
|
_config.ignoreList.addRule(addRuleUnix("libnss"));
|
||||||
}
|
}
|
||||||
@ -1436,6 +1457,16 @@ bool ConfigParser::smartMoveTargets() {
|
|||||||
bool result = true;
|
bool result = true;
|
||||||
for (auto i = _config.targets().cbegin(); i != _config.targets().cend(); ++i) {
|
for (auto i = _config.targets().cbegin(); i != _config.targets().cend(); ++i) {
|
||||||
|
|
||||||
|
if (!i.value().isValid()) {
|
||||||
|
QuasarAppUtils::Params::log(QString("Internal error ocurred in %0. Target not inited.").arg(__FUNCTION__),
|
||||||
|
QuasarAppUtils::Error);
|
||||||
|
QuasarAppUtils::Params::log(QString("If you see this message please create a new issue"
|
||||||
|
" about this problem on the official github page"
|
||||||
|
" https://github.com/QuasarApp/CQtDeployer/issues/new/choose. "),
|
||||||
|
QuasarAppUtils::Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QFileInfo target(i.key());
|
QFileInfo target(i.key());
|
||||||
|
|
||||||
QString targetPath = _config.getTargetDir() + "/" + i.value().getPackage();
|
QString targetPath = _config.getTargetDir() + "/" + i.value().getPackage();
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "distrostruct.h"
|
#include "distrostruct.h"
|
||||||
#include "envirement.h"
|
#include "envirement.h"
|
||||||
#include "ignorerule.h"
|
#include "ignorerule.h"
|
||||||
|
#include "targetdata.h"
|
||||||
#include "targetinfo.h"
|
#include "targetinfo.h"
|
||||||
|
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
@ -99,7 +100,7 @@ private:
|
|||||||
void readKey(const QString &key, const QJsonObject &obj, const QString &confFileDir) const;
|
void readKey(const QString &key, const QJsonObject &obj, const QString &confFileDir) const;
|
||||||
void readString(const QString &key, const QString &val, const QString &confFileDir) const;
|
void readString(const QString &key, const QString &val, const QString &confFileDir) const;
|
||||||
|
|
||||||
QHash<QString, TargetInfo> createTarget(const QString &target);
|
TargetData createTarget(const QString &target);
|
||||||
QHash<QString, TargetInfo> moveTarget(TargetInfo target, const QString &newLocation);
|
QHash<QString, TargetInfo> moveTarget(TargetInfo target, const QString &newLocation);
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#define DEFINES_H
|
#define DEFINES_H
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 13, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||||
#define splitbehavior Qt::SkipEmptyParts
|
#define splitbehavior Qt::SkipEmptyParts
|
||||||
#else
|
#else
|
||||||
#define splitbehavior QString::SkipEmptyParts
|
#define splitbehavior QString::SkipEmptyParts
|
||||||
|
@ -90,10 +90,13 @@ bool DependenciesScanner::fillLibInfo(LibInfo &info, const QString &file) const
|
|||||||
case PrivateScaner::PE: {
|
case PrivateScaner::PE: {
|
||||||
return _peScaner.getLibInfo(file, info);
|
return _peScaner.getLibInfo(file, info);
|
||||||
}
|
}
|
||||||
case PrivateScaner::ELF:
|
|
||||||
return _elfScaner.getLibInfo(file, info);
|
|
||||||
|
|
||||||
default: return false;
|
case PrivateScaner::ELF: {
|
||||||
|
return _elfScaner.getLibInfo(file, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return _filesScaner.getLibInfo(file, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "pe_type.h"
|
#include "pe_type.h"
|
||||||
#include "elf_type.h"
|
#include "elf_type.h"
|
||||||
#include "libinfo.h"
|
#include "libinfo.h"
|
||||||
|
#include "generalfiles_type.h"
|
||||||
|
|
||||||
|
|
||||||
enum class PrivateScaner: unsigned char {
|
enum class PrivateScaner: unsigned char {
|
||||||
@ -32,6 +33,7 @@ private:
|
|||||||
|
|
||||||
PE _peScaner;
|
PE _peScaner;
|
||||||
ELF _elfScaner;
|
ELF _elfScaner;
|
||||||
|
GeneralFiles _filesScaner;
|
||||||
|
|
||||||
PrivateScaner getScaner(const QString& lib) const;
|
PrivateScaner getScaner(const QString& lib) const;
|
||||||
|
|
||||||
|
@ -87,13 +87,13 @@ bool Deploy::prepare() {
|
|||||||
|
|
||||||
bool Deploy::deploy() {
|
bool Deploy::deploy() {
|
||||||
|
|
||||||
|
_extracter->clear();
|
||||||
|
|
||||||
switch (DeployCore::getMode() ) {
|
switch (DeployCore::getMode() ) {
|
||||||
case RunMode::Deploy:
|
case RunMode::Deploy:
|
||||||
_extracter->deploy();
|
if (!_extracter->deploy())
|
||||||
break;
|
return false;
|
||||||
case RunMode::Clear:
|
|
||||||
_extracter->clear();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -104,8 +104,17 @@ bool Deploy::deploy() {
|
|||||||
|
|
||||||
bool Deploy::packing() {
|
bool Deploy::packing() {
|
||||||
|
|
||||||
if (DeployCore::getMode() != RunMode::Deploy)
|
switch (DeployCore::getMode() ) {
|
||||||
return true;
|
|
||||||
|
|
||||||
return _packing->create();
|
case RunMode::Deploy:
|
||||||
|
return _packing->create();
|
||||||
|
|
||||||
|
case RunMode::Template:
|
||||||
|
return _packing->extractTemplates();
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ class DependenciesScanner;
|
|||||||
class PluginsParser;
|
class PluginsParser;
|
||||||
class Packing;
|
class Packing;
|
||||||
|
|
||||||
|
|
||||||
enum exitCodes {
|
enum exitCodes {
|
||||||
Good = 0x0,
|
Good = 0x0,
|
||||||
PrepareError = 0x1,
|
PrepareError = 0x1,
|
||||||
|
@ -52,7 +52,7 @@ DistroModule DeployConfig::getDistroFromPackage(const QString &package) const {
|
|||||||
return _packages.value(package, DistroModule{package});
|
return _packages.value(package, DistroModule{package});
|
||||||
}
|
}
|
||||||
|
|
||||||
QMultiHash<QString, TargetInfo> &DeployConfig::targetsEdit() {
|
QHash<QString, TargetInfo> &DeployConfig::targetsEdit() {
|
||||||
return _targets;
|
return _targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public:
|
|||||||
const QHash<QString, TargetInfo>& targets() const;
|
const QHash<QString, TargetInfo>& targets() const;
|
||||||
const QHash<QString, DistroModule>& packages() const;
|
const QHash<QString, DistroModule>& packages() const;
|
||||||
|
|
||||||
QMultiHash<QString, TargetInfo> &targetsEdit();
|
QHash<QString, TargetInfo> &targetsEdit();
|
||||||
QHash<QString, DistroModule>& packagesEdit();
|
QHash<QString, DistroModule>& packagesEdit();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -125,7 +125,7 @@ private:
|
|||||||
* key - path
|
* key - path
|
||||||
* value - create wrapper
|
* value - create wrapper
|
||||||
*/
|
*/
|
||||||
QMultiHash<QString, TargetInfo> _targets;
|
QHash<QString, TargetInfo> _targets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief packages
|
* @brief packages
|
||||||
|
@ -159,6 +159,10 @@ RunMode DeployCore::getMode() {
|
|||||||
return RunMode::Init;
|
return RunMode::Init;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (C("getDefaultTemplate")) {
|
||||||
|
return RunMode::Template;
|
||||||
|
}
|
||||||
|
|
||||||
if (C("bin") || C("extraData")) {
|
if (C("bin") || C("extraData")) {
|
||||||
return RunMode::Deploy;
|
return RunMode::Deploy;
|
||||||
}
|
}
|
||||||
@ -211,6 +215,11 @@ void DeployCore::help() {
|
|||||||
"(on snap version you need to turn on permission)"},
|
"(on snap version you need to turn on permission)"},
|
||||||
{"noQt", "Ignors the error of initialize of a qmake. Use only if your application does not use the qt framework."},
|
{"noQt", "Ignors the error of initialize of a qmake. Use only if your application does not use the qt framework."},
|
||||||
{"allowEmptyPackages", "Allows configure the empty packages."},
|
{"allowEmptyPackages", "Allows configure the empty packages."},
|
||||||
|
{"getDefaultTemplate", "Extracts defaults deb or qif templates."
|
||||||
|
" All templates extract into targetDirectory."
|
||||||
|
" For change target directory use the targetDir option."
|
||||||
|
" Example: cqtdeployer -bin myExecutable getDefaultTemplate qif deb."},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -241,7 +250,7 @@ void DeployCore::help() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Part 3 Controll of packages options", {
|
"Part 3 Control of packages options", {
|
||||||
{"-targetPackage [package;tar1,package;tar2]", "Creates a new package and adds 'tar1 and tar2' to it."
|
{"-targetPackage [package;tar1,package;tar2]", "Creates a new package and adds 'tar1 and tar2' to it."
|
||||||
"If you want configure the package that do not have any targets use the allowEmptyPackages option."},
|
"If you want configure the package that do not have any targets use the allowEmptyPackages option."},
|
||||||
{"-qmlOut [package;path,path]", "Sets path to qml out directory"},
|
{"-qmlOut [package;path,path]", "Sets path to qml out directory"},
|
||||||
@ -354,7 +363,8 @@ QStringList DeployCore::helpKeys() {
|
|||||||
"prefix",
|
"prefix",
|
||||||
"deb",
|
"deb",
|
||||||
"allowEmptyPackages",
|
"allowEmptyPackages",
|
||||||
"runScript"
|
"runScript",
|
||||||
|
"getDefaultTemplate"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,8 @@ enum class RunMode: int {
|
|||||||
Info,
|
Info,
|
||||||
Deploy,
|
Deploy,
|
||||||
Clear,
|
Clear,
|
||||||
Init
|
Init,
|
||||||
|
Template
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extracter;
|
class Extracter;
|
||||||
|
@ -18,7 +18,7 @@ ELF::ELF()
|
|||||||
QByteArrayList ELF::getDynamicString(ElfReader& reader) const {
|
QByteArrayList ELF::getDynamicString(ElfReader& reader) const {
|
||||||
auto headers = reader.readHeaders();
|
auto headers = reader.readHeaders();
|
||||||
|
|
||||||
for (const auto §ionHeader : headers.sectionHeaders) {
|
for (const auto §ionHeader : qAsConst(headers.sectionHeaders)) {
|
||||||
if (sectionHeader.name == ".dynstr") {
|
if (sectionHeader.name == ".dynstr") {
|
||||||
auto arr = reader.readSection(sectionHeader.name).split(0);
|
auto arr = reader.readSection(sectionHeader.name).split(0);
|
||||||
return arr;
|
return arr;
|
||||||
|
@ -111,9 +111,8 @@ void Extracter::extractExtraDataTargets() {
|
|||||||
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) {
|
||||||
auto &dep = _packageDependencyes[i.key()];
|
auto &dep = _packageDependencyes[i.key()];
|
||||||
|
const auto extraData = i.value().extraData();
|
||||||
const auto extraDataList = i.value().extraData();
|
for (const auto &target : extraData) {
|
||||||
for (const auto &target : extraDataList) {
|
|
||||||
dep.addExtraData(target);
|
dep.addExtraData(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,9 +136,9 @@ void Extracter::copyExtraPlugins(const QString& package) {
|
|||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
auto targetPath = cnf->getTargetDir() + "/" + package;
|
auto targetPath = cnf->getTargetDir() + "/" + package;
|
||||||
auto distro = cnf->getDistroFromPackage(package);
|
auto distro = cnf->getDistroFromPackage(package);
|
||||||
|
const auto plugins = distro.extraPlugins();
|
||||||
|
|
||||||
auto extraPlugins = distro.extraPlugins();
|
for (const auto &extraPlugin : plugins) {
|
||||||
for (const auto &extraPlugin : extraPlugins) {
|
|
||||||
|
|
||||||
info.setFile(extraPlugin);
|
info.setFile(extraPlugin);
|
||||||
|
|
||||||
@ -268,11 +267,13 @@ void Extracter::copyTr() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extracter::deploy() {
|
bool Extracter::deploy() {
|
||||||
QuasarAppUtils::Params::log("target deploy started!!",
|
QuasarAppUtils::Params::log("target deploy started!!",
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
clear();
|
if (!_cqt->smartMoveTargets()) {
|
||||||
_cqt->smartMoveTargets();
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
_scaner->setEnvironment(DeployCore::_config->envirement.environmentList());
|
_scaner->setEnvironment(DeployCore::_config->envirement.environmentList());
|
||||||
extractAllTargets();
|
extractAllTargets();
|
||||||
extractExtraDataTargets();
|
extractExtraDataTargets();
|
||||||
@ -290,6 +291,7 @@ void Extracter::deploy() {
|
|||||||
|
|
||||||
if (!extractWebEngine()) {
|
if (!extractWebEngine()) {
|
||||||
QuasarAppUtils::Params::log("deploy webEngine failed", QuasarAppUtils::Error);
|
QuasarAppUtils::Params::log("deploy webEngine failed", QuasarAppUtils::Error);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!deployMSVC()) {
|
if (!deployMSVC()) {
|
||||||
@ -300,6 +302,8 @@ void Extracter::deploy() {
|
|||||||
QuasarAppUtils::Params::log("deploy done!",
|
QuasarAppUtils::Params::log("deploy done!",
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Extracter::copyTranslations(const QStringList &list, const QString& package) {
|
bool Extracter::copyTranslations(const QStringList &list, const QString& package) {
|
||||||
@ -405,10 +409,8 @@ bool Extracter::extractQml() {
|
|||||||
|
|
||||||
QStringList plugins;
|
QStringList plugins;
|
||||||
QStringList listItems;
|
QStringList listItems;
|
||||||
|
const auto qmlInput = distro.qmlInput();
|
||||||
const auto qmlImports = distro.qmlInput();
|
for (const auto &qmlInput: qmlInput) {
|
||||||
|
|
||||||
for (const auto &qmlInput: qmlImports) {
|
|
||||||
QFileInfo info(qmlInput);
|
QFileInfo info(qmlInput);
|
||||||
|
|
||||||
if (!info.isDir()) {
|
if (!info.isDir()) {
|
||||||
|
@ -24,7 +24,7 @@ class DEPLOYSHARED_EXPORT Extracter {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Extracter(FileManager *fileManager, PluginsParser* pluginsParser, ConfigParser * cqt, DependenciesScanner *_scaner);
|
explicit Extracter(FileManager *fileManager, PluginsParser* pluginsParser, ConfigParser * cqt, DependenciesScanner *_scaner);
|
||||||
void deploy();
|
bool deploy();
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -352,6 +352,10 @@ bool FileManager::cp(const QString &from,
|
|||||||
bool FileManager::moveFolder(const QString &from, const QString &to, const QString& ignore) {
|
bool FileManager::moveFolder(const QString &from, const QString &to, const QString& ignore) {
|
||||||
QFileInfo info(from);
|
QFileInfo info(from);
|
||||||
|
|
||||||
|
if (to.contains(from)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!info.exists())
|
if (!info.exists())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -443,11 +447,7 @@ QString FileManager::changeDistanation(const QString& absalutePath,
|
|||||||
QString basePath,
|
QString basePath,
|
||||||
int depch) {
|
int depch) {
|
||||||
|
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 13, 0)
|
auto prefixes = absalutePath.split(QRegExp("[\\/]"), splitbehavior);
|
||||||
auto prefixes = absalutePath.split(QRegExp("[\\/]"), Qt::SkipEmptyParts);
|
|
||||||
#else
|
|
||||||
auto prefixes = absalutePath.split(QRegExp("[\\/]"), QString::SkipEmptyParts);
|
|
||||||
#endif
|
|
||||||
depch = std::min(depch, prefixes.size());
|
depch = std::min(depch, prefixes.size());
|
||||||
while (depch) {
|
while (depch) {
|
||||||
auto index = prefixes.size() - depch;
|
auto index = prefixes.size() - depch;
|
||||||
|
24
Deploy/generalfiles_type.cpp
Normal file
24
Deploy/generalfiles_type.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "generalfiles_type.h"
|
||||||
|
|
||||||
|
GeneralFiles::GeneralFiles()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GeneralFiles::getLibInfo(const QString &lib, LibInfo &info) const {
|
||||||
|
|
||||||
|
QFileInfo fileInfo(lib);
|
||||||
|
|
||||||
|
info.setPlatform(GeneralFile);
|
||||||
|
info.setName(fileInfo.fileName());
|
||||||
|
info.setPath(fileInfo.absolutePath());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
26
Deploy/generalfiles_type.h
Normal file
26
Deploy/generalfiles_type.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef GENERALFILES_TYPE_H
|
||||||
|
#define GENERALFILES_TYPE_H
|
||||||
|
|
||||||
|
#include "igetlibinfo.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The GeneralFiles class intendet for extract information of general files.
|
||||||
|
* This is defautl extracte for unknown files types.
|
||||||
|
*/
|
||||||
|
class GeneralFiles: public IGetLibInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GeneralFiles();
|
||||||
|
|
||||||
|
// IGetLibInfo interface
|
||||||
|
bool getLibInfo(const QString &lib, LibInfo &info) const override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GENERALFILES_TYPE_H
|
@ -29,7 +29,7 @@ bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
|||||||
QString content;
|
QString content;
|
||||||
auto runScript = cnf->getRunScript(targetInfo.fileName());
|
auto runScript = cnf->getRunScript(targetInfo.fileName());
|
||||||
if (runScript.size()) {
|
if (runScript.size()) {
|
||||||
auto script = QFile(runScript);
|
QFile script(runScript);
|
||||||
if (!script.open(QIODevice::ReadOnly)) {
|
if (!script.open(QIODevice::ReadOnly)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -43,13 +43,18 @@ bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
|||||||
"@echo off \n"
|
"@echo off \n"
|
||||||
"SET BASE_DIR=%~dp0\n"
|
"SET BASE_DIR=%~dp0\n"
|
||||||
"SET PATH=%BASE_DIR%" + distro.getLibOutDir() + ";%PATH%;" + systemLibsDir + "\n"
|
"SET PATH=%BASE_DIR%" + distro.getLibOutDir() + ";%PATH%;" + systemLibsDir + "\n"
|
||||||
"%2\n"
|
"SET CQT_PKG_ROOT=%BASE_DIR%\n"
|
||||||
"call \"%BASE_DIR%" + distro.getBinOutDir() + "%0\" %1 \n";
|
"SET CQT_RUN_FILE=%BASE_DIR%%5\n"
|
||||||
|
|
||||||
content = content.arg(targetInfo.fileName()).arg("%*");
|
"%3\n"
|
||||||
content = content.arg(generateCustoScriptBlok(true));
|
"start \"%0\" %4 \"%BASE_DIR%" + distro.getBinOutDir() + "%1\" %2 \n";
|
||||||
|
|
||||||
|
content = content.arg(targetInfo.baseName(), targetInfo.fileName(), "%*",
|
||||||
|
generateCustoScriptBlok(true)); // %0 %1 %2 %3
|
||||||
|
|
||||||
content = QDir::toNativeSeparators(content);
|
content = QDir::toNativeSeparators(content);
|
||||||
|
content = content.arg("/B", targetInfo.baseName()+ ".bat"); // %4 %5
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString fname = DeployCore::_config->getTargetDir(target) + QDir::separator() + targetInfo.baseName()+ ".bat";
|
QString fname = DeployCore::_config->getTargetDir(target) + QDir::separator() + targetInfo.baseName()+ ".bat";
|
||||||
@ -85,7 +90,7 @@ bool MetaFileManager::createRunScriptLinux(const QString &target) {
|
|||||||
QString content;
|
QString content;
|
||||||
auto runScript = cnf->getRunScript(targetInfo.fileName());
|
auto runScript = cnf->getRunScript(targetInfo.fileName());
|
||||||
if (runScript.size()) {
|
if (runScript.size()) {
|
||||||
auto script = QFile(runScript);
|
QFile script(runScript);
|
||||||
if (!script.open(QIODevice::ReadOnly)) {
|
if (!script.open(QIODevice::ReadOnly)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -107,14 +112,17 @@ bool MetaFileManager::createRunScriptLinux(const QString &target) {
|
|||||||
"export QT_PLUGIN_PATH=\"$BASE_DIR\"" + distro.getPluginsOutDir() + ":$QT_PLUGIN_PATH\n"
|
"export QT_PLUGIN_PATH=\"$BASE_DIR\"" + distro.getPluginsOutDir() + ":$QT_PLUGIN_PATH\n"
|
||||||
"export QTWEBENGINEPROCESS_PATH=\"$BASE_DIR\"" + distro.getBinOutDir() + "QtWebEngineProcess\n"
|
"export QTWEBENGINEPROCESS_PATH=\"$BASE_DIR\"" + distro.getBinOutDir() + "QtWebEngineProcess\n"
|
||||||
"export QTDIR=\"$BASE_DIR\"\n"
|
"export QTDIR=\"$BASE_DIR\"\n"
|
||||||
|
"export CQT_PKG_ROOT=\"$BASE_DIR\"\n"
|
||||||
|
"export CQT_RUN_FILE=\"$BASE_DIR/%3\"\n"
|
||||||
|
|
||||||
"export "
|
"export "
|
||||||
"QT_QPA_PLATFORM_PLUGIN_PATH=\"$BASE_DIR\"" + distro.getPluginsOutDir() +
|
"QT_QPA_PLATFORM_PLUGIN_PATH=\"$BASE_DIR\"" + distro.getPluginsOutDir() +
|
||||||
"platforms:$QT_QPA_PLATFORM_PLUGIN_PATH\n"
|
"platforms:$QT_QPA_PLATFORM_PLUGIN_PATH\n"
|
||||||
"%2"
|
"%1"
|
||||||
"%3\n"
|
"%2\n"
|
||||||
"\"$BASE_DIR" + distro.getBinOutDir() + "%1\" \"$@\"\n";
|
"\"$BASE_DIR" + distro.getBinOutDir() + "%0\" \"$@\"\n";
|
||||||
|
|
||||||
content = content.arg(targetInfo.fileName());
|
content = content.arg(targetInfo.fileName()); // %0
|
||||||
auto deployedFies = _fileManager->getDeployedFilesStringList();
|
auto deployedFies = _fileManager->getDeployedFilesStringList();
|
||||||
int ld_index = DeployCore::find("ld-linux", deployedFies);
|
int ld_index = DeployCore::find("ld-linux", deployedFies);
|
||||||
|
|
||||||
@ -124,9 +132,12 @@ bool MetaFileManager::createRunScriptLinux(const QString &target) {
|
|||||||
arg(QFileInfo(deployedFies[ld_index]).fileName()));
|
arg(QFileInfo(deployedFies[ld_index]).fileName()));
|
||||||
} else {
|
} else {
|
||||||
content = content.arg("");
|
content = content.arg("");
|
||||||
}
|
} // %1
|
||||||
|
|
||||||
|
content = content.arg(generateCustoScriptBlok(false),
|
||||||
|
targetInfo.baseName()+ ".sh"); // %2 %3
|
||||||
|
|
||||||
|
|
||||||
content = content.arg(generateCustoScriptBlok(false));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,8 +51,12 @@ bool Packing::create() {
|
|||||||
if (!package)
|
if (!package)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!package->deployTemplate(*this))
|
if (!package->deployTemplate(*this)) {
|
||||||
|
QuasarAppUtils::Params::log(QString("Deploy package template error ocured. Package: %0.").
|
||||||
|
arg(package->getClassName()),
|
||||||
|
QuasarAppUtils::Error);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto commands = package->runCmd();
|
auto commands = package->runCmd();
|
||||||
|
|
||||||
@ -121,6 +125,11 @@ bool Packing::create() {
|
|||||||
bool Packing::movePackage(const QString &package,
|
bool Packing::movePackage(const QString &package,
|
||||||
const QString &newLocation) {
|
const QString &newLocation) {
|
||||||
|
|
||||||
|
// Disable moving data for extracting defaults templates.
|
||||||
|
if (QuasarAppUtils::Params::isEndable("getDefaultTemplate")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (moveData(_packagesLocations.value(package),
|
if (moveData(_packagesLocations.value(package),
|
||||||
newLocation)) {
|
newLocation)) {
|
||||||
|
|
||||||
@ -135,6 +144,32 @@ bool Packing::copyPackage(const QString &package, const QString &newLocation) {
|
|||||||
return _fileManager->copyFolder(_packagesLocations[package], newLocation, {}, nullptr, nullptr, true);
|
return _fileManager->copyFolder(_packagesLocations[package], newLocation, {}, nullptr, nullptr, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Packing::extractTemplates() {
|
||||||
|
|
||||||
|
const DeployConfig *cfg = DeployCore::_config;
|
||||||
|
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log("You use the getDefaultTemplate. All using templates will be extracted into " + cfg->getTargetDir(),
|
||||||
|
QuasarAppUtils::Info);
|
||||||
|
|
||||||
|
if (!prepareTemplatesForExtract()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto package : qAsConst(_pakages)) {
|
||||||
|
|
||||||
|
if (!package)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!package->deployTemplate(*this))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
delete package;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList Packing::availablePackages() const {
|
QStringList Packing::availablePackages() const {
|
||||||
return _packagesLocations.keys();
|
return _packagesLocations.keys();
|
||||||
}
|
}
|
||||||
@ -160,6 +195,19 @@ bool Packing::collectPackages() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Packing::prepareTemplatesForExtract() {
|
||||||
|
const DeployConfig *cfg = DeployCore::_config;
|
||||||
|
|
||||||
|
for (auto it = cfg->packages().begin(); it != cfg->packages().end(); ++it) {
|
||||||
|
|
||||||
|
_packagesLocations.insert(it.key(),
|
||||||
|
cfg->getTargetDir() + "/" + TMP_PACKAGE_DIR + "/" + it.key());
|
||||||
|
}
|
||||||
|
|
||||||
|
_defaultPackagesLocations = _packagesLocations;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool Packing::moveData(const QString &from, const QString &to, const QString &ignore) const {
|
bool Packing::moveData(const QString &from, const QString &to, const QString &ignore) const {
|
||||||
|
|
||||||
if (from == to )
|
if (from == to )
|
||||||
|
@ -34,12 +34,20 @@ public:
|
|||||||
bool movePackage(const QString &package, const QString &newLocation) override;
|
bool movePackage(const QString &package, const QString &newLocation) override;
|
||||||
bool copyPackage(const QString &package, const QString &newLocation) override;
|
bool copyPackage(const QString &package, const QString &newLocation) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief extractTemplates This method extract all default temlates. See the getDefaultTemplate for get more information.
|
||||||
|
* @return true if function finished successful.
|
||||||
|
*/
|
||||||
|
bool extractTemplates();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QStringList availablePackages() const override;
|
QStringList availablePackages() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool collectPackages();
|
bool collectPackages();
|
||||||
|
bool prepareTemplatesForExtract();
|
||||||
|
|
||||||
bool moveData(const QString& from, const QString& to,
|
bool moveData(const QString& from, const QString& to,
|
||||||
const QString &ignore = "") const;
|
const QString &ignore = "") const;
|
||||||
|
|
||||||
|
1
Deploy/targetdata.cpp
Normal file
1
Deploy/targetdata.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "targetdata.h"
|
22
Deploy/targetdata.h
Normal file
22
Deploy/targetdata.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018-2021 QuasarApp.
|
||||||
|
* Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
* Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
* of this license document, but changing it is not allowed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TARGETDATA_H
|
||||||
|
#define TARGETDATA_H
|
||||||
|
|
||||||
|
#include "targetinfo.h"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The TargetData struct simple info structo about target.
|
||||||
|
*/
|
||||||
|
struct TargetData {
|
||||||
|
QString target;
|
||||||
|
TargetInfo targetInfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TARGETDATA_H
|
@ -3,7 +3,7 @@
|
|||||||
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
||||||
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
||||||
<Name>CQtDeployer</Name>
|
<Name>CQtDeployer</Name>
|
||||||
<Version>1.5.0.15</Version>
|
<Version>1.5.0.23</Version>
|
||||||
<Title>CQtDeployer</Title>
|
<Title>CQtDeployer</Title>
|
||||||
<Publisher>QuasarApp</Publisher>
|
<Publisher>QuasarApp</Publisher>
|
||||||
<StartMenuDir>CQtDeployer</StartMenuDir>
|
<StartMenuDir>CQtDeployer</StartMenuDir>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
||||||
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
||||||
<Name>CQtDeployer</Name>
|
<Name>CQtDeployer</Name>
|
||||||
<Version>1.5.0.15</Version>
|
<Version>1.5.0.23</Version>
|
||||||
<Title>CQtDeployer</Title>
|
<Title>CQtDeployer</Title>
|
||||||
<Publisher>QuasarApp</Publisher>
|
<Publisher>QuasarApp</Publisher>
|
||||||
<StartMenuDir>CQtDeployer</StartMenuDir>
|
<StartMenuDir>CQtDeployer</StartMenuDir>
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
<Package>
|
<Package>
|
||||||
<DisplayName>CQtDeployer 1.5 Alpha</DisplayName>
|
<DisplayName>CQtDeployer 1.5 Alpha</DisplayName>
|
||||||
<Description>CQtDeployer 1.5 Alpha. Do not use this version because it is unstable and may lead to unwanted bugs or consequences. Use this version exclusively for testing new functionality.</Description>
|
<Description>CQtDeployer 1.5 Alpha. Do not use this version because it is unstable and may lead to unwanted bugs or consequences. Use this version exclusively for testing new functionality.</Description>
|
||||||
<Version>1.5.0.15</Version>
|
<Version>1.5.0.23</Version>
|
||||||
<Default>true</Default>
|
<Default>true</Default>
|
||||||
<ForcedInstallation>false</ForcedInstallation>
|
<ForcedInstallation>false</ForcedInstallation>
|
||||||
<Script>installscript.js</Script>
|
<Script>installscript.js</Script>
|
||||||
<ReleaseDate>2020-09-06</ReleaseDate>
|
<ReleaseDate>2021-02-06</ReleaseDate>
|
||||||
<SortingPriority>201</SortingPriority>
|
<SortingPriority>201</SortingPriority>
|
||||||
<Translations>
|
<Translations>
|
||||||
<Translation>ru.qm</Translation>
|
<Translation>ru.qm</Translation>
|
||||||
|
@ -20,6 +20,8 @@ print("VERSION=" + VERSION)
|
|||||||
# Command Example : aqt tool linux tools_ifw 4.0 qt.tools.ifw.40
|
# Command Example : aqt tool linux tools_ifw 4.0 qt.tools.ifw.40
|
||||||
command = ["aqt",
|
command = ["aqt",
|
||||||
"tool",
|
"tool",
|
||||||
|
"-b",
|
||||||
|
"https://mirrors.ocf.berkeley.edu/qt/",
|
||||||
"--outputdir",
|
"--outputdir",
|
||||||
PATHQIF,
|
PATHQIF,
|
||||||
PLATFORM,
|
PLATFORM,
|
||||||
|
@ -6,6 +6,8 @@ export QML2_IMPORT_PATH="$BASE_DIR"/q/and/q/:$QML2_IMPORT_PATH
|
|||||||
export QT_PLUGIN_PATH="$BASE_DIR"/plugins/:$QT_PLUGIN_PATH
|
export QT_PLUGIN_PATH="$BASE_DIR"/plugins/:$QT_PLUGIN_PATH
|
||||||
export QTWEBENGINEPROCESS_PATH="$BASE_DIR"/bin/QtWebEngineProcess
|
export QTWEBENGINEPROCESS_PATH="$BASE_DIR"/bin/QtWebEngineProcess
|
||||||
export QTDIR="$BASE_DIR"
|
export QTDIR="$BASE_DIR"
|
||||||
|
export CQT_PKG_ROOT="$BASE_DIR"
|
||||||
|
export CQT_RUN_FILE="$BASE_DIR/TestQMLWidgets.sh"
|
||||||
export QT_QPA_PLATFORM_PLUGIN_PATH="$BASE_DIR"/plugins/platforms:$QT_QPA_PLATFORM_PLUGIN_PATH
|
export QT_QPA_PLATFORM_PLUGIN_PATH="$BASE_DIR"/plugins/platforms:$QT_QPA_PLATFORM_PLUGIN_PATH
|
||||||
|
|
||||||
"$BASE_DIR/bin/TestQMLWidgets" "$@"
|
"$BASE_DIR/bin/TestQMLWidgets" "$@"
|
||||||
|
@ -174,6 +174,8 @@ private slots:
|
|||||||
void testEmptyPackages();
|
void testEmptyPackages();
|
||||||
|
|
||||||
void testRunScripts();
|
void testRunScripts();
|
||||||
|
void testGetDefaultTemplate();
|
||||||
|
void testDeployGeneralFiles();
|
||||||
|
|
||||||
void customTest();
|
void customTest();
|
||||||
};
|
};
|
||||||
@ -1100,6 +1102,71 @@ void deploytest::testRunScripts() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deploytest::testGetDefaultTemplate() {
|
||||||
|
TestUtils utils;
|
||||||
|
|
||||||
|
#ifdef Q_OS_UNIX
|
||||||
|
QString bin = TestBinDir + "TestOnlyC";
|
||||||
|
|
||||||
|
auto comapareTree = utils.createTree(
|
||||||
|
{
|
||||||
|
"./" + DISTRO_DIR + "/defaultDEBTemplate/Application/DEBIAN/control",
|
||||||
|
"./" + DISTRO_DIR + "/defaultDEBTemplate/Application/DEBIAN/postinst",
|
||||||
|
"./" + DISTRO_DIR + "/defaultDEBTemplate/Application/DEBIAN/prerm",
|
||||||
|
"./" + DISTRO_DIR + "/defaultDEBTemplate/Application/opt/Application/icons/Icon.png",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/config/config.xml",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/config/controlScript.qs",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/packages/Application/data/icons/Icon.png",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/packages/Application/meta/installscript.qs",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/packages/Application/meta/package.xml"
|
||||||
|
});
|
||||||
|
runTestParams(
|
||||||
|
{"-bin", bin,
|
||||||
|
"force-clear",
|
||||||
|
"getDefaultTemplate",
|
||||||
|
"deb",
|
||||||
|
"qif"
|
||||||
|
}, &comapareTree);
|
||||||
|
#else
|
||||||
|
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||||
|
|
||||||
|
auto comapareTree = utils.createTree(
|
||||||
|
{
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/config/config.xml",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/config/controlScript.qs",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/packages/Application/data/icons/Icon.png",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/packages/Application/meta/installscript.qs",
|
||||||
|
"./" + DISTRO_DIR + "/defaultQIFWTemplate/packages/Application/meta/package.xml"
|
||||||
|
});
|
||||||
|
runTestParams(
|
||||||
|
{"-bin", bin,
|
||||||
|
"force-clear",
|
||||||
|
"getDefaultTemplate",
|
||||||
|
"qif"
|
||||||
|
}, &comapareTree);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void deploytest::testDeployGeneralFiles() {
|
||||||
|
TestUtils utils;
|
||||||
|
|
||||||
|
QString bin = TestBinDir + "/../../CMakeLists.txt";
|
||||||
|
|
||||||
|
auto comapareTree = utils.createTree(
|
||||||
|
{
|
||||||
|
"./" + DISTRO_DIR + "/bin/CMakeLists.txt",
|
||||||
|
"./" + DISTRO_DIR + "/bin/qt.conf",
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
runTestParams(
|
||||||
|
{"-bin", bin,
|
||||||
|
"-binOut", "bin",
|
||||||
|
"force-clear"
|
||||||
|
}, &comapareTree);
|
||||||
|
}
|
||||||
|
|
||||||
void deploytest::customTest() {
|
void deploytest::customTest() {
|
||||||
// runTestParams({"-confFile", "path",
|
// runTestParams({"-confFile", "path",
|
||||||
// "qifFromSystem"});
|
// "qifFromSystem"});
|
||||||
@ -2567,9 +2634,11 @@ void deploytest::testOutDirs() {
|
|||||||
runScript = file.readAll();
|
runScript = file.readAll();
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
qDebug() << "runScript =" << runScript;
|
||||||
|
|
||||||
QVERIFY(runScript.contains("SET BASE_DIR=%~dp0"));
|
QVERIFY(runScript.contains("SET BASE_DIR=%~dp0"));
|
||||||
QVERIFY(runScript.contains("SET PATH=%BASE_DIR%\\lolLib\\;%PATH%"));
|
QVERIFY(runScript.contains("SET PATH=%BASE_DIR%\\lolLib\\;%PATH%"));
|
||||||
QVERIFY(runScript.contains("call \"%BASE_DIR%\\lol\\TestQMLWidgets.exe\" %*"));
|
QVERIFY(runScript.contains("start \"TestQMLWidgets\" /B \"%BASE_DIR%\\lol\\TestQMLWidgets.exe\" %*"));
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
45
docs/en/EnvironmentVariables.md
Normal file
45
docs/en/EnvironmentVariables.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Environment variables of the CQtDeployer
|
||||||
|
This page contains information about environment variables of the default launcher script.
|
||||||
|
|
||||||
|
## Initialization
|
||||||
|
All environment variables initialized in the default launcher script. So if you use the runScript option then you must be reunited all needed variables manually.
|
||||||
|
|
||||||
|
|
||||||
|
## Variables list
|
||||||
|
|
||||||
|
| Variable name | Description |
|
||||||
|
|---|---|
|
||||||
|
| CQT_PKG_ROOT | This variable contains path to root of the current package.|
|
||||||
|
| CQT_RUN_FILE | This variable contains path to the run script of the using application.|
|
||||||
|
|
||||||
|
## Description of definitions
|
||||||
|
|
||||||
|
**Root of the current package** - This root is local root for any separate packages.
|
||||||
|
|
||||||
|
|
||||||
|
Example :
|
||||||
|
``` bash
|
||||||
|
.
|
||||||
|
├── pakcage1 << This is local root of the package1
|
||||||
|
│ ├── bin
|
||||||
|
│ ├── lib
|
||||||
|
│ ├── plugins
|
||||||
|
│ ├── qml
|
||||||
|
│ └── translations
|
||||||
|
├── package2 << This is local root of the package2
|
||||||
|
│ ├── bin
|
||||||
|
│ ├── lib
|
||||||
|
│ ├── plugins
|
||||||
|
│ ├── qml
|
||||||
|
│ └── translations
|
||||||
|
└── pakcage3 << This is local root of the package3
|
||||||
|
├── bin
|
||||||
|
├── lib
|
||||||
|
├── plugins
|
||||||
|
├── qml
|
||||||
|
└── translations
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
48
docs/en/ExtractDefaultsTemplates.md
Normal file
48
docs/en/ExtractDefaultsTemplates.md
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# Extracting default templates
|
||||||
|
|
||||||
|
Sometimes you need to create your own templates for installers or deb packages.
|
||||||
|
Fot this you can use the getDefaultTemplate option. This option extracts your distribution's default template to the target directory. This option will generate a template according to your settings. If you use the targetPackage option then a template will be generated for each package you configured.
|
||||||
|
|
||||||
|
### Example:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
cqtdeployer -bin myExecutable getDefaultTemplate qif
|
||||||
|
```
|
||||||
|
This command generate template for qt installer framework into DistributionKit folder for your "myExecutable" programm.
|
||||||
|
|
||||||
|
If you want change target location just add the targetDir option
|
||||||
|
``` bash
|
||||||
|
cqtdeployer -bin myExecutable getDefaultTemplate qif -targetDir "/distanation/Dir"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Work With multipackage distribution.
|
||||||
|
|
||||||
|
This option support the configFile.json
|
||||||
|
|
||||||
|
### Example :
|
||||||
|
|
||||||
|
#### configFile.json
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
|
||||||
|
"bin": [
|
||||||
|
"myClientExecutable",
|
||||||
|
"myServerExecutable"
|
||||||
|
],
|
||||||
|
|
||||||
|
"targetPackage" : [
|
||||||
|
["Client", "myClientExecutable"],
|
||||||
|
["Server", "myServerExecutable"]
|
||||||
|
],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cqtdeployer getDefaultTemplate qif -confFile "path/to/configFile.json"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Note
|
||||||
|
This option support work with all packages except of zip.
|
||||||
|
If you want get more information about available packages see the packing [page](Package.md).
|
@ -1,5 +1,4 @@
|
|||||||
# How to deploy C++ Application
|
# How to deploy C++ Application
|
||||||
Hi my name is Yankovich Andrei and i an maintainer of the [CQtDeployer tool](https://github.com/QuasarApp/CQtDeployer).
|
|
||||||
|
|
||||||
In this article i describe deploy processes of c++/qt application with cqtdeployer.
|
In this article i describe deploy processes of c++/qt application with cqtdeployer.
|
||||||
|
|
||||||
|
@ -5,17 +5,19 @@
|
|||||||
|
|
||||||
# Main sections
|
# Main sections
|
||||||
|
|
||||||
* [Description CQtDeployer](Description)
|
* [Description CQtDeployer](Description.md)
|
||||||
* [Options](Options)
|
* [Options](Options.md)
|
||||||
* [Guide](Guide)
|
* [Guide](Guide.md)
|
||||||
* [Quick guide](QuickGuide)
|
* [Quick guide](QuickGuide.md)
|
||||||
* [Build and Install](Build-and-Install)
|
* [Build and Install](Build-and-Install.md)
|
||||||
* [Deploy file](DeployConfigFile)
|
* [Deploy file](DeployConfigFile.md)
|
||||||
* [Packing](Packing)
|
* [Packing](Packing.md)
|
||||||
* [Change log page](Changelog)
|
* [Change log page](Changelog.md)
|
||||||
* [Reviews](ReleaseReviews)
|
* [Reviews](ReleaseReviews.md)
|
||||||
* [Compare Features](CompareFeatures)
|
* [Compare Features](CompareFeatures.md)
|
||||||
* [Adding extra files](ExtraFiles.md)
|
* [Adding extra files](ExtraFiles.md)
|
||||||
|
* [Retrieving packaging templates](ExtractDefaultsTemplates.md)
|
||||||
|
* [Default Environment Variables](EnvironmentVariables.md)
|
||||||
|
|
||||||
|
|
||||||
## Support the project
|
## Support the project
|
||||||
|
@ -51,6 +51,7 @@ cqtdeployer -option1 value1 -option2 list, of, values flag1 flag2 flag3
|
|||||||
| deploySystem-with-libc | Deploys all libs include libc (only linux). Do not use this option for a gui application, for gui use the deploySystem option. (on snap version you need to turn on permission) |
|
| deploySystem-with-libc | Deploys all libs include libc (only linux). Do not use this option for a gui application, for gui use the deploySystem option. (on snap version you need to turn on permission) |
|
||||||
| noQt | Ignors the error of initialize of a qmake. Use only if your application does not use the qt framework. |
|
| noQt | Ignors the error of initialize of a qmake. Use only if your application does not use the qt framework. |
|
||||||
| allowEmptyPackages | Allows configure the empty packages. |
|
| allowEmptyPackages | Allows configure the empty packages. |
|
||||||
|
| getDefaultTemplate | Extracts defaults deb or qif templates. For more information see the extracting default templates [page](ExtractDefaultsTemplates.md) |
|
||||||
|
|
||||||
### Deploy options
|
### Deploy options
|
||||||
|
|
||||||
|
43
docs/ru/EnvironmentVariables.md
Normal file
43
docs/ru/EnvironmentVariables.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# Переменные окружения CQtDeployer
|
||||||
|
Эта страница содержит информацию о переменных содержащихся в скрипте запуска по умолчанию.
|
||||||
|
|
||||||
|
## Инициализация
|
||||||
|
Все переменные окружения инициализируются в скрипте запуска по умолчанию. Поэтому, если вы используете опцию runScript, вам необходимо вручную воссоздать все необходимые переменные.
|
||||||
|
|
||||||
|
|
||||||
|
## Список стандартных переменных
|
||||||
|
|
||||||
|
| Имя переменной | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| CQT_PKG_ROOT | Эта переменная содержит путь к корню текущего пакета.
|
||||||
|
| CQT_RUN_FILE | Эта переменная содержит путь к скрипту запуска используемого приложения. |
|
||||||
|
|
||||||
|
|
||||||
|
## Описания определений
|
||||||
|
|
||||||
|
**корень текущего пакета** - Этот корень является локальным корнем для любых отдельных пакетов.
|
||||||
|
|
||||||
|
|
||||||
|
Пример :
|
||||||
|
``` bash
|
||||||
|
.
|
||||||
|
├── pakcage1 << Это локальный корень пакета package1
|
||||||
|
│ ├── bin
|
||||||
|
│ ├── lib
|
||||||
|
│ ├── plugins
|
||||||
|
│ ├── qml
|
||||||
|
│ └── translations
|
||||||
|
├── package2 << Это локальный корень пакета package2
|
||||||
|
│ ├── bin
|
||||||
|
│ ├── lib
|
||||||
|
│ ├── plugins
|
||||||
|
│ ├── qml
|
||||||
|
│ └── translations
|
||||||
|
└── pakcage3 << Это локальный корень пакета package3
|
||||||
|
├── bin
|
||||||
|
├── lib
|
||||||
|
├── plugins
|
||||||
|
├── qml
|
||||||
|
└── translations
|
||||||
|
|
||||||
|
```
|
52
docs/ru/ExtractDefaultsTemplates.md
Normal file
52
docs/ru/ExtractDefaultsTemplates.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# Извлечение шаблонов по умолчанию
|
||||||
|
|
||||||
|
Иногда вам нужно создать свои собственные шаблоны для установщиков или пакетов deb.
|
||||||
|
Для этого вы можете использовать опцию getDefaultTemplate.
|
||||||
|
|
||||||
|
Эта опция извлекает шаблон вашего дистрибутива по умолчанию в целевой каталог.
|
||||||
|
|
||||||
|
Эта опция создаст шаблон в соответствии с вашими настройками. Если вы используете опцию targetPackage, то для каждого настроенного вами пакета будет создан шаблон.
|
||||||
|
|
||||||
|
### Пример:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cqtdeployer -bin myExecutable getDefaultTemplate qif
|
||||||
|
```
|
||||||
|
Эта команда создает шаблон для среды установки qt в папке DistributionKit для вашей программы "myExecutable".
|
||||||
|
|
||||||
|
Если вы хотите изменить целевое местоположение, просто добавьте параметр targetDir
|
||||||
|
```bash
|
||||||
|
cqtdeployer -bin myExecutable getDefaultTemplate qif -targetDir "/distanation/Dir"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Работа с мультипакетной раздачей.
|
||||||
|
|
||||||
|
Эта опция поддерживает configFile.json
|
||||||
|
|
||||||
|
### Пример:
|
||||||
|
|
||||||
|
#### configFile.json
|
||||||
|
`` json
|
||||||
|
{
|
||||||
|
|
||||||
|
"корзина": [
|
||||||
|
"myClientExecutable",
|
||||||
|
"myServerExecutable"
|
||||||
|
],
|
||||||
|
|
||||||
|
"targetPackage": [
|
||||||
|
["Клиент", "myClientExecutable"],
|
||||||
|
["Сервер", "myServerExecutable"]
|
||||||
|
],
|
||||||
|
}
|
||||||
|
``
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cqtdeployer getDefaultTemplate qif -confFile "path/to/configFile.json"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Запись
|
||||||
|
Эта опция поддерживает работу со всеми пакетами, кроме zip.
|
||||||
|
Если вы хотите получить больше информации о доступных пакетах, смотрите упаковку [страница](Package.md).
|
@ -1,5 +1,4 @@
|
|||||||
# Как развернуть приложение C ++
|
# Как развернуть приложение C ++
|
||||||
Привет, меня зовут Янкович Андрей, я сопровождаю [инструмент CQtDeployer](https://github.com/QuasarApp/CQtDeployer).
|
|
||||||
|
|
||||||
В этой статье я описываю процессы развертывания приложения c++/qt с помощью cqtdeployer.
|
В этой статье я описываю процессы развертывания приложения c++/qt с помощью cqtdeployer.
|
||||||
|
|
||||||
@ -92,4 +91,4 @@ cqtdeployer -bin myexecutable -libDir/PathToMyExtraLibs -recursiveDepth 5 -qmlDi
|
|||||||
```
|
```
|
||||||
cqtdeployer -bin myexecutable -libDir / PathToMyExtraLibs -recursiveDepth 5 -qmlDir /path/to/my/qml/sources qif -qmake/path/to/my/qmake
|
cqtdeployer -bin myexecutable -libDir / PathToMyExtraLibs -recursiveDepth 5 -qmlDir /path/to/my/qml/sources qif -qmake/path/to/my/qmake
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -5,17 +5,19 @@
|
|||||||
|
|
||||||
# Основные разделы
|
# Основные разделы
|
||||||
|
|
||||||
* [Описание CQtDeployer](Description)
|
* [Описание CQtDeployer](Description.md)
|
||||||
* [Параметры](Options)
|
* [Параметры](Options.md)
|
||||||
* [Руководство](Guide)
|
* [Руководство](Guide.md)
|
||||||
* [Краткое Руководство](QuickGuide)
|
* [Краткое Руководство](QuickGuide.md)
|
||||||
* [Сборка и установка](Build-and-Install)
|
* [Сборка и установка](Build-and-Install.md)
|
||||||
* [Файл развертывания](DeployConfigFile)
|
* [Файл развертывания](DeployConfigFile.md)
|
||||||
* [Упаковка](Packing)
|
* [Упаковка](Packing.md)
|
||||||
* [Список изменений](Changelog)
|
* [Список изменений](Changelog.md)
|
||||||
* [Обзоры](ReleaseReviews)
|
* [Обзоры](ReleaseReviews.md)
|
||||||
* [Сравнение возможностей](CompareFeatures)
|
* [Сравнение возможностей](CompareFeatures.md)
|
||||||
* [Добавление дополнительных файлов](ExtraFiles.md)
|
* [Добавление дополнительных файлов](ExtraFiles.md)
|
||||||
|
* [Получение шаблонов упаковки](ExtractDefaultsTemplates.md)
|
||||||
|
* [Стандартные переменные окружения](EnvironmentVariables.md)
|
||||||
|
|
||||||
|
|
||||||
## Поддержите проект
|
## Поддержите проект
|
||||||
|
@ -52,6 +52,7 @@ cqtdeployer -option1 value1 -option2 list,of,values flag1 flag2 flag3
|
|||||||
| deploySystem-with-libc | Копирует все зависимости в том числе и libc, не рекомендуется использовать с gui приложения, в место этого используйте опцию deploySystem |
|
| deploySystem-with-libc | Копирует все зависимости в том числе и libc, не рекомендуется использовать с gui приложения, в место этого используйте опцию deploySystem |
|
||||||
| noQt | Игнорирует ошибку инициализации qmake. Используйте только в том случае, если ваше приложение не использует платформу qt. |
|
| noQt | Игнорирует ошибку инициализации qmake. Используйте только в том случае, если ваше приложение не использует платформу qt. |
|
||||||
| allowEmptyPackages | Разрешите настраивать пустые пакеты. |
|
| allowEmptyPackages | Разрешите настраивать пустые пакеты. |
|
||||||
|
| getDefaultTemplate | Извлекает deb или qif шаблоны по умолчанию. Для получения дополнительной информации см. [Страницу](ExtractDefaultsTemplates.md) извлечения шаблонов по умолчанию. |
|
||||||
|
|
||||||
### Параметры развертывания:
|
### Параметры развертывания:
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=1.5.0.15
|
Version=1.5.0.23
|
||||||
Name=CQtDeployer
|
Name=CQtDeployer
|
||||||
Comment=CQtDeployer Help.
|
Comment=CQtDeployer Help.
|
||||||
Exec=cqtdeployer
|
Exec=cqtdeployer
|
||||||
@ -10,6 +10,6 @@ Categories=Application;
|
|||||||
X-GNOME-Bugzilla-Bugzilla=GNOME
|
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||||
X-GNOME-Bugzilla-Product=CQtDeployer
|
X-GNOME-Bugzilla-Product=CQtDeployer
|
||||||
X-GNOME-Bugzilla-Component=General
|
X-GNOME-Bugzilla-Component=General
|
||||||
X-GNOME-Bugzilla-Version=1.5.0.15
|
X-GNOME-Bugzilla-Version=1.5.0.23
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
Name[ru_RU]=CQtDeployer
|
Name[ru_RU]=CQtDeployer
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
name: cqtdeployer # you probably want to 'snapcraft register <name>'
|
name: cqtdeployer # you probably want to 'snapcraft register <name>'
|
||||||
version: '1.5.0.15' # just for humans, typically '1.2+git' or '1.3.2'
|
version: '1.5.0.23' # just for humans, typically '1.2+git' or '1.3.2'
|
||||||
summary: deploy your qt projects # 79 char long summary
|
summary: deploy your qt projects # 79 char long summary
|
||||||
description: |
|
description: |
|
||||||
Console app for deploy qt libs.
|
Console app for deploy qt libs.
|
||||||
|
2
test.pri
2
test.pri
@ -15,7 +15,7 @@ deployTest.commands = $$DEPLOYER -bin $$exec clear -qmake $$QMAKE_BIN -targetDir
|
|||||||
|
|
||||||
!android:test.depends = deployTest
|
!android:test.depends = deployTest
|
||||||
unix:!android:test.commands = $$PWD/deployTests/UnitTests.sh -maxwarnings 100000
|
unix:!android:test.commands = $$PWD/deployTests/UnitTests.sh -maxwarnings 100000
|
||||||
win32:test.commands = $$PWD/deployTests/UnitTests.exe -maxwarnings 100000 -o $$PWD/buildLog.log
|
win32:test.commands = $$PWD/deployTests/UnitTests.exe -maxwarnings 100000 -o buildLog.log
|
||||||
|
|
||||||
contains(QMAKE_HOST.os, Linux):{
|
contains(QMAKE_HOST.os, Linux):{
|
||||||
win32:test.commands =
|
win32:test.commands =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user