4
1
mirror of https://github.com/QuasarApp/CQtDeployer.git synced 2025-05-06 14:39:35 +00:00

Merge pull request from QuasarApp/fixDefautlScripts

Add support search targets from the path
This commit is contained in:
Andrei Yankovich 2022-01-20 16:39:55 +03:00 committed by GitHub
commit ed7be852d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 10 deletions

@ -5,6 +5,8 @@
#
# ####################################################################
#
# All variables has the CQT_ prefix
# BIN_PATH - are releative path to executable files of a deployed distribution.
# LIB_PATH - are releative path to libraryes of a deployed distribution.
# QML_PATH - are releative path to qml libraryes of a deployed distribution.
# PLUGIN_PATH - are releative path to qt plugins of a deployed distribution.
@ -18,6 +20,7 @@
# ####################################################################
BASE_DIR=$(dirname "$(readlink -f "$0")")
export PATH="$BASE_DIR"CQT_BIN_PATH:$PATH
export LD_LIBRARY_PATH="$BASE_DIR"CQT_LIB_PATH:"$BASE_DIR":$LD_LIBRARY_PATH
export QML_IMPORT_PATH="$BASE_DIR"CQT_QML_PATH:$QML_IMPORT_PATH
export QML2_IMPORT_PATH="$BASE_DIR"CQT_QML_PATH:$QML2_IMPORT_PATH

@ -2,7 +2,8 @@
:: This file contains key word that will replaced after deploy project.
:: ####################################################################
:: All variables has the CQT_ prefix
:: BIN_PATH - are releative path to executable files of a deployed distribution.
:: LIB_PATH - are releative path to libraryes of a deployed distribution.
:: SYSTEM_LIB_PATH - are releative path to system libraryes of a deployed distribution.
:: BASE_NAME - are base name of the executable that will be launched after run this script.
@ -13,7 +14,7 @@
@echo off
SET BASE_DIR=%~dp0
SET PATH=%BASE_DIR%CQT_LIB_PATH;%PATH%;CQT_SYSTEM_LIB_PATH
SET PATH=%BASE_DIR%CQT_BIN_PATH;%BASE_DIR%CQT_LIB_PATH;%PATH%;CQT_SYSTEM_LIB_PATH
SET CQT_PKG_ROOT=%BASE_DIR%
SET CQT_RUN_FILE=%BASE_DIR%CQT_BASE_NAME.bat

@ -880,15 +880,27 @@ bool ConfigParser::setTargets(const QStringList &value) {
isfillList = true;
} else {
QuasarAppUtils::Params::log(targetInfo.absoluteFilePath() + " does not exist!",
QuasarAppUtils::Params::log(i + " is not a path. Try search this file in system enviroment",
QuasarAppUtils::Debug);
auto file = QFileInfo(DeployCore::findProcess(QProcessEnvironment::systemEnvironment().value("PATH"), i));
if (file.exists()) {
auto target = createTarget(file.absoluteFilePath());
if (!_config.targetsEdit().contains(target.target)) {
_config.targetsEdit().insert(target.target, target.targetInfo);
}
isfillList = true;
} else {
QuasarAppUtils::Params::log(targetInfo.absoluteFilePath() + " does not exist!",
QuasarAppUtils::Debug);
}
}
}
if (!isfillList)
return false;
return true;
return isfillList;
}
bool ConfigParser::setTargetsRecursive(const QString &dir) {

@ -292,6 +292,8 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
" For folders:"
" CCQtDeployer will enter these folders and non-recursively copy all executable files to the destination directory."
" Then, CQtDeployer will extract all dependencies of the copied files and search dependencies in system environments and libDir paths."
"**Note**: If CQtDeployer can't find required file then"
" CQtDeployer try find required file in the system PATH enviroment."
}});
help.insert(group, {QuasarAppUtils::OptionData{

@ -5,6 +5,8 @@
#
# ####################################################################
#
# All variables has the CQT_ prefix
# BIN_PATH - are releative path to executable files of a deployed distribution.
# LIB_PATH - are releative path to libraryes of a deployed distribution.
# QML_PATH - are releative path to qml libraryes of a deployed distribution.
# PLUGIN_PATH - are releative path to qt plugins of a deployed distribution.
@ -18,6 +20,7 @@
# ####################################################################
BASE_DIR=$(dirname "$(readlink -f "$0")")
export PATH="$BASE_DIR"/bin/:$PATH
export LD_LIBRARY_PATH="$BASE_DIR"/lib/:"$BASE_DIR":$LD_LIBRARY_PATH
export QML_IMPORT_PATH="$BASE_DIR"/q/and/q/:$QML_IMPORT_PATH
export QML2_IMPORT_PATH="$BASE_DIR"/q/and/q/:$QML2_IMPORT_PATH

@ -3097,7 +3097,7 @@ void deploytest::testOutDirs() {
qDebug() << "runScript =" << runScript;
QVERIFY(runScript.contains("SET BASE_DIR=%~dp0"));
QVERIFY(runScript.contains("SET PATH=%BASE_DIR%\\lolLib\\;%PATH%"));
QVERIFY(runScript.contains("SET PATH=%BASE_DIR%\\lol\\;%BASE_DIR%\\lolLib\\;%PATH%"));
QVERIFY(runScript.contains("start \"TestQMLWidgets\" /B \"%BASE_DIR%\\lol\\TestQMLWidgets.exe\" %*"));
runTestParams({"-bin", TestBinDir + "TestOnlyC.exe", "clear",

@ -77,7 +77,7 @@ cqtdeployer -option1 value1 -option2 list, of, values flag1 flag2 flag3
| Option | Descriptiion |
|-----------------------------|-----------------------------------------------------------|
| -bin [list,params] | Files to deploy or folders that contain files to deploy. For example -bin ~/my/project/bin/,~/my/project/bin.exe,~/my/project/runtimeLinking/lib.dll. For files: These files will be unconditional copied to the destination directory, regardless of their format or suffix. For folders: CQtDeployer will enter these folders and non-recursively copy all executable files to the destination directory. Then, CQtDeployer will extract all dependencies of the copied files and search dependencies in system environments and **libDir** paths. |
| -bin [list,params] | Files to deploy or folders that contain files to deploy. For example -bin ~/my/project/bin/,~/my/project/bin.exe,~/my/project/runtimeLinking/lib.dll. For files: These files will be unconditional copied to the destination directory, regardless of their format or suffix. For folders: CQtDeployer will enter these folders and non-recursively copy all executable files to the destination directory. Then, CQtDeployer will extract all dependencies of the copied files and search dependencies in system environments and **libDir** paths. **Note**: If CQtDeployer can't find required file then CQtDeployer try find required file in the system PATH enviroment.|
| -binPrefix [prefixPath] | Sets prefix path for bin option. Example: **-bin path/MyExecutable** is some as **-bin MyExecutable -binPrefix path** |
| -confFile [params] | The path to the json file with all deployment configurations.|
| | Using this file, you can add the necessary options, |

@ -77,7 +77,7 @@ cqtdeployer -option1 value1 -option2 list,of,values flag1 flag2 flag3
| Option | Descriptiion |
|-----------------------------|-----------------------------------------------------------|
| -bin [list,params] | Развертываемый файл или папка. пример -bin ~/my/project/bin/,~/my/project/bin.exe. Для файлов: эти файлы будут безоговорочно скопированы в целевой каталог, независимо от их формата или суффикса. Для папок: CQtDeployer войдет в эти папки и нерекурсивно скопирует все развертываемые файлы в целевой каталог. Затем CQtDeployer извлечет все зависимости скопированных файлов. CQtDeployer будет искать зависимости в системной среде и в путях libDir. |
| -bin [list,params] | Развертываемый файл или папка. пример -bin ~/my/project/bin/,~/my/project/bin.exe. Для файлов: эти файлы будут безоговорочно скопированы в целевой каталог, независимо от их формата или суффикса. Для папок: CQtDeployer войдет в эти папки и нерекурсивно скопирует все развертываемые файлы в целевой каталог. Затем CQtDeployer извлечет все зависимости скопированных файлов. CQtDeployer будет искать зависимости в системной среде и в путях libDir. **Примечание**. Если CQtDeployer не может найти требуемый файл, CQtDeployer попытается найти требуемый файл в системной среде PATH. |
| -binPrefix [prefixPath] | Устанавливает путь префикса для опции bin. Пример: **-bin path/MyExecutable** - это тоже что и **-bin MyExecutable -binPrefix path** |
| -confFile [params] | Путь к файлу json со всеми конфигурациями развертывания. С помощью этого файла можно добавить нужные опции, тем самым упрастить вызов комманды в консоле. Однако пораметры в кансоле имеют больший приоритет чем в файле. Для получения дополнительной информации об этом флаге см. [Вики](DeployConfigFile) |
| -qmlDir [params] | Папка qml. пример -qmlDir ~/my/project/qml |