mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-29 11:14:33 +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/QIF.json</file>
|
||||
<file>Distributions/configures/C and C++.json</file>
|
||||
<file>Distributions/configures/InitConfiguration.json</file>
|
||||
</qresource>
|
||||
<qresource prefix="/Templates/QIF">
|
||||
<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()) {
|
||||
case RunMode::Info: {
|
||||
qInfo() << "selected info mode" ;
|
||||
qInfo() << "Print info ..." ;
|
||||
|
||||
if (!parseQtInfoMode()) {
|
||||
qCritical() << "info mode fail!";
|
||||
if (!parseInfoMode()) {
|
||||
qCritical() << "show info is failed!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DeployCore::_config = &_config;
|
||||
|
||||
break;
|
||||
}
|
||||
case RunMode::Clear: {
|
||||
qInfo() << "selected clear mode" ;
|
||||
qInfo() << "clear ..." ;
|
||||
|
||||
if (!parseQtClearMode()) {
|
||||
qCritical() << "clear mode fail!";
|
||||
if (!parseClearMode()) {
|
||||
qCritical() << "clear is failed!";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
DeployCore::_config = &_config;
|
||||
case RunMode::Init: {
|
||||
qInfo() << "Init ..." ;
|
||||
|
||||
if (!parseInitMode()) {
|
||||
qCritical() << "init is failed!";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case RunMode::Deploy: {
|
||||
qInfo() << "selected deploy mode" ;
|
||||
qInfo() << "Deploy ..." ;
|
||||
|
||||
if (!parseQtDeployMode()) {
|
||||
qCritical() << "deploy mode fail!";
|
||||
if (!parseDeployMode()) {
|
||||
qCritical() << "deploy is failed!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DeployCore::_config = &_config;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DeployCore::_config = &_config;
|
||||
|
||||
if (createFile && !createFromDeploy(path)) {
|
||||
QuasarAppUtils::Params::verboseLog("Do not create a deploy config file in " + path,
|
||||
QuasarAppUtils::Error);
|
||||
@ -451,7 +454,7 @@ bool ConfigParser::initQmlInput() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConfigParser::parseQtDeployMode() {
|
||||
bool ConfigParser::parseDeployMode() {
|
||||
|
||||
if (QuasarAppUtils::Params::isEndable("deploySystem-with-libc")) {
|
||||
QuasarAppUtils::Params::setEnable("deploySystem", true );
|
||||
@ -509,7 +512,7 @@ bool ConfigParser::parseQtDeployMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ConfigParser::parseQtInfoMode() {
|
||||
bool ConfigParser::parseInfoMode() {
|
||||
if ((QuasarAppUtils::Params::isEndable("v") ||
|
||||
QuasarAppUtils::Params::isEndable("version"))) {
|
||||
DeployCore::printVersion();
|
||||
@ -521,7 +524,24 @@ bool ConfigParser::parseQtInfoMode() {
|
||||
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);
|
||||
|
||||
return true;
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <QDir>
|
||||
#include "deploy_global.h"
|
||||
|
||||
#define DISTRO_DIR QString("DistributionKit")
|
||||
|
||||
class FileManager;
|
||||
class DependenciesScanner;
|
||||
class Packing;
|
||||
@ -43,9 +41,11 @@ private:
|
||||
bool loadFromFile(const QString& file);
|
||||
bool initDistroStruct();
|
||||
bool initPrefixes();
|
||||
bool parseQtDeployMode();
|
||||
bool parseQtInfoMode();
|
||||
bool parseQtClearMode();
|
||||
bool parseDeployMode();
|
||||
bool parseInfoMode();
|
||||
bool parseInitMode();
|
||||
|
||||
bool parseClearMode();
|
||||
|
||||
QSet<QString> getQtPathesFromTargets();
|
||||
|
||||
|
@ -10,6 +10,9 @@
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#define DEFAULT_COFIGURATION_FILE QString("CQtDeployer.json")
|
||||
#define DISTRO_DIR QString("DistributionKit")
|
||||
|
||||
#if defined(DEPLOY_LIBRARY)
|
||||
# define DEPLOYSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
|
@ -143,6 +143,10 @@ RunMode DeployCore::getMode() {
|
||||
return RunMode::Info;
|
||||
}
|
||||
|
||||
if (C("init")) {
|
||||
return RunMode::Init;
|
||||
}
|
||||
|
||||
if (QuasarAppUtils::Params::customParamasSize() == 0 || C("bin") || C("binDir")) {
|
||||
return RunMode::Deploy;
|
||||
}
|
||||
@ -162,6 +166,7 @@ QString DeployCore::help() {
|
||||
{ "" },
|
||||
{ "Options:" },
|
||||
{ " help / h : Shows help." },
|
||||
{ " init : will initialize cqtdeployer.json file (configuration file)" },
|
||||
{ " noOverwrite : Prevents replacing existing files." },
|
||||
{ " -bin [list, params] : Deployable file or folder." },
|
||||
{ " | For example -bin /my/project/bin/,/my/project/bin.exe" },
|
||||
|
@ -66,7 +66,8 @@ uint qHash (WinAPI i);
|
||||
enum class RunMode: int {
|
||||
Info,
|
||||
Deploy,
|
||||
Clear
|
||||
Clear,
|
||||
Init
|
||||
};
|
||||
|
||||
class Extracter;
|
||||
|
@ -20,6 +20,7 @@ cqtdeployer -option1 value1 -option2 list, of, values flag1 flag2 flag3
|
||||
## Options:
|
||||
| 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|
|
||||
| -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) |
|
||||
@ -98,6 +99,7 @@ cqtdeployer -option1 value1 -option2 list,of,values flag1 flag2 flag3
|
||||
## Параметры:
|
||||
| Option | Descriptiion |
|
||||
|-----------------------------|-----------------------------------------------------------|
|
||||
| init | проинициализирует файл cqtdeployer.json (файл конфигурации) |
|
||||
| help / h | Показывает справку |
|
||||
| -bin [list, params] | Развертываемый файл или папка. пример -bin ~/my/project/bin/,~/my/project/bin.exe|
|
||||
| -binDir [params] | Папка с развертываемыми файлами (с рекурсивным поиском). |
|
||||
|
Loading…
x
Reference in New Issue
Block a user