Qnx: Support multiple BlackBerry target configurations

The new bbndk 10.2 is based on multiple targets (based on multiple bbnk-env scripts).
There is no default/common bbnk-env.sh file anymore, and an NDK directory may contain
various bbndk-env scripts (i.e targets).

This patch makes the BlackBerryConfiguration based on the bbnk-env script path
rather than on the NDK path. This will enable having multiple configurations
per targets in the same NDK directory.

N.B: NDKs 10.1 with one default bbnk-env file are still supported.

Change-Id: Icec57c6e722caec7e5ff81e3a9ce4d2cf11f249a
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
This commit is contained in:
Mehdi Fekari
2013-08-22 17:00:58 +02:00
committed by Mehdi Fekari
parent afcb9b2c41
commit 01ebbe19ba
11 changed files with 276 additions and 101 deletions

View File

@@ -39,11 +39,16 @@
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QFileInfo>
#include <QTextStream>
using namespace Qnx;
using namespace Qnx::Internal;
namespace {
const QLatin1String NndkEnvFile("ndkEnvFile");
}
BlackBerryQtVersion::BlackBerryQtVersion()
: QnxAbstractQtVersion()
{
@@ -52,10 +57,17 @@ BlackBerryQtVersion::BlackBerryQtVersion()
BlackBerryQtVersion::BlackBerryQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected, const QString &autoDetectionSource, const QString &sdkPath)
: QnxAbstractQtVersion(arch, path, isAutoDetected, autoDetectionSource)
{
if (QnxUtils::isValidNdkPath(sdkPath))
setSdkPath(sdkPath);
else
if (!sdkPath.isEmpty()) {
if (QFileInfo(sdkPath).isDir()) {
setSdkPath(sdkPath);
} else {
m_ndkEnvFile = sdkPath;
setSdkPath(QFileInfo(sdkPath).absolutePath());
}
} else {
setDefaultSdkPath();
}
}
BlackBerryQtVersion::~BlackBerryQtVersion()
@@ -78,13 +90,27 @@ QString BlackBerryQtVersion::description() const
return tr("BlackBerry %1", "Qt Version is meant for BlackBerry").arg(archString());
}
QVariantMap BlackBerryQtVersion::toMap() const
{
QVariantMap result = QnxAbstractQtVersion::toMap();
result.insert(NndkEnvFile, m_ndkEnvFile);
return result;
}
void BlackBerryQtVersion::fromMap(const QVariantMap &map)
{
QnxAbstractQtVersion::fromMap(map);
m_ndkEnvFile = map.value(NndkEnvFile).toString();
}
QMultiMap<QString, QString> BlackBerryQtVersion::environment() const
{
QTC_CHECK(!sdkPath().isEmpty());
if (sdkPath().isEmpty())
return QMultiMap<QString, QString>();
return QnxUtils::parseEnvironmentFile(QnxUtils::envFilePath(sdkPath()));
QString envFile = m_ndkEnvFile.isEmpty() ? QnxUtils::envFilePath(sdkPath()) : m_ndkEnvFile;
return QnxUtils::parseEnvironmentFile(envFile);
}
void BlackBerryQtVersion::setDefaultSdkPath()