Commit 073fd917 authored by El Mehdi Fekari's avatar El Mehdi Fekari Committed by Mehdi Fekari

Qnx: Package user assets as well when bundling Qt libs

Task-number: QTCREATORBUG-11652

Change-Id: Ib5c26b0b25542eb8e92f5ff65a4f3ec31b82bfff
Reviewed-by: default avatarTobias Nätterlund <tobias.naetterlund@kdab.com>
Reviewed-by: default avatarDavid Kaspar <dkaspar@blackberry.com>
Reviewed-by: Nicolas Arnaud-Cormos's avatarNicolas Arnaud-Cormos <nicolas@kdab.com>
parent 073fd1e5
......@@ -134,7 +134,6 @@ bool BlackBerryCreatePackageStep::init()
// If there is an error, prepareAppDescriptorFile() will raise it
return false;
QStringList args;
if (m_packageMode == DevelopmentMode) {
args << QLatin1String("-devMode");
......@@ -165,39 +164,6 @@ bool BlackBerryCreatePackageStep::init()
args << QLatin1String("-package") << QnxUtils::addQuotes(QDir::toNativeSeparators(info.packagePath()));
args << QnxUtils::addQuotes(QDir::toNativeSeparators(preparedFilePath));
if (m_packageMode == DevelopmentMode && m_bundleMode == BundleQt) {
BlackBerryQtVersion *qtVersion = dynamic_cast<BlackBerryQtVersion *>
(QtSupport::QtKitInformation::qtVersion(target()->kit()));
if (!qtVersion) {
raiseError(tr("Qt version configured for BlackBerry kit "
"is not a BlackBerry Qt version."));
return false;
}
QMap<QString, QString> qtFolders;
qtFolders[QLatin1String("lib")] =
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS"));
qtFolders[QLatin1String("plugins")] =
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS"));
qtFolders[QLatin1String("imports")] =
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_IMPORTS"));
qtFolders[QLatin1String("qml")] =
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_QML"));
for (QMap<QString, QString>::const_iterator it = qtFolders.constBegin();
it != qtFolders.constEnd(); ++it) {
const QString target = it.key();
const QString qtFolder = it.value();
if (QFileInfo(qtFolder).exists()) {
args << QLatin1String("-e");
args << qtFolder;
args << target;
}
}
args << QLatin1String(".");
}
addCommand(packageCmd, args);
}
......@@ -358,6 +324,8 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes
QList<Utils::EnvironmentItem> envItems =
doc.value(BarDescriptorDocument::env).value<QList<Utils::EnvironmentItem> >();
Utils::Environment env(Utils::EnvironmentItem::toStringList(envItems), Utils::OsTypeOtherUnix);
BarDescriptorAssetList assetList = doc.value(BarDescriptorDocument::asset)
.value<BarDescriptorAssetList>();
if (m_packageMode == SigningPackageMode
|| (m_packageMode == DevelopmentMode && m_bundleMode == PreInstalledQt)) {
......@@ -371,6 +339,29 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes
env.prependOrSetLibrarySearchPath(QString::fromLatin1("/usr/lib/qt%1/lib")
.arg(versionNumber.majorVersion));
} else if (m_packageMode == DevelopmentMode && m_bundleMode == BundleQt) {
QList<QPair<QString, QString> > qtFolders;
qtFolders.append(qMakePair(QString::fromLatin1("lib"),
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS"))));
qtFolders.append(qMakePair(QString::fromLatin1("plugins"),
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS"))));
qtFolders.append(qMakePair(QString::fromLatin1("imports"),
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_IMPORTS"))));
qtFolders.append(qMakePair(QString::fromLatin1("qml"),
qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_QML"))));
for (QList<QPair<QString, QString> >::const_iterator it = qtFolders.constBegin();
it != qtFolders.constEnd(); ++it) {
const QString target = it->first;
const QString qtFolder = it->second;
if (QFileInfo(qtFolder).exists()) {
BarDescriptorAsset asset;
asset.source = qtFolder;
asset.destination = target;
asset.entry = false;
assetList << asset;
}
}
env.appendOrSet(QLatin1String("QML2_IMPORT_PATH"),
QLatin1String("app/native/imports:app/native/qml"), QLatin1String(":"));
env.appendOrSet(QLatin1String("QML_IMPORT_PATH"),
......@@ -390,6 +381,8 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes
env.prependOrSetLibrarySearchPath(QString::fromLatin1("%1/lib").arg(fullQtLibraryPath()));
}
doc.setValue(BarDescriptorDocument::asset, QVariant::fromValue(assetList));
QVariant envVar;
envVar.setValue(Utils::EnvironmentItem::fromStringList(env.toStringList()));
doc.setValue(BarDescriptorDocument::env, envVar);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment