From 269821d9a1eda2893f84fdeff76edef576f9847d Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 8 Oct 2010 11:12:52 +0300 Subject: Inconsistency with deployment keyword .sources and .files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DEPLOYMENT instruction uses .sources, while INSTALLS uses .files. This is inconsistent, and we fix it in Qt 4 by adding .files as a supported alternative for DEPLOYMENT. This commit will be followed by a second, which aligns Qt build system. For Qt 5, this needs to be cleaned up by removing support for .sources. Task-number: QTBUG-3216 Reviewed-by: João Abecasis Cherry-picked from 730a5d562fcb7be6428458962456033054f99e4c by Frans Englich. Conflicts: qmake/generators/symbian/initprojectdeploy_symbian.cpp --- doc/src/snippets/code/doc_src_qmake-manual.qdoc | 16 ++++++++-------- qmake/generators/symbian/initprojectdeploy_symbian.cpp | 3 ++- qmake/generators/symbian/symbian_makefile.h | 4 +++- qmake/generators/symbian/symmake.cpp | 4 +++- qmake/generators/win32/msvc_vcproj.cpp | 3 ++- tools/qtestlib/wince/cetest/deployment.cpp | 10 +++++----- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 4f74e9c..1d2fbb4 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -193,15 +193,15 @@ DEFINES += USE_MY_STUFF QT_DLL //! [28] -myFiles.sources = path\*.png +myFiles.files = path\*.png DEPLOYMENT += myFiles //! [28] //! [29] -myFiles.sources = path\file1.ext1 path2\file2.ext1 path3\* +myFiles.files = path\file1.ext1 path2\file2.ext1 path3\* myFiles.path = \some\path\on\device -someother.sources = C:\additional\files\* +someother.files = C:\additional\files\* someother.path = \myFiles\path2 DEPLOYMENT += myFiles someother //! [29] @@ -849,12 +849,12 @@ CONFIG(debug, debug|release) { //! [127] //! [128] -customplugin.sources = customimageplugin.dll -customplugin.sources += c:\myplugins\othercustomimageplugin.dll +customplugin.files = customimageplugin.dll +customplugin.files += c:\myplugins\othercustomimageplugin.dll customplugin.path = imageformats -dynamiclibrary.sources = mylib.dll helper.exe +dynamiclibrary.files = mylib.dll helper.exe dynamiclibrary.path = \sys\bin -globalplugin.sources = someglobalimageplugin.dll +globalplugin.files = someglobalimageplugin.dll globalplugin.path = \resource\qt\plugins\imageformats DEPLOYMENT += customplugin dynamiclibrary globalplugin //! [128] @@ -923,7 +923,7 @@ MMP_RULES += myIfdefBlock //! [139] //! [140] -somelib.sources = somelib.dll +somelib.files = somelib.dll somelib.path = \sys\bin somelib.pkg_prerules = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \ "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}" diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 5a6f66f..cd51e42 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -250,7 +250,8 @@ void initProjectDeploySymbian(QMakeProject* project, QStringList flags = project->values(item + ".flags"); - foreach(QString source, project->values(item + ".sources")) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + foreach(QString source, project->values(item + ".sources") + project->values(item + ".files")) { source = Option::fixPathToLocalOS(source); QString nameFilter; QFileInfo info(source); diff --git a/qmake/generators/symbian/symbian_makefile.h b/qmake/generators/symbian/symbian_makefile.h index 94f0145..63cede2 100644 --- a/qmake/generators/symbian/symbian_makefile.h +++ b/qmake/generators/symbian/symbian_makefile.h @@ -72,7 +72,9 @@ public: } else { const QStringList deployments = this->project->values("DEPLOYMENT"); for (int i = 0; i < deployments.count(); ++i) { - if (!this->project->values(deployments.at(i) + ".sources").isEmpty()) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + if (!this->project->values(deployments.at(i) + ".sources").isEmpty() || + !this->project->values(deployments.at(i) + ".files").isEmpty()) { generatePkg = true; break; } diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 09a3fc8..0d63cdf 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -197,7 +197,9 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) generatePkg = true; } else { foreach(QString item, project->values("DEPLOYMENT")) { - if (!project->values(item + ".sources").isEmpty()) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + if (!project->values(item + ".sources").isEmpty() || + !project->values(item + ".files").isEmpty()) { generatePkg = true; break; } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 06b726f..8582ce1 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1174,7 +1174,8 @@ void VcprojGenerator::initDeploymentTool() devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath)); } // foreach d in item.sources - foreach(QString source, project->values(item + ".sources")) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + foreach(QString source, project->values(item + ".sources") + project->values(item + ".files")) { QString itemDevicePath = devicePath; source = Option::fixPathToLocalOS(source); QString nameFilter; diff --git a/tools/qtestlib/wince/cetest/deployment.cpp b/tools/qtestlib/wince/cetest/deployment.cpp index 95768f9..e74c72b 100644 --- a/tools/qtestlib/wince/cetest/deployment.cpp +++ b/tools/qtestlib/wince/cetest/deployment.cpp @@ -227,9 +227,9 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList return; for (int it = 0; it < list.size(); ++it) { - QString argSource = list.at(it) + QString(".sources"); + QString argSource = list.at(it); QString argPath = list.at(it) + QString(".path"); - if ((project->values(argSource).isEmpty() || project->values(argPath).isEmpty()) && list.at(it) != "deploy") { + if (((project->values(argSource + QString(".files")).isEmpty() && project->values(argSource + QString(".sources")).isEmpty()) || project->values(argPath).isEmpty()) && list.at(it) != "deploy") { debugOutput(QString::fromLatin1("cannot deploy \"%1\" because of missing data.").arg(list.at(it)), 0); continue; } @@ -240,7 +240,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList if (!addPath.startsWith("/") && !addPath.startsWith(QLatin1String("\\"))) addPath = targetPath + "/" + addPath; - QStringList addSources = project->values(argSource); + QStringList addSources = project->values(argSource + QString(".files")) + project->values(argSource + QString(".sources")); addSources.replaceInStrings(QLatin1String("/"), QLatin1String("\\")); for(int index=0; index < addSources.size(); ++index) { QString dirstr = qmake_getpwd(); @@ -264,7 +264,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList continue; } QString appendedQmakeDeploy = QString::fromLatin1("_q_make_additional_deploy_%1").arg(addQMakeDeployCounter++); - project->parse(appendedQmakeDeploy + QLatin1String(".sources = \"") + wildInfo.absoluteFilePath()); + project->parse(appendedQmakeDeploy + QLatin1String(".files = \"") + wildInfo.absoluteFilePath()); project->parse(appendedQmakeDeploy + QLatin1String(".path = \"") + addPath); list.append(appendedQmakeDeploy); } @@ -276,7 +276,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList QStringList additionalEntries = additionalDir.entryList(QDir::NoDotAndDotDot | QDir::AllEntries | QDir::NoSymLinks); foreach(QString item, additionalEntries) { QString appendedDeploy = QString::fromLatin1("_q_make_additional_deploy_%1").arg(addQMakeDeployCounter++); - project->parse(appendedDeploy + QLatin1String(".sources = \"") + Option::fixPathToLocalOS(additionalDir.absoluteFilePath(item)) + QLatin1String("\"")); + project->parse(appendedDeploy + QLatin1String(".files = \"") + Option::fixPathToLocalOS(additionalDir.absoluteFilePath(item)) + QLatin1String("\"")); QString appendTargetPath = project->values(argPath).join(QLatin1String(" ")); if (appendTargetPath == QLatin1String(".")) appendTargetPath = filestr; -- cgit v0.12