forked from qt-creator/qt-creator
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: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -24,7 +24,8 @@ SUBDIRS += \
|
|||||||
utils/process_stub.pro
|
utils/process_stub.pro
|
||||||
|
|
||||||
QBS_DIRS = \
|
QBS_DIRS = \
|
||||||
../shared/qbs/src/lib \
|
../shared/qbs/src/lib/corelib \
|
||||||
|
../shared/qbs/src/lib/qtprofilesetup \
|
||||||
../shared/qbs/src/plugins \
|
../shared/qbs/src/plugins \
|
||||||
../shared/qbs/static.pro
|
../shared/qbs/static.pro
|
||||||
|
|
||||||
|
|||||||
@@ -46,31 +46,6 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(k, return defaultData);
|
QTC_ASSERT(k, return defaultData);
|
||||||
QVariantMap data = 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))
|
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k))
|
||||||
data.insert(QLatin1String(QBS_SYSROOT), ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput());
|
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"));
|
: QStringList() << QLatin1String("msvc"));
|
||||||
} else if (targetAbi.os() == ProjectExplorer::Abi::MacOS) {
|
} else if (targetAbi.os() == ProjectExplorer::Abi::MacOS) {
|
||||||
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants (include header?)
|
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)) {
|
if (qt && qt->type() == QLatin1String(IOSQT)) {
|
||||||
QStringList targetOS;
|
QStringList targetOS;
|
||||||
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture)
|
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture)
|
||||||
|
|||||||
@@ -33,22 +33,6 @@
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Constants {
|
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:
|
// Toolchain related settings:
|
||||||
const char QBS_TARGETOS[] = "qbs.targetOS";
|
const char QBS_TARGETOS[] = "qbs.targetOS";
|
||||||
const char QBS_SYSROOT[] = "qbs.sysroot";
|
const char QBS_SYSROOT[] = "qbs.sysroot";
|
||||||
|
|||||||
@@ -423,7 +423,8 @@ void QbsProject::parse(const QVariantMap &config, const Environment &env, const
|
|||||||
QVariantMap baseConfig;
|
QVariantMap baseConfig;
|
||||||
QVariantMap userConfig = config;
|
QVariantMap userConfig = config;
|
||||||
QString specialKey = QLatin1String(Constants::QBS_CONFIG_PROFILE_KEY);
|
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);
|
specialKey = QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY);
|
||||||
baseConfig.insert(specialKey, userConfig.take(specialKey));
|
baseConfig.insert(specialKey, userConfig.take(specialKey));
|
||||||
params.setBuildConfiguration(baseConfig);
|
params.setBuildConfiguration(baseConfig);
|
||||||
@@ -460,10 +461,10 @@ void QbsProject::parse(const QVariantMap &config, const Environment &env, const
|
|||||||
params.setProjectFilePath(m_fileName);
|
params.setProjectFilePath(m_fileName);
|
||||||
params.setIgnoreDifferentProjectFilePath(false);
|
params.setIgnoreDifferentProjectFilePath(false);
|
||||||
params.setEnvironment(env.toProcessEnvironment());
|
params.setEnvironment(env.toProcessEnvironment());
|
||||||
qbs::Preferences *prefs = QbsManager::preferences();
|
const qbs::Preferences prefs(QbsManager::settings(), profileName);
|
||||||
const QString qbsDir = qbsDirectory();
|
const QString qbsDir = qbsDirectory();
|
||||||
params.setSearchPaths(prefs->searchPaths(qbsDir));
|
params.setSearchPaths(prefs.searchPaths(qbsDir));
|
||||||
params.setPluginPaths(prefs->pluginPaths(qbsDir));
|
params.setPluginPaths(prefs.pluginPaths(qbsDir));
|
||||||
|
|
||||||
// Do the parsing:
|
// Do the parsing:
|
||||||
prepareForParsing();
|
prepareForParsing();
|
||||||
|
|||||||
@@ -35,15 +35,19 @@
|
|||||||
#include "qbsprojectmanagerconstants.h"
|
#include "qbsprojectmanagerconstants.h"
|
||||||
#include "qbsprojectmanagerplugin.h"
|
#include "qbsprojectmanagerplugin.h"
|
||||||
|
|
||||||
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <projectexplorer/kit.h>
|
#include <projectexplorer/kit.h>
|
||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <qmljstools/qmljstoolsconstants.h>
|
#include <qmljstools/qmljstoolsconstants.h>
|
||||||
|
#include <qtsupport/baseqtversion.h>
|
||||||
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
#include <qbs.h>
|
#include <qbs.h>
|
||||||
|
#include <qtprofilesetup.h>
|
||||||
#include <tools/profile.h> // TODO: Do this in qbs.h.
|
#include <tools/profile.h> // TODO: Do this in qbs.h.
|
||||||
|
|
||||||
const QChar sep = QLatin1Char('.');
|
const QChar sep = QLatin1Char('.');
|
||||||
@@ -54,14 +58,12 @@ static QString qtcProfilePrefix() { return qtcProfileGroup() + sep; }
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
|
|
||||||
qbs::Settings *QbsManager::m_settings = 0;
|
qbs::Settings *QbsManager::m_settings = 0;
|
||||||
qbs::Preferences *QbsManager::m_preferences = 0;
|
|
||||||
|
|
||||||
QbsManager::QbsManager(Internal::QbsProjectManagerPlugin *plugin) :
|
QbsManager::QbsManager(Internal::QbsProjectManagerPlugin *plugin) :
|
||||||
m_plugin(plugin),
|
m_plugin(plugin),
|
||||||
m_defaultPropertyProvider(new DefaultPropertyProvider)
|
m_defaultPropertyProvider(new DefaultPropertyProvider)
|
||||||
{
|
{
|
||||||
m_settings = new qbs::Settings(QLatin1String("QtProject"), QLatin1String("qbs"));
|
m_settings = new qbs::Settings(QLatin1String("QtProject"), QLatin1String("qbs"));
|
||||||
m_preferences = new qbs::Preferences(m_settings);
|
|
||||||
|
|
||||||
setObjectName(QLatin1String("QbsProjectManager"));
|
setObjectName(QLatin1String("QbsProjectManager"));
|
||||||
connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(pushKitsToQbs()));
|
connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(pushKitsToQbs()));
|
||||||
@@ -87,7 +89,6 @@ QbsManager::~QbsManager()
|
|||||||
{
|
{
|
||||||
delete m_defaultPropertyProvider;
|
delete m_defaultPropertyProvider;
|
||||||
delete m_settings;
|
delete m_settings;
|
||||||
delete m_preferences;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QbsManager::mimeType() const
|
QString QbsManager::mimeType() const
|
||||||
@@ -124,11 +125,6 @@ qbs::Settings *QbsManager::settings()
|
|||||||
return m_settings;
|
return m_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
qbs::Preferences *QbsManager::preferences()
|
|
||||||
{
|
|
||||||
return m_preferences;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QbsManager::addProfile(const QString &name, const QVariantMap &data)
|
void QbsManager::addProfile(const QString &name, const QVariantMap &data)
|
||||||
{
|
{
|
||||||
qbs::Profile profile(name, settings());
|
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)
|
void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k)
|
||||||
{
|
{
|
||||||
const QString name = ProjectExplorer::Project::makeUnique(
|
const QString name = ProjectExplorer::Project::makeUnique(
|
||||||
QString::fromLatin1("qtc_") + k->fileSystemFriendlyName(), m_settings->profiles());
|
QString::fromLatin1("qtc_") + k->fileSystemFriendlyName(), m_settings->profiles());
|
||||||
setProfileForKit(name, k);
|
setProfileForKit(name, k);
|
||||||
|
addQtProfileFromKit(name, k);
|
||||||
|
|
||||||
// set up properties:
|
// set up properties:
|
||||||
QVariantMap data = m_defaultPropertyProvider->properties(k, QVariantMap());
|
QVariantMap data = m_defaultPropertyProvider->properties(k, QVariantMap());
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ public:
|
|||||||
void setProfileForKit(const QString &name, const ProjectExplorer::Kit *k);
|
void setProfileForKit(const QString &name, const ProjectExplorer::Kit *k);
|
||||||
|
|
||||||
static qbs::Settings *settings();
|
static qbs::Settings *settings();
|
||||||
static qbs::Preferences *preferences();
|
|
||||||
Internal::QbsLogSink *logSink() { return m_logSink; }
|
Internal::QbsLogSink *logSink() { return m_logSink; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@@ -83,12 +82,12 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
void addProfile(const QString &name, const QVariantMap &data);
|
void addProfile(const QString &name, const QVariantMap &data);
|
||||||
void removeCreatorProfiles();
|
void removeCreatorProfiles();
|
||||||
|
void addQtProfileFromKit(const QString &profileName, const ProjectExplorer::Kit *k);
|
||||||
void addProfileFromKit(const ProjectExplorer::Kit *k);
|
void addProfileFromKit(const ProjectExplorer::Kit *k);
|
||||||
|
|
||||||
Internal::QbsProjectManagerPlugin *m_plugin;
|
Internal::QbsProjectManagerPlugin *m_plugin;
|
||||||
Internal::QbsLogSink *m_logSink;
|
Internal::QbsLogSink *m_logSink;
|
||||||
static qbs::Settings *m_settings;
|
static qbs::Settings *m_settings;
|
||||||
static qbs::Preferences *m_preferences;
|
|
||||||
|
|
||||||
DefaultPropertyProvider *m_defaultPropertyProvider;
|
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_INSTALL_DIR = $$(QBS_INSTALL_DIR)
|
||||||
isEmpty(QBS_INSTALL_DIR) {
|
isEmpty(QBS_INSTALL_DIR) {
|
||||||
QBS_SOURCE_DIR = $$PWD/../../shared/qbs
|
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
|
macx:QMAKE_LFLAGS += -Wl,-rpath,@loader_path/../ # Mac: fix rpath for qbscore soname
|
||||||
} else {
|
} 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, \\\\, /)
|
QBS_INSTALL_DIR_FWD_SLASHES = $$replace(QBS_INSTALL_DIR, \\\\, /)
|
||||||
DEFINES += QBS_INSTALL_DIR=\\\"$$QBS_INSTALL_DIR_FWD_SLASHES\\\"
|
DEFINES += QBS_INSTALL_DIR=\\\"$$QBS_INSTALL_DIR_FWD_SLASHES\\\"
|
||||||
|
|||||||
@@ -38,9 +38,14 @@ QtcPlugin {
|
|||||||
Depends { name: "QtSupport" }
|
Depends { name: "QtSupport" }
|
||||||
Depends { name: "QmlJS" }
|
Depends { name: "QmlJS" }
|
||||||
Depends { name: "QmlJSTools" }
|
Depends { name: "QmlJSTools" }
|
||||||
|
property bool useInternalQbsProducts: project.qbsSubModuleExists && !project.useExternalQbs
|
||||||
Depends {
|
Depends {
|
||||||
name: "qbscore"
|
name: "qbscore"
|
||||||
condition: project.qbsSubModuleExists && !project.useExternalQbs
|
condition: product.useInternalQbsProducts
|
||||||
|
}
|
||||||
|
Depends {
|
||||||
|
name: "qbsqtprofilesetup"
|
||||||
|
condition: product.useInternalQbsProducts
|
||||||
}
|
}
|
||||||
|
|
||||||
cpp.defines: base.concat([
|
cpp.defines: base.concat([
|
||||||
|
|||||||
Submodule src/shared/qbs updated: 2c1a305295...f64c7492a3
@@ -29,7 +29,7 @@ Project {
|
|||||||
property path resourcesInstallDir: project.ide_data_path + "/qbs"
|
property path resourcesInstallDir: project.ide_data_path + "/qbs"
|
||||||
|
|
||||||
references: [
|
references: [
|
||||||
qbsBaseDir + "/src/lib/lib.qbs",
|
qbsBaseDir + "/src/lib/libs.qbs",
|
||||||
qbsBaseDir + "/src/plugins/plugins.qbs",
|
qbsBaseDir + "/src/plugins/plugins.qbs",
|
||||||
qbsBaseDir + "/share/share.qbs"
|
qbsBaseDir + "/share/share.qbs"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user