Move most of the BuildConfiguration specific functions

Note: I didn't fix all the connects and there are a few missing things.
This compiles, more work is coming.
This commit is contained in:
dt
2009-11-25 18:50:20 +01:00
parent 7949d93a1a
commit a312206306
39 changed files with 714 additions and 695 deletions

View File

@@ -37,6 +37,7 @@
#include "s60runconfigbluetoothstarter.h"
#include "bluetoothlistener_gui.h"
#include "serialdevicelister.h"
#include "qt4buildconfiguration.h"
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
@@ -106,21 +107,22 @@ QString S60DeviceRunConfiguration::type() const
ProjectExplorer::ToolChain::ToolChainType S60DeviceRunConfiguration::toolChainType(
ProjectExplorer::BuildConfiguration *configuration) const
{
if (const Qt4Project *pro = qobject_cast<const Qt4Project*>(project()))
return pro->toolChainType(configuration);
if (Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(configuration))
return bc->toolChainType();
return ProjectExplorer::ToolChain::INVALID;
}
ProjectExplorer::ToolChain::ToolChainType S60DeviceRunConfiguration::toolChainType() const
{
if (const Qt4Project *pro = qobject_cast<const Qt4Project*>(project()))
return pro->toolChainType(pro->activeBuildConfiguration());
if (Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration()))
return bc->toolChainType();
return ProjectExplorer::ToolChain::INVALID;
}
bool S60DeviceRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
{
const ToolChain::ToolChainType type = toolChainType(configuration);
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(configuration);
const ToolChain::ToolChainType type = qt4bc->toolChainType();
return type == ToolChain::GCCE || type == ToolChain::RVCT_ARMV5 || type == ToolChain::RVCT_ARMV6;
}
@@ -243,9 +245,8 @@ QString S60DeviceRunConfiguration::packageFileName() const
QString S60DeviceRunConfiguration::localExecutableFileName() const
{
Qt4Project *qt4project = qobject_cast<Qt4Project *>(project());
S60Devices::Device device = S60Manager::instance()->deviceForQtVersion(
qt4project->qtVersion(qt4project->activeBuildConfiguration()));
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
S60Devices::Device device = S60Manager::instance()->deviceForQtVersion(qt4bc->qtVersion());
QString localExecutable = device.epocRoot;
localExecutable += QString::fromLatin1("/epoc32/release/%1/%2/%3.exe")
@@ -258,7 +259,7 @@ void S60DeviceRunConfiguration::updateTarget()
{
if (m_cachedTargetInformationValid)
return;
Qt4Project *pro = static_cast<Qt4Project *>(project());
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
Qt4PriFileNode * priFileNode = static_cast<Qt4Project *>(project())->rootProjectNode()->findProFileFor(m_proFilePath);
if (!priFileNode) {
m_baseFileName = QString::null;
@@ -266,7 +267,7 @@ void S60DeviceRunConfiguration::updateTarget()
emit targetInformationChanged();
return;
}
QtVersion *qtVersion = pro->qtVersion(pro->activeBuildConfiguration());
QtVersion *qtVersion = qt4bc->qtVersion();
ProFileReader *reader = priFileNode->createProFileReader();
reader->setCumulative(false);
reader->setQtVersion(qtVersion);
@@ -274,7 +275,7 @@ void S60DeviceRunConfiguration::updateTarget()
// Find out what flags we pass on to qmake, this code is duplicated in the qmake step
QtVersion::QmakeBuildConfigs defaultBuildConfiguration = qtVersion->defaultBuildConfig();
QtVersion::QmakeBuildConfigs projectBuildConfiguration =
QtVersion::QmakeBuildConfigs(pro->activeBuildConfiguration()->value("buildConfiguration").toInt());
QtVersion::QmakeBuildConfigs(qt4bc->value("buildConfiguration").toInt());
QStringList addedUserConfigArguments;
QStringList removedUserConfigArguments;
if ((defaultBuildConfiguration & QtVersion::BuildAll) && !(projectBuildConfiguration & QtVersion::BuildAll))
@@ -297,7 +298,7 @@ void S60DeviceRunConfiguration::updateTarget()
// Extract data
const QDir baseProjectDirectory = QFileInfo(project()->file()->fileName()).absoluteDir();
const QString relSubDir = baseProjectDirectory.relativeFilePath(QFileInfo(m_proFilePath).path());
const QDir baseBuildDirectory = project()->buildDirectory(project()->activeBuildConfiguration());
const QDir baseBuildDirectory = qt4bc->buildDirectory();
const QString baseDir = baseBuildDirectory.absoluteFilePath(relSubDir);
// Directory
@@ -319,7 +320,7 @@ void S60DeviceRunConfiguration::updateTarget()
m_packageTemplateFileName = QDir::cleanPath(
m_workingDir + QLatin1Char('/') + m_targetName + QLatin1String("_template.pkg"));
switch (pro->toolChainType(pro->activeBuildConfiguration())) {
switch (qt4bc->toolChainType()) {
case ToolChain::GCCE:
case ToolChain::GCCE_GNUPOC:
m_platform = QLatin1String("gcce");
@@ -417,8 +418,8 @@ S60DeviceRunControlBase::S60DeviceRunControlBase(RunConfiguration *runConfigurat
connect(m_makesis, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(makesisProcessFinished()));
Qt4Project *project = qobject_cast<Qt4Project *>(runConfiguration->project());
QTC_ASSERT(project, return);
Qt4BuildConfiguration *activeBuildConf =
static_cast<Qt4BuildConfiguration *>(runConfiguration->project()->activeBuildConfiguration());
S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
QTC_ASSERT(s60runConfig, return);
@@ -432,18 +433,17 @@ S60DeviceRunControlBase::S60DeviceRunControlBase(RunConfiguration *runConfigurat
m_symbianTarget = s60runConfig->symbianTarget();
m_packageTemplateFile = s60runConfig->packageTemplateFileName();
m_workingDirectory = QFileInfo(m_baseFileName).absolutePath();
m_qtDir = project->qtVersion(project->activeBuildConfiguration())->versionInfo().value("QT_INSTALL_DATA");
m_qtDir = activeBuildConf->qtVersion()->versionInfo().value("QT_INSTALL_DATA");
m_useCustomSignature = (s60runConfig->signingMode() == S60DeviceRunConfiguration::SignCustom);
m_customSignaturePath = s60runConfig->customSignaturePath();
m_customKeyPath = s60runConfig->customKeyPath();
ProjectExplorer::BuildConfiguration *const activeBuildConf = project->activeBuildConfiguration();
const S60Devices::Device device = S60Manager::instance()->deviceForQtVersion(project->qtVersion(activeBuildConf));
const S60Devices::Device device = S60Manager::instance()->deviceForQtVersion(activeBuildConf->qtVersion());
switch (m_toolChain) {
case ProjectExplorer::ToolChain::GCCE_GNUPOC:
case ProjectExplorer::ToolChain::RVCT_ARMV6_GNUPOC: {
// 'sis' is a make target here. Set up with correct environment
ProjectExplorer::ToolChain *toolchain = project->toolChain(activeBuildConf);
ProjectExplorer::ToolChain *toolchain = activeBuildConf->toolChain();
m_makesisTool = toolchain->makeCommand();
m_toolsDirectory = device.epocRoot + QLatin1String("/epoc32/tools");
ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment();