mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-26 09:44:33 +00:00
new clear method
This commit is contained in:
parent
34c5684c04
commit
4cc3109cb5
4
.gitignore
vendored
4
.gitignore
vendored
@ -56,5 +56,5 @@ sharedQt/
|
||||
distro/
|
||||
|
||||
staticQt/
|
||||
|
||||
build
|
||||
staticQtWin64/
|
||||
build
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
QT -= gui
|
||||
|
||||
CONFIG += c++11 console
|
||||
CONFIG += c++14 console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
QMAKE_LFLAGS+=" -static-libgcc -static-libstdc++"
|
||||
@ -56,6 +56,8 @@ DISTFILES += \
|
||||
../snap/snapcraft.yaml \
|
||||
../README.md \
|
||||
../sharedBuild.sh \
|
||||
../README.md
|
||||
../README.md \
|
||||
../staticBuildWin.sh
|
||||
|
||||
win32: LIBS += -lshlwapi
|
||||
|
||||
|
@ -154,6 +154,8 @@ void Deploy::deploy() {
|
||||
if (!isWinApp && !createRunScript()) {
|
||||
qCritical() << "run script not created!";
|
||||
}
|
||||
|
||||
settings.setValue("deployedFiles", deployedFiles);
|
||||
}
|
||||
|
||||
QString Deploy::getQtDir() const { return DeployUtils::qtDir; }
|
||||
@ -235,7 +237,13 @@ bool Deploy::copyFile(const QString &file, const QString &target,
|
||||
|
||||
qInfo() << "copy :" << target + QDir::separator() + name;
|
||||
|
||||
return QFile::copy(file, target + QDir::separator() + name);
|
||||
if (!QFile::copy(file, target + QDir::separator() + name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
deployedFiles += target + QDir::separator() + name;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Deploy::extract(const QString &file, bool isExtractPlugins) {
|
||||
@ -759,6 +767,17 @@ bool Deploy::extractQml() {
|
||||
|
||||
void Deploy::clear() {
|
||||
|
||||
qInfo() << "clear start!";
|
||||
|
||||
deployedFiles = settings.value("deployedFiles", QStringList()).toStringList();
|
||||
|
||||
for (auto file : deployedFiles) {
|
||||
if (!QFile::remove(file)) {
|
||||
qWarning() << file << "remove fail!";
|
||||
}
|
||||
}
|
||||
deployedFiles.clear();
|
||||
|
||||
QDir dir(targetDir);
|
||||
|
||||
if (dir.cd("lib")) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
#ifndef DEPLOY_H
|
||||
#define DEPLOY_H
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <windependenciesscanner.h>
|
||||
@ -19,6 +20,9 @@ class Deploy {
|
||||
bool onlyCLibs = false;
|
||||
bool isWinApp =false;
|
||||
int depchLimit = 0;
|
||||
QStringList deployedFiles;
|
||||
|
||||
QSettings settings;
|
||||
QString qmlScaner = "";
|
||||
QString qmake = "";
|
||||
QString target = "";
|
||||
|
@ -138,6 +138,10 @@ bool parseQt(Deploy &deploy) {
|
||||
}
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
QCoreApplication::setOrganizationName("QuasarApp");
|
||||
QCoreApplication::setOrganizationDomain("https://github.com/QuasarApp");
|
||||
QCoreApplication::setApplicationName("CQtDeployer");
|
||||
|
||||
if (!QuasarAppUtils::Params::parseParams(argc, argv)) {
|
||||
qWarning() << "wrong parametrs";
|
||||
help();
|
||||
|
Loading…
x
Reference in New Issue
Block a user