Commit eaf75253 authored by Christian Kandeler's avatar Christian Kandeler

Update qbs submodule to HEAD of master branch.

Includes some necessary adaptations to the QbsProjectManager plugin,
namely:
    - Use the new library for setting up Qt profiles.
    - Use per-profile preferences.

Change-Id: I0a639bd291d790c6da9cb4ade53841314310d5ef
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent d72059b1
......@@ -24,7 +24,8 @@ SUBDIRS += \
utils/process_stub.pro
QBS_DIRS = \
../shared/qbs/src/lib \
../shared/qbs/src/lib/corelib \
../shared/qbs/src/lib/qtprofilesetup \
../shared/qbs/src/plugins \
../shared/qbs/static.pro
......
......@@ -46,31 +46,6 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
{
QTC_ASSERT(k, return defaultData);
QVariantMap data = defaultData;
QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(k);
if (qt) {
data.insert(QLatin1String(QTCORE_BINPATH), qt->binPath().toUserOutput());
QStringList builds;
if (qt->hasDebugBuild())
builds << QLatin1String("debug");
if (qt->hasReleaseBuild())
builds << QLatin1String("release");
data.insert(QLatin1String(QTCORE_BUILDVARIANT), builds);
data.insert(QLatin1String(QTCORE_DOCPATH), qt->docsPath().toUserOutput());
data.insert(QLatin1String(QTCORE_INCPATH), qt->headerPath().toUserOutput());
data.insert(QLatin1String(QTCORE_LIBPATH), qt->libraryPath().toUserOutput());
data.insert(QLatin1String(QTCORE_PLUGINPATH), qt->pluginPath().toUserOutput());
Utils::FileName mkspecPath = qt->mkspecsPath();
mkspecPath.appendPath(qt->mkspec().toString());
data.insert(QLatin1String(QTCORE_MKSPEC), mkspecPath.toUserOutput());
data.insert(QLatin1String(QTCORE_NAMESPACE), qt->qtNamespace());
data.insert(QLatin1String(QTCORE_LIBINFIX), qt->qtLibInfix());
data.insert(QLatin1String(QTCORE_VERSION), qt->qtVersionString());
if (qt->isFrameworkBuild())
data.insert(QLatin1String(QTCORE_FRAMEWORKBUILD), true);
data.insert(QLatin1String(QTCORE_CONFIG), qt->configValues());
data.insert(QLatin1String(QTCORE_QTCONFIG), qt->qtConfigValues());
}
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k))
data.insert(QLatin1String(QBS_SYSROOT), ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput());
......@@ -96,6 +71,7 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
: QStringList() << QLatin1String("msvc"));
} else if (targetAbi.os() == ProjectExplorer::Abi::MacOS) {
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants (include header?)
const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitInformation::qtVersion(k);
if (qt && qt->type() == QLatin1String(IOSQT)) {
QStringList targetOS;
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture)
......
......@@ -33,22 +33,6 @@
namespace QbsProjectManager {
namespace Constants {
// Qt related settings:
const char QTCORE_BINPATH[] = "Qt.core.binPath";
const char QTCORE_BUILDVARIANT[] = "Qt.core.buildVariant";
const char QTCORE_DOCPATH[] = "Qt.core.docPath";
const char QTCORE_INCPATH[] = "Qt.core.incPath";
const char QTCORE_LIBPATH[] = "Qt.core.libPath";
const char QTCORE_PLUGINPATH[] = "Qt.core.pluginPath";
const char QTCORE_VERSION[] = "Qt.core.version";
const char QTCORE_NAMESPACE[] = "Qt.core.namespace";
const char QTCORE_LIBINFIX[] = "Qt.core.libInfix";
const char QTCORE_MKSPEC[] = "Qt.core.mkspecPath";
const char QTCORE_FRAMEWORKBUILD[] = "Qt.core.frameworkBuild";
const char QTCORE_CONFIG[] = "Qt.core.config";
const char QTCORE_QTCONFIG[] = "Qt.core.qtConfig";
// Toolchain related settings:
const char QBS_TARGETOS[] = "qbs.targetOS";
const char QBS_SYSROOT[] = "qbs.sysroot";
......
......@@ -423,7 +423,8 @@ void QbsProject::parse(const QVariantMap &config, const Environment &env, const
QVariantMap baseConfig;
QVariantMap userConfig = config;
QString specialKey = QLatin1String(Constants::QBS_CONFIG_PROFILE_KEY);
baseConfig.insert(specialKey, userConfig.take(specialKey));
const QString profileName = userConfig.take(specialKey).toString();
baseConfig.insert(specialKey, profileName);
specialKey = QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY);
baseConfig.insert(specialKey, userConfig.take(specialKey));
params.setBuildConfiguration(baseConfig);
......@@ -460,10 +461,10 @@ void QbsProject::parse(const QVariantMap &config, const Environment &env, const
params.setProjectFilePath(m_fileName);
params.setIgnoreDifferentProjectFilePath(false);
params.setEnvironment(env.toProcessEnvironment());
qbs::Preferences *prefs = QbsManager::preferences();
const qbs::Preferences prefs(QbsManager::settings(), profileName);
const QString qbsDir = qbsDirectory();
params.setSearchPaths(prefs->searchPaths(qbsDir));
params.setPluginPaths(prefs->pluginPaths(qbsDir));
params.setSearchPaths(prefs.searchPaths(qbsDir));
params.setPluginPaths(prefs.pluginPaths(qbsDir));
// Do the parsing:
prepareForParsing();
......
......@@ -35,15 +35,19 @@
#include "qbsprojectmanagerconstants.h"
#include "qbsprojectmanagerplugin.h"
#include <coreplugin/messagemanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <qmljstools/qmljstoolsconstants.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
#include <QVariantMap>
#include <qbs.h>
#include <qtprofilesetup.h>
#include <tools/profile.h> // TODO: Do this in qbs.h.
const QChar sep = QLatin1Char('.');
......@@ -54,14 +58,12 @@ static QString qtcProfilePrefix() { return qtcProfileGroup() + sep; }
namespace QbsProjectManager {
qbs::Settings *QbsManager::m_settings = 0;
qbs::Preferences *QbsManager::m_preferences = 0;
QbsManager::QbsManager(Internal::QbsProjectManagerPlugin *plugin) :
m_plugin(plugin),
m_defaultPropertyProvider(new DefaultPropertyProvider)
{
m_settings = new qbs::Settings(QLatin1String("QtProject"), QLatin1String("qbs"));
m_preferences = new qbs::Preferences(m_settings);
setObjectName(QLatin1String("QbsProjectManager"));
connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(pushKitsToQbs()));
......@@ -87,7 +89,6 @@ QbsManager::~QbsManager()
{
delete m_defaultPropertyProvider;
delete m_settings;
delete m_preferences;
}
QString QbsManager::mimeType() const
......@@ -124,11 +125,6 @@ qbs::Settings *QbsManager::settings()
return m_settings;
}
qbs::Preferences *QbsManager::preferences()
{
return m_preferences;
}
void QbsManager::addProfile(const QString &name, const QVariantMap &data)
{
qbs::Profile profile(name, settings());
......@@ -146,11 +142,44 @@ void QbsManager::removeCreatorProfiles()
}
}
void QbsManager::addQtProfileFromKit(const QString &profileName, const ProjectExplorer::Kit *k)
{
const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitInformation::qtVersion(k);
if (!qt)
return;
qbs::QtEnvironment qtEnv;
qtEnv.binaryPath = qt->binPath().toString();
if (qt->hasDebugBuild())
qtEnv.buildVariant << QLatin1String("debug");
if (qt->hasReleaseBuild())
qtEnv.buildVariant << QLatin1String("release");
qtEnv.documentationPath = qt->docsPath().toString();
qtEnv.includePath = qt->headerPath().toString();
qtEnv.libraryPath = qt->libraryPath().toString();
qtEnv.pluginPath = qt->pluginPath().toString();
qtEnv.mkspecBasePath = qt->mkspecsPath().toString();
qtEnv.mkspecName = qt->mkspec().toString();
qtEnv.mkspecPath = qt->mkspecPath().toString();
qtEnv.qtNameSpace = qt->qtNamespace();
qtEnv.qtLibInfix = qt->qtLibInfix();
qtEnv.qtVersion = qt->qtVersionString();
qtEnv.frameworkBuild = qt->isFrameworkBuild();
qtEnv.configItems = qt->configValues();
qtEnv.qtConfigItems = qt->qtConfigValues();
const qbs::ErrorInfo errorInfo = qbs::setupQtProfile(profileName, settings(), qtEnv);
if (errorInfo.hasError()) {
Core::MessageManager::write(tr("Failed to set up kit for qbs: %1")
.arg(errorInfo.toString()), Core::MessageManager::ModeSwitch);
}
}
void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k)
{
const QString name = ProjectExplorer::Project::makeUnique(
QString::fromLatin1("qtc_") + k->fileSystemFriendlyName(), m_settings->profiles());
setProfileForKit(name, k);
addQtProfileFromKit(name, k);
// set up properties:
QVariantMap data = m_defaultPropertyProvider->properties(k, QVariantMap());
......
......@@ -74,7 +74,6 @@ public:
void setProfileForKit(const QString &name, const ProjectExplorer::Kit *k);
static qbs::Settings *settings();
static qbs::Preferences *preferences();
Internal::QbsLogSink *logSink() { return m_logSink; }
private slots:
......@@ -83,12 +82,12 @@ private slots:
private:
void addProfile(const QString &name, const QVariantMap &data);
void removeCreatorProfiles();
void addQtProfileFromKit(const QString &profileName, const ProjectExplorer::Kit *k);
void addProfileFromKit(const ProjectExplorer::Kit *k);
Internal::QbsProjectManagerPlugin *m_plugin;
Internal::QbsLogSink *m_logSink;
static qbs::Settings *m_settings;
static qbs::Preferences *m_preferences;
DefaultPropertyProvider *m_defaultPropertyProvider;
};
......
......@@ -4,10 +4,12 @@ include(../../qtcreatorplugin.pri)
isEmpty(QBS_INSTALL_DIR): QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR)
isEmpty(QBS_INSTALL_DIR) {
QBS_SOURCE_DIR = $$PWD/../../shared/qbs
include($$QBS_SOURCE_DIR/src/lib/use.pri)
include($$QBS_SOURCE_DIR/src/lib/corelib/use_corelib.pri)
include($$QBS_SOURCE_DIR/src/lib/qtprofilesetup/use_qtprofilesetup.pri)
macx:QMAKE_LFLAGS += -Wl,-rpath,@loader_path/../ # Mac: fix rpath for qbscore soname
} else {
include($${QBS_INSTALL_DIR}/include/qbs/use_installed.pri)
include($${QBS_INSTALL_DIR}/include/qbs/use_installed_corelib.pri)
include($${QBS_INSTALL_DIR}/include/qbs/use_installed_qtprofilesetup.pri)
}
QBS_INSTALL_DIR_FWD_SLASHES = $$replace(QBS_INSTALL_DIR, \\\\, /)
DEFINES += QBS_INSTALL_DIR=\\\"$$QBS_INSTALL_DIR_FWD_SLASHES\\\"
......
......@@ -38,9 +38,14 @@ QtcPlugin {
Depends { name: "QtSupport" }
Depends { name: "QmlJS" }
Depends { name: "QmlJSTools" }
property bool useInternalQbsProducts: project.qbsSubModuleExists && !project.useExternalQbs
Depends {
name: "qbscore"
condition: project.qbsSubModuleExists && !project.useExternalQbs
condition: product.useInternalQbsProducts
}
Depends {
name: "qbsqtprofilesetup"
condition: product.useInternalQbsProducts
}
cpp.defines: base.concat([
......
Subproject commit 2c1a305295f05f35527b0cceb500d013e12752e0
Subproject commit f64c7492a3ba5cd73994be810be7ff529a19f37e
......@@ -29,7 +29,7 @@ Project {
property path resourcesInstallDir: project.ide_data_path + "/qbs"
references: [
qbsBaseDir + "/src/lib/lib.qbs",
qbsBaseDir + "/src/lib/libs.qbs",
qbsBaseDir + "/src/plugins/plugins.qbs",
qbsBaseDir + "/share/share.qbs"
]
......
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