mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-28 02:34:34 +00:00
fix clean for qif
This commit is contained in:
parent
f32c26afb6
commit
85b5121c49
@ -36,3 +36,7 @@ bool DefaultDistro::removeTemplate() const {
|
||||
QProcessEnvironment DefaultDistro::processEnvirement() const {
|
||||
return QProcessEnvironment::systemEnvironment();
|
||||
}
|
||||
|
||||
QStringList DefaultDistro::outPutFiles() const {
|
||||
return {};
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ public:
|
||||
QStringList runArg() const;
|
||||
bool removeTemplate() const;
|
||||
QProcessEnvironment processEnvirement() const;
|
||||
|
||||
QStringList outPutFiles() const;
|
||||
};
|
||||
|
||||
#endif // DEFAULTDISTRO_H
|
||||
|
@ -114,6 +114,14 @@ bool iDistribution::copyFile(const QString &from, const QString &to, bool isFile
|
||||
return _fileManager->copyFile(from, to, nullptr, isFileTarget);
|
||||
}
|
||||
|
||||
void iDistribution::registerOutFiles() const {
|
||||
auto files = outPutFiles();
|
||||
|
||||
for (const auto& i : files) {
|
||||
_fileManager->addToDeployed(i);
|
||||
}
|
||||
}
|
||||
|
||||
QMap<int ,QPair<QString, const DistroModule*>>
|
||||
iDistribution::sortPackages(const QHash<QString, DistroModule> &input) {
|
||||
QMap<int, QPair<QString, const DistroModule *>> result;
|
||||
|
@ -24,6 +24,7 @@ public:
|
||||
|
||||
virtual QString runCmd() = 0;
|
||||
virtual QStringList runArg() const = 0;
|
||||
virtual QStringList outPutFiles() const = 0;
|
||||
|
||||
QString getClassName() const;
|
||||
|
||||
@ -43,6 +44,8 @@ protected:
|
||||
bool moveData(const QString& from, const QString& to, const QString &ignore) const;
|
||||
bool copyFile(const QString& from, const QString& to, bool isFileTarget) const;
|
||||
|
||||
void registerOutFiles() const;
|
||||
|
||||
|
||||
QMap<int, QPair<QString, const DistroModule *>> sortPackages(const QHash<QString, DistroModule> &input);
|
||||
private:
|
||||
|
@ -79,11 +79,15 @@ bool QIF::deployTemplate() {
|
||||
TemplateInfo info;
|
||||
info.Name = PathUtils::stripPath(it.first);
|
||||
|
||||
if (!package->name().isEmpty()) {
|
||||
if (info.Name.isEmpty()) {
|
||||
QFileInfo targetInfo(*package->targets().begin());
|
||||
info.Name = targetInfo.baseName();
|
||||
}
|
||||
|
||||
if (!package->name().isEmpty()) {
|
||||
info.Name = package->name();
|
||||
}
|
||||
|
||||
auto location = cfg->getTargetDir() + "/" + getLocation() + "/packages/" +
|
||||
((it.first.isEmpty())? "Application": info.Name);
|
||||
|
||||
@ -188,17 +192,12 @@ bool QIF::deployTemplate() {
|
||||
QStringList QIF::runArg() const {
|
||||
|
||||
auto location = DeployCore::_config->getTargetDir() + "/" + getLocation();
|
||||
#ifdef Q_OS_LINUX
|
||||
QString sufix = ".run";
|
||||
#else
|
||||
QString sufix = ".exe";
|
||||
#endif
|
||||
|
||||
return {
|
||||
"-c", location + "/config/config.xml",
|
||||
"-p", location + "/packages/",
|
||||
"-v",
|
||||
DeployCore::_config->getTargetDir() + "/" + generalInfo.Name + sufix
|
||||
installerFile()
|
||||
};
|
||||
}
|
||||
|
||||
@ -206,6 +205,7 @@ bool QIF::removeTemplate() const {
|
||||
auto customTemplate = QuasarAppUtils::Params::getStrArg("qif", "");
|
||||
const DeployConfig *cfg = DeployCore::_config;
|
||||
|
||||
registerOutFiles();
|
||||
if (customTemplate.isEmpty()) {
|
||||
return QDir(cfg->getTargetDir() + "/" + getLocation()).removeRecursively();
|
||||
}
|
||||
@ -217,6 +217,10 @@ QProcessEnvironment QIF::processEnvirement() const {
|
||||
return QProcessEnvironment::systemEnvironment();
|
||||
}
|
||||
|
||||
QStringList QIF::outPutFiles() const {
|
||||
return {installerFile()};
|
||||
}
|
||||
|
||||
QString QIF::getStyle(const QString& input) const {
|
||||
QDir resurces(":/Styles/Distributions/Templates/qif/Styles");
|
||||
auto list = resurces.entryInfoList(QDir::Files);
|
||||
@ -238,3 +242,13 @@ QString QIF::getStyle(const QString& input) const {
|
||||
return "";
|
||||
}
|
||||
|
||||
QString QIF::installerFile() const {
|
||||
#ifdef Q_OS_LINUX
|
||||
QString sufix = ".run";
|
||||
#else
|
||||
QString sufix = ".exe";
|
||||
#endif
|
||||
|
||||
return DeployCore::_config->getTargetDir() + "/Installer" + generalInfo.Name + sufix;
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,14 @@ public:
|
||||
QStringList runArg() const;
|
||||
bool removeTemplate() const;
|
||||
QProcessEnvironment processEnvirement() const;
|
||||
QStringList outPutFiles() const;
|
||||
|
||||
private:
|
||||
QString binarycreator;
|
||||
TemplateInfo generalInfo;
|
||||
QString getStyle(const QString &input) const;
|
||||
QString installerFile() const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -597,16 +597,22 @@ void deploytest::testQIF() {
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
auto comapareTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/Application.run",
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.run",
|
||||
});
|
||||
|
||||
auto comapareTreeMulti = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.run",
|
||||
});
|
||||
#else
|
||||
QString bin = TestBinDir + "TestQMLWidgets.exe";
|
||||
QString target1 = TestBinDir + "TestOnlyC.exe";
|
||||
|
||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||
auto comapareTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/Application.exe",
|
||||
"./" + DISTRO_DIR + "/InstallerTestQMLWidgets.exe",
|
||||
});
|
||||
auto comapareTreeMulti = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/InstallerQtWidgetsProject.exe",
|
||||
});
|
||||
|
||||
#endif
|
||||
@ -648,7 +654,7 @@ void deploytest::testQIF() {
|
||||
"-pluginOut", "/p",
|
||||
"-qmlOut", "/q",
|
||||
"-qmlDir", "package2;" + TestBinDir + "/../TestQMLWidgets",
|
||||
"-targetPackage", packageString, "qif"}, &comapareTree, {}, true);
|
||||
"-targetPackage", packageString, "qif"}, &comapareTreeMulti, {}, true);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user