Windeployqt: add custom qml output directory command line option
Added the qml-deploy-dir option, which deploys imported qml files to the directory passed as an argument. If no option is given, a "qml" directory is created, and files are deployed there. [ChangeLog][QtTools][Windeployqt] Windeployqt's default behavior is now to deploy qml imports to a "qml" directory inside the deploy directory, rather than directly to the deploy directory. Task-number: QTBUG-99516 Change-Id: I49262a38c4a42ef20b05b603f5eb5393fe9cc218 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 0b4286ff28748ae1e47d8750f1899df2eb85357e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f14704177e
commit
56909fb936
@ -293,6 +293,7 @@ struct Options {
|
|||||||
QStringList languages;
|
QStringList languages;
|
||||||
QString libraryDirectory;
|
QString libraryDirectory;
|
||||||
QString pluginDirectory;
|
QString pluginDirectory;
|
||||||
|
QString qmlDirectory;
|
||||||
QStringList binaries;
|
QStringList binaries;
|
||||||
JsonOutput *json = nullptr;
|
JsonOutput *json = nullptr;
|
||||||
ListOption list = ListNone;
|
ListOption list = ListNone;
|
||||||
@ -370,6 +371,11 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
|
|||||||
QStringLiteral("path"));
|
QStringLiteral("path"));
|
||||||
parser->addOption(pluginDirOption);
|
parser->addOption(pluginDirOption);
|
||||||
|
|
||||||
|
QCommandLineOption qmlDeployDirOption(QStringLiteral("qml-deploy-dir"),
|
||||||
|
QStringLiteral("Copy qml files to path."),
|
||||||
|
QStringLiteral("path"));
|
||||||
|
parser->addOption(qmlDeployDirOption);
|
||||||
|
|
||||||
QCommandLineOption debugOption(QStringLiteral("debug"),
|
QCommandLineOption debugOption(QStringLiteral("debug"),
|
||||||
QStringLiteral("Assume debug binaries."));
|
QStringLiteral("Assume debug binaries."));
|
||||||
parser->addOption(debugOption);
|
parser->addOption(debugOption);
|
||||||
@ -508,6 +514,7 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
|
|||||||
|
|
||||||
options->libraryDirectory = parser->value(libDirOption);
|
options->libraryDirectory = parser->value(libDirOption);
|
||||||
options->pluginDirectory = parser->value(pluginDirOption);
|
options->pluginDirectory = parser->value(pluginDirOption);
|
||||||
|
options->qmlDirectory = parser->value(qmlDeployDirOption);
|
||||||
options->plugins = !parser->isSet(noPluginsOption);
|
options->plugins = !parser->isSet(noPluginsOption);
|
||||||
options->libraries = !parser->isSet(noLibraryOption);
|
options->libraries = !parser->isSet(noLibraryOption);
|
||||||
options->translations = !parser->isSet(noTranslationOption);
|
options->translations = !parser->isSet(noTranslationOption);
|
||||||
@ -1595,13 +1602,18 @@ static DeployResult deploy(const Options &options, const QMap<QString, QString>
|
|||||||
// Do not be fooled by QtWebKit.dll depending on Quick into always installing Quick imports
|
// Do not be fooled by QtWebKit.dll depending on Quick into always installing Quick imports
|
||||||
// for WebKit1-applications. Check direct dependency only.
|
// for WebKit1-applications. Check direct dependency only.
|
||||||
if (options.quickImports && usesQml2) {
|
if (options.quickImports && usesQml2) {
|
||||||
|
const QString targetPath = options.qmlDirectory.isEmpty()
|
||||||
|
? options.directory + QStringLiteral("/qml")
|
||||||
|
: options.qmlDirectory;
|
||||||
|
if (!createDirectory(targetPath, errorMessage))
|
||||||
|
return result;
|
||||||
for (const QmlImportScanResult::Module &module : std::as_const(qmlScanResult.modules)) {
|
for (const QmlImportScanResult::Module &module : std::as_const(qmlScanResult.modules)) {
|
||||||
const QString installPath = module.installPath(options.directory);
|
const QString installPath = module.installPath(targetPath);
|
||||||
if (optVerboseLevel > 1)
|
if (optVerboseLevel > 1)
|
||||||
std::wcout << "Installing: '" << module.name
|
std::wcout << "Installing: '" << module.name
|
||||||
<< "' from " << module.sourcePath << " to "
|
<< "' from " << module.sourcePath << " to "
|
||||||
<< QDir::toNativeSeparators(installPath) << '\n';
|
<< QDir::toNativeSeparators(installPath) << '\n';
|
||||||
if (installPath != options.directory && !createDirectory(installPath, errorMessage))
|
if (installPath != targetPath && !createDirectory(installPath, errorMessage))
|
||||||
return result;
|
return result;
|
||||||
unsigned updateFileFlags = options.updateFileFlags
|
unsigned updateFileFlags = options.updateFileFlags
|
||||||
| SkipQmlDesignerSpecificsDirectories;
|
| SkipQmlDesignerSpecificsDirectories;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user