mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-19 12:59:35 +00:00
init config
This commit is contained in:
parent
addf461fa1
commit
b5546ad595
@ -3,6 +3,7 @@
|
|||||||
<file>Distributions/configures/Qt.json</file>
|
<file>Distributions/configures/Qt.json</file>
|
||||||
<file>Distributions/configures/QIF.json</file>
|
<file>Distributions/configures/QIF.json</file>
|
||||||
<file>Distributions/configures/C and C++.json</file>
|
<file>Distributions/configures/C and C++.json</file>
|
||||||
|
<file>Distributions/configures/InitConfiguration.json</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/Templates/QIF">
|
<qresource prefix="/Templates/QIF">
|
||||||
<file>Distributions/Templates/qif/packages/default/meta/package.xml</file>
|
<file>Distributions/Templates/qif/packages/default/meta/package.xml</file>
|
||||||
|
39
Deploy/Distributions/configures/InitConfiguration.json
Normal file
39
Deploy/Distributions/configures/InitConfiguration.json
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"noOverwrite": false,
|
||||||
|
"bin": "./",
|
||||||
|
"binDir": "./",
|
||||||
|
"qmlDir": "./",
|
||||||
|
"deploySystem": false,
|
||||||
|
"deploySystem-with-libc": false,
|
||||||
|
"qmake": "this parameter should contain the path to your qmake, for Windows this field is required. On Linux, you can remove it, then qmake will be found by rpath.",
|
||||||
|
"ignore": "my ignore patern or my ignoreLib.dll",
|
||||||
|
"ignoreEnv": "/my/ignore/path",
|
||||||
|
"clear": true,
|
||||||
|
"force-clear": false,
|
||||||
|
"allQmlDependes": false,
|
||||||
|
"libDir": "./",
|
||||||
|
"extraLibs": "myExtraLib (libssl)",
|
||||||
|
"extraPlugin": "myExtraPulgin (platforms)",
|
||||||
|
"recursiveDepth": 2,
|
||||||
|
"targetDir": "./Distro",
|
||||||
|
"targetPrefix": "myApp;prefix/of/App",
|
||||||
|
"noStrip": false,
|
||||||
|
"extractPlugins": false,
|
||||||
|
"noTranslations": false,
|
||||||
|
"qmlOut": "qml",
|
||||||
|
"libOut": "lib",
|
||||||
|
"trOut": "tr",
|
||||||
|
"pluginOut": "plug",
|
||||||
|
"binOut": "bin",
|
||||||
|
"recOut": "rec",
|
||||||
|
"verbose": 1,
|
||||||
|
"qif": false,
|
||||||
|
"noAutoCheckQmake": false,
|
||||||
|
"name": "prefix/of/App;AppWithPrefix",
|
||||||
|
"description": "prefix/of/App;AppWithPrefix Description",
|
||||||
|
"deployVersion": "prefix/of/App;1.0.0",
|
||||||
|
"releaseDate": "prefix/of/App;10:10:2020",
|
||||||
|
"icon": "prefix/of/App;path/to/icon.png",
|
||||||
|
"publisher": "prefix/of/App;AppWithPrefix",
|
||||||
|
"customScript": "echo 'I am use custom script!!!'"
|
||||||
|
}
|
@ -75,45 +75,48 @@ bool ConfigParser::parseParams() {
|
|||||||
|
|
||||||
switch (DeployCore::getMode()) {
|
switch (DeployCore::getMode()) {
|
||||||
case RunMode::Info: {
|
case RunMode::Info: {
|
||||||
qInfo() << "selected info mode" ;
|
qInfo() << "Print info ..." ;
|
||||||
|
|
||||||
if (!parseQtInfoMode()) {
|
if (!parseInfoMode()) {
|
||||||
qCritical() << "info mode fail!";
|
qCritical() << "show info is failed!";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeployCore::_config = &_config;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RunMode::Clear: {
|
case RunMode::Clear: {
|
||||||
qInfo() << "selected clear mode" ;
|
qInfo() << "clear ..." ;
|
||||||
|
|
||||||
if (!parseQtClearMode()) {
|
if (!parseClearMode()) {
|
||||||
qCritical() << "clear mode fail!";
|
qCritical() << "clear is failed!";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
DeployCore::_config = &_config;
|
case RunMode::Init: {
|
||||||
|
qInfo() << "Init ..." ;
|
||||||
|
|
||||||
|
if (!parseInitMode()) {
|
||||||
|
qCritical() << "init is failed!";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case RunMode::Deploy: {
|
case RunMode::Deploy: {
|
||||||
qInfo() << "selected deploy mode" ;
|
qInfo() << "Deploy ..." ;
|
||||||
|
|
||||||
if (!parseQtDeployMode()) {
|
if (!parseDeployMode()) {
|
||||||
qCritical() << "deploy mode fail!";
|
qCritical() << "deploy is failed!";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeployCore::_config = &_config;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeployCore::_config = &_config;
|
||||||
|
|
||||||
if (createFile && !createFromDeploy(path)) {
|
if (createFile && !createFromDeploy(path)) {
|
||||||
QuasarAppUtils::Params::verboseLog("Do not create a deploy config file in " + path,
|
QuasarAppUtils::Params::verboseLog("Do not create a deploy config file in " + path,
|
||||||
QuasarAppUtils::Error);
|
QuasarAppUtils::Error);
|
||||||
@ -451,7 +454,7 @@ bool ConfigParser::initQmlInput() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfigParser::parseQtDeployMode() {
|
bool ConfigParser::parseDeployMode() {
|
||||||
|
|
||||||
if (QuasarAppUtils::Params::isEndable("deploySystem-with-libc")) {
|
if (QuasarAppUtils::Params::isEndable("deploySystem-with-libc")) {
|
||||||
QuasarAppUtils::Params::setEnable("deploySystem", true );
|
QuasarAppUtils::Params::setEnable("deploySystem", true );
|
||||||
@ -509,7 +512,7 @@ bool ConfigParser::parseQtDeployMode() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfigParser::parseQtInfoMode() {
|
bool ConfigParser::parseInfoMode() {
|
||||||
if ((QuasarAppUtils::Params::isEndable("v") ||
|
if ((QuasarAppUtils::Params::isEndable("v") ||
|
||||||
QuasarAppUtils::Params::isEndable("version"))) {
|
QuasarAppUtils::Params::isEndable("version"))) {
|
||||||
DeployCore::printVersion();
|
DeployCore::printVersion();
|
||||||
@ -521,7 +524,24 @@ bool ConfigParser::parseQtInfoMode() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfigParser::parseQtClearMode() {
|
bool ConfigParser::parseInitMode() {
|
||||||
|
|
||||||
|
QFile configFile(DEFAULT_COFIGURATION_FILE);
|
||||||
|
QFile source("");
|
||||||
|
if (configFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||||
|
|
||||||
|
if (source.open(QIODevice::ReadOnly)) {
|
||||||
|
configFile.write(source.readAll());
|
||||||
|
source.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
configFile.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ConfigParser::parseClearMode() {
|
||||||
setTargetDir("./" + DISTRO_DIR);
|
setTargetDir("./" + DISTRO_DIR);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include "deploy_global.h"
|
#include "deploy_global.h"
|
||||||
|
|
||||||
#define DISTRO_DIR QString("DistributionKit")
|
|
||||||
|
|
||||||
class FileManager;
|
class FileManager;
|
||||||
class DependenciesScanner;
|
class DependenciesScanner;
|
||||||
class Packing;
|
class Packing;
|
||||||
@ -43,9 +41,11 @@ private:
|
|||||||
bool loadFromFile(const QString& file);
|
bool loadFromFile(const QString& file);
|
||||||
bool initDistroStruct();
|
bool initDistroStruct();
|
||||||
bool initPrefixes();
|
bool initPrefixes();
|
||||||
bool parseQtDeployMode();
|
bool parseDeployMode();
|
||||||
bool parseQtInfoMode();
|
bool parseInfoMode();
|
||||||
bool parseQtClearMode();
|
bool parseInitMode();
|
||||||
|
|
||||||
|
bool parseClearMode();
|
||||||
|
|
||||||
QSet<QString> getQtPathesFromTargets();
|
QSet<QString> getQtPathesFromTargets();
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
#define DEFAULT_COFIGURATION_FILE QString("CQtDeployer.json")
|
||||||
|
#define DISTRO_DIR QString("DistributionKit")
|
||||||
|
|
||||||
#if defined(DEPLOY_LIBRARY)
|
#if defined(DEPLOY_LIBRARY)
|
||||||
# define DEPLOYSHARED_EXPORT Q_DECL_EXPORT
|
# define DEPLOYSHARED_EXPORT Q_DECL_EXPORT
|
||||||
#else
|
#else
|
||||||
|
@ -143,6 +143,10 @@ RunMode DeployCore::getMode() {
|
|||||||
return RunMode::Info;
|
return RunMode::Info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (C("init")) {
|
||||||
|
return RunMode::Init;
|
||||||
|
}
|
||||||
|
|
||||||
if (QuasarAppUtils::Params::customParamasSize() == 0 || C("bin") || C("binDir")) {
|
if (QuasarAppUtils::Params::customParamasSize() == 0 || C("bin") || C("binDir")) {
|
||||||
return RunMode::Deploy;
|
return RunMode::Deploy;
|
||||||
}
|
}
|
||||||
@ -162,6 +166,7 @@ QString DeployCore::help() {
|
|||||||
{ "" },
|
{ "" },
|
||||||
{ "Options:" },
|
{ "Options:" },
|
||||||
{ " help / h : Shows help." },
|
{ " help / h : Shows help." },
|
||||||
|
{ " init : will initialize cqtdeployer.json file (configuration file)" },
|
||||||
{ " noOverwrite : Prevents replacing existing files." },
|
{ " noOverwrite : Prevents replacing existing files." },
|
||||||
{ " -bin [list, params] : Deployable file or folder." },
|
{ " -bin [list, params] : Deployable file or folder." },
|
||||||
{ " | For example -bin /my/project/bin/,/my/project/bin.exe" },
|
{ " | For example -bin /my/project/bin/,/my/project/bin.exe" },
|
||||||
|
@ -66,7 +66,8 @@ uint qHash (WinAPI i);
|
|||||||
enum class RunMode: int {
|
enum class RunMode: int {
|
||||||
Info,
|
Info,
|
||||||
Deploy,
|
Deploy,
|
||||||
Clear
|
Clear,
|
||||||
|
Init
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extracter;
|
class Extracter;
|
||||||
|
@ -20,6 +20,7 @@ cqtdeployer -option1 value1 -option2 list, of, values flag1 flag2 flag3
|
|||||||
## Options:
|
## Options:
|
||||||
| Option | Descriptiion |
|
| Option | Descriptiion |
|
||||||
|-----------------------------|-----------------------------------------------------------------|
|
|-----------------------------|-----------------------------------------------------------------|
|
||||||
|
| init | will initialize cqtdeployer.json file (configuration file) |
|
||||||
| -bin [list, params] | Deployable file or folder. For example -bin ~/my/project/bin/,~/my/project/bin.exe|
|
| -bin [list, params] | Deployable file or folder. For example -bin ~/my/project/bin/,~/my/project/bin.exe|
|
||||||
| -binDir [params] | A folder which includes deployable files (recursive search). |
|
| -binDir [params] | A folder which includes deployable files (recursive search). |
|
||||||
| -confFile [params] | The path to the json file with all deployment configurations. Using this file, you can add the necessary options, thereby simplifying the command invocation in the console. However, the parameters in Kansol have a higher priority than in the file. For more info about this flag see [wiki](https://github.com/QuasarApp/CQtDeployer/wiki/DeployConfigFileEn) |
|
| -confFile [params] | The path to the json file with all deployment configurations. Using this file, you can add the necessary options, thereby simplifying the command invocation in the console. However, the parameters in Kansol have a higher priority than in the file. For more info about this flag see [wiki](https://github.com/QuasarApp/CQtDeployer/wiki/DeployConfigFileEn) |
|
||||||
@ -98,6 +99,7 @@ cqtdeployer -option1 value1 -option2 list,of,values flag1 flag2 flag3
|
|||||||
## Параметры:
|
## Параметры:
|
||||||
| Option | Descriptiion |
|
| Option | Descriptiion |
|
||||||
|-----------------------------|-----------------------------------------------------------|
|
|-----------------------------|-----------------------------------------------------------|
|
||||||
|
| init | проинициализирует файл cqtdeployer.json (файл конфигурации) |
|
||||||
| help / h | Показывает справку |
|
| help / h | Показывает справку |
|
||||||
| -bin [list, params] | Развертываемый файл или папка. пример -bin ~/my/project/bin/,~/my/project/bin.exe|
|
| -bin [list, params] | Развертываемый файл или папка. пример -bin ~/my/project/bin/,~/my/project/bin.exe|
|
||||||
| -binDir [params] | Папка с развертываемыми файлами (с рекурсивным поиском). |
|
| -binDir [params] | Папка с развертываемыми файлами (с рекурсивным поиском). |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user