forked from qt-creator/qt-creator
qmljs: add explicit -relocatable flag to qmlplugindumper and use it
This will allow changing the default to nonrelocatable. Change-Id: I80746a3e70f94040a407cc25cec9ad6fac8b6fec Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -460,7 +460,7 @@ void sigSegvHandler(int) {
|
||||
void printUsage(const QString &appName)
|
||||
{
|
||||
qWarning() << qPrintable(QString(
|
||||
"Usage: %1 [-v] [-notrelocatable] module.uri version [module/import/path]\n"
|
||||
"Usage: %1 [-v] [-[non]relocatable] module.uri version [module/import/path]\n"
|
||||
" %1 [-v] -path path/to/qmldir/directory [version]\n"
|
||||
" %1 [-v] -builtins\n"
|
||||
"Example: %1 Qt.labs.particles 4.7 /home/user/dev/qt-install/imports").arg(
|
||||
@@ -507,8 +507,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (arg == QLatin1String("--notrelocatable")
|
||||
|| arg == QLatin1String("-notrelocatable")) {
|
||||
|| arg == QLatin1String("-notrelocatable")
|
||||
|| arg == QLatin1String("--nonrelocatable")
|
||||
|| arg == QLatin1String("-nonrelocatable")) {
|
||||
relocatable = false;
|
||||
} else if (arg == QLatin1String("--relocatable")
|
||||
|| arg == QLatin1String("-relocatable")) {
|
||||
relocatable = true;
|
||||
} else if (arg == QLatin1String("--path")
|
||||
|| arg == QLatin1String("-path")) {
|
||||
action = Path;
|
||||
|
||||
@@ -57,12 +57,12 @@ public:
|
||||
{
|
||||
public:
|
||||
ProjectInfo()
|
||||
: tryQmlDump(false)
|
||||
: tryQmlDump(false), qmlDumpHasRelocatableFlag(true)
|
||||
{ }
|
||||
|
||||
ProjectInfo(QPointer<ProjectExplorer::Project> project)
|
||||
: project(project)
|
||||
, tryQmlDump(false)
|
||||
, tryQmlDump(false), qmlDumpHasRelocatableFlag(true)
|
||||
{ }
|
||||
|
||||
operator bool() const
|
||||
@@ -83,6 +83,7 @@ public:
|
||||
|
||||
// whether trying to run qmldump makes sense
|
||||
bool tryQmlDump;
|
||||
bool qmlDumpHasRelocatableFlag;
|
||||
QString qmlDumpPath;
|
||||
::Utils::Environment qmlDumpEnvironment;
|
||||
|
||||
|
||||
@@ -135,9 +135,11 @@ ModelManagerInterface::ProjectInfo QmlJSTools::defaultProjectInfoForProject(
|
||||
toolChain,
|
||||
preferDebugDump, &projectInfo.qmlDumpPath,
|
||||
&projectInfo.qmlDumpEnvironment);
|
||||
projectInfo.qmlDumpHasRelocatableFlag = qtVersion->hasQmlDumpWithRelocatableFlag();
|
||||
} else {
|
||||
projectInfo.qmlDumpPath.clear();
|
||||
projectInfo.qmlDumpEnvironment.clear();
|
||||
projectInfo.qmlDumpHasRelocatableFlag = true;
|
||||
}
|
||||
setupProjectInfoQmlBundles(projectInfo);
|
||||
return projectInfo;
|
||||
|
||||
@@ -433,6 +433,8 @@ void PluginDumper::dump(const Plugin &plugin)
|
||||
if (ComponentVersion(plugin.importVersion).isValid())
|
||||
args << plugin.importVersion;
|
||||
} else {
|
||||
if (info.qmlDumpHasRelocatableFlag)
|
||||
args << QLatin1String("-relocatable");
|
||||
args << plugin.importUri;
|
||||
args << plugin.importVersion;
|
||||
args << plugin.importPath;
|
||||
|
||||
@@ -1097,6 +1097,13 @@ bool BaseQtVersion::hasQmlDump() const
|
||||
return m_hasQmlDump;
|
||||
}
|
||||
|
||||
bool BaseQtVersion::hasQmlDumpWithRelocatableFlag() const
|
||||
{
|
||||
updateVersionInfo();
|
||||
return ((qtVersion() > QtVersionNumber(4, 8, 4) && qtVersion() < QtVersionNumber(5, 0, 0))
|
||||
|| qtVersion() >= QtVersionNumber(5, 1, 0));
|
||||
}
|
||||
|
||||
bool BaseQtVersion::needsQmlDump() const
|
||||
{
|
||||
updateVersionInfo();
|
||||
|
||||
@@ -200,6 +200,7 @@ public:
|
||||
|
||||
virtual bool hasGdbDebuggingHelper() const;
|
||||
virtual bool hasQmlDump() const;
|
||||
virtual bool hasQmlDumpWithRelocatableFlag() const;
|
||||
virtual bool needsQmlDump() const;
|
||||
virtual bool hasQmlDebuggingLibrary() const;
|
||||
virtual bool needsQmlDebuggingLibrary() const;
|
||||
|
||||
@@ -137,6 +137,7 @@ private slots:
|
||||
if (projectInfo.qmlDumpPath.isEmpty())
|
||||
projectInfo.qmlDumpPath = version->qmlDumpTool(!update.preferDebug);
|
||||
projectInfo.qmlDumpEnvironment = version->qmlToolsEnvironment();
|
||||
projectInfo.qmlDumpHasRelocatableFlag = version->hasQmlDumpWithRelocatableFlag();
|
||||
modelManager->updateProjectInfo(projectInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user