diff --git a/src/plugins/genericprojectmanager/GenericProject.mimetypes.xml b/src/plugins/genericprojectmanager/GenericProject.mimetypes.xml new file mode 100644 index 00000000000..522cd93f708 --- /dev/null +++ b/src/plugins/genericprojectmanager/GenericProject.mimetypes.xml @@ -0,0 +1,8 @@ + + + + + Generic Project file + + + diff --git a/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec b/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec new file mode 100644 index 00000000000..d3cf9fd5131 --- /dev/null +++ b/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec @@ -0,0 +1,28 @@ + + Nokia Corporation + (C) 2008-2009 Nokia Corporation + +Commercial Usage + +Licensees holding valid Qt Commercial licenses may use this plugin in +accordance with the Qt Commercial License Agreement provided with the +Software or, alternatively, in accordance with the terms contained in +a written agreement between you and Nokia. + +GNU Lesser General Public License Usage + +Alternatively, this plugin may be used under the terms of the GNU Lesser +General Public License version 2.1 as published by the Free Software +Foundation. Please review the following information to +ensure the GNU Lesser General Public License version 2.1 requirements +will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + Generic support + http://www.qtsoftware.com + + + + + + + + diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp new file mode 100644 index 00000000000..b291f43a616 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -0,0 +1,417 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "genericproject.h" +#include "genericprojectconstants.h" +#include "genericprojectnodes.h" +#include "makestep.h" + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +using namespace GenericProjectManager; +using namespace GenericProjectManager::Internal; + +//////////////////////////////////////////////////////////////////////////////////// +// GenericProject +//////////////////////////////////////////////////////////////////////////////////// +GenericProject::GenericProject(Manager *manager, const QString &fileName) + : _manager(manager), + _fileName(fileName), + _toolChain(0) +{ + qDebug() << Q_FUNC_INFO; + + _file = new GenericProjectFile(this, fileName); + _rootNode = new GenericProjectNode(_file); + + refresh(); +} + +GenericProject::~GenericProject() +{ + qDebug() << Q_FUNC_INFO; + + delete _rootNode; + delete _toolChain; +} + +void GenericProject::refresh() +{ + qDebug() << Q_FUNC_INFO; + + _rootNode->refresh(); + + setToolChain(_rootNode->toolChainId()); + + CppTools::CppModelManagerInterface *modelManager = + ExtensionSystem::PluginManager::instance()->getObject(); + + if (_toolChain && modelManager) { + const QByteArray predefinedMacros = _toolChain->predefinedMacros(); + const QList systemHeaderPaths = _toolChain->systemHeaderPaths(); + + CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this); + pinfo.defines = predefinedMacros; + + QStringList allIncludePaths, allFrameworkPaths; + + foreach (const ProjectExplorer::HeaderPath &headerPath, _toolChain->systemHeaderPaths()) { + if (headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath) + allFrameworkPaths.append(headerPath.path()); + + else + allIncludePaths.append(headerPath.path()); + } + + allIncludePaths += _rootNode->includePaths(); + + pinfo.frameworkPaths = allFrameworkPaths; + pinfo.includePaths = allIncludePaths; + + // ### add _defines. + pinfo.sourceFiles = _rootNode->files(); + pinfo.sourceFiles += _rootNode->generated(); + + modelManager->updateProjectInfo(pinfo); + modelManager->updateSourceFiles(pinfo.sourceFiles); + } +} + +void GenericProject::setToolChain(const QString &toolChainId) +{ + using namespace ProjectExplorer; + + qDebug() << Q_FUNC_INFO; + + delete _toolChain; + _toolChain = 0; + + if (toolChainId == QLatin1String("mingw")) { + const QLatin1String qmake_cxx("g++"); // ### FIXME + const QString mingwDirectory; // ### FIXME + + _toolChain = ToolChain::createMinGWToolChain(qmake_cxx, mingwDirectory); + + } else if (toolChainId == QLatin1String("msvc")) { + const QString msvcVersion; // ### FIXME + _toolChain = ToolChain::createMSVCToolChain(msvcVersion); + + } else if (toolChainId == QLatin1String("wince")) { + const QString msvcVersion, wincePlatform; // ### FIXME + _toolChain = ToolChain::createWinCEToolChain(msvcVersion, wincePlatform); + + } else if (toolChainId == QLatin1String("gcc") || toolChainId == QLatin1String("icc")) { + const QLatin1String qmake_cxx("g++"); // ### FIXME + _toolChain = ToolChain::createGccToolChain(qmake_cxx); + + } +} + +QString GenericProject::buildParser(const QString &buildConfiguration) const +{ + qDebug() << Q_FUNC_INFO; + + if (_toolChain) { + switch (_toolChain->type()) { + case ProjectExplorer::ToolChain::GCC: + case ProjectExplorer::ToolChain::LinuxICC: + case ProjectExplorer::ToolChain::MinGW: + return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_GCC); + + case ProjectExplorer::ToolChain::MSVC: + case ProjectExplorer::ToolChain::WINCE: + return ProjectExplorer::Constants::BUILD_PARSER_MSVC; + + default: + break; + } // switch + } + + return QString(); +} + +QString GenericProject::name() const +{ + qDebug() << Q_FUNC_INFO; + + return _projectName; +} + +Core::IFile *GenericProject::file() const +{ + qDebug() << Q_FUNC_INFO; + + return _file; +} + +ProjectExplorer::IProjectManager *GenericProject::projectManager() const +{ + qDebug() << Q_FUNC_INFO; + + return _manager; +} + +QList GenericProject::dependsOn() +{ + qDebug() << Q_FUNC_INFO; + + return QList(); +} + +bool GenericProject::isApplication() const +{ + qDebug() << Q_FUNC_INFO; + + return true; +} + +ProjectExplorer::Environment GenericProject::environment(const QString &) const +{ + qDebug() << Q_FUNC_INFO; + + return ProjectExplorer::Environment::systemEnvironment(); +} + +QString GenericProject::buildDirectory(const QString &buildConfiguration) const +{ + qDebug() << Q_FUNC_INFO; + + QString buildDirectory = value(buildConfiguration, "buildDirectory").toString(); + + if (buildDirectory.isEmpty()) { + QFileInfo fileInfo(_fileName); + + buildDirectory = fileInfo.absolutePath(); + } + + return buildDirectory; +} + +ProjectExplorer::BuildStepConfigWidget *GenericProject::createConfigWidget() +{ + qDebug() << Q_FUNC_INFO; + + return new GenericBuildSettingsWidget(this); +} + +QList GenericProject::subConfigWidgets() +{ + qDebug() << Q_FUNC_INFO; + + return QList(); +} + + void GenericProject::newBuildConfiguration(const QString &buildConfiguration) + { + qDebug() << Q_FUNC_INFO; + + makeStep()->setBuildTarget(buildConfiguration, "all", true); + } + +ProjectExplorer::ProjectNode *GenericProject::rootProjectNode() const +{ + qDebug() << Q_FUNC_INFO; + + return _rootNode; +} + +QStringList GenericProject::files(FilesMode fileMode) const +{ + qDebug() << Q_FUNC_INFO; + + return _rootNode->files(); +} + +void GenericProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer) +{ + qDebug() << Q_FUNC_INFO; + + Project::saveSettingsImpl(writer); +} + +QStringList GenericProject::targets() const +{ + QStringList targets; + targets.append(QLatin1String("all")); + targets.append(QLatin1String("clean")); + return targets; +} + +MakeStep *GenericProject::makeStep() const +{ + qDebug() << Q_FUNC_INFO; + + foreach (ProjectExplorer::BuildStep *bs, buildSteps()) { + if (MakeStep *ms = qobject_cast(bs)) + return ms; + } + + return 0; +} + +void GenericProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader) +{ + Project::restoreSettingsImpl(reader); + + if (buildConfigurations().isEmpty()) { + MakeStep *makeStep = new MakeStep(this); + insertBuildStep(0, makeStep); + + const QLatin1String all("all"); + + addBuildConfiguration(all); + setActiveBuildConfiguration(all); + makeStep->setBuildTarget(all, all, /* on = */ true); + + const QLatin1String buildDirectory("buildDirectory"); + + const QFileInfo fileInfo(file()->fileName()); + setValue(all, buildDirectory, fileInfo.absolutePath()); + } +} + +//////////////////////////////////////////////////////////////////////////////////// +// GenericBuildSettingsWidget +//////////////////////////////////////////////////////////////////////////////////// +GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project) + : _project(project) +{ + qDebug() << Q_FUNC_INFO; + + QFormLayout *fl = new QFormLayout(this); + + _pathChooser = new Core::Utils::PathChooser(this); + _pathChooser->setEnabled(true); + + fl->addRow("Build directory:", _pathChooser); + + connect(_pathChooser, SIGNAL(changed()), this, SLOT(buildDirectoryChanged())); +} + +GenericBuildSettingsWidget::~GenericBuildSettingsWidget() +{ } + +QString GenericBuildSettingsWidget::displayName() const +{ return tr("Generic Manager"); } + +void GenericBuildSettingsWidget::init(const QString &buildConfiguration) +{ + qDebug() << Q_FUNC_INFO; + + _buildConfiguration = buildConfiguration; + _pathChooser->setPath(_project->buildDirectory(buildConfiguration)); +} + +void GenericBuildSettingsWidget::buildDirectoryChanged() +{ + qDebug() << Q_FUNC_INFO; + + _project->setValue(_buildConfiguration, "buildDirectory", _pathChooser->path()); +} + + +//////////////////////////////////////////////////////////////////////////////////// +// GenericProjectFile +//////////////////////////////////////////////////////////////////////////////////// +GenericProjectFile::GenericProjectFile(GenericProject *parent, QString fileName) + : Core::IFile(parent), + _project(parent), + _fileName(fileName) +{ } + +GenericProjectFile::~GenericProjectFile() +{ } + +bool GenericProjectFile::save(const QString &) +{ + qDebug() << Q_FUNC_INFO; + return false; +} + +QString GenericProjectFile::fileName() const +{ + qDebug() << Q_FUNC_INFO; + return _fileName; +} + +QString GenericProjectFile::defaultPath() const +{ + qDebug() << Q_FUNC_INFO; + return QString(); +} + +QString GenericProjectFile::suggestedFileName() const +{ + qDebug() << Q_FUNC_INFO; + return QString(); +} + +QString GenericProjectFile::mimeType() const +{ + qDebug() << Q_FUNC_INFO; + return Constants::GENERICMIMETYPE; +} + +bool GenericProjectFile::isModified() const +{ + qDebug() << Q_FUNC_INFO; + return false; +} + +bool GenericProjectFile::isReadOnly() const +{ + qDebug() << Q_FUNC_INFO; + return true; +} + +bool GenericProjectFile::isSaveAsAllowed() const +{ + qDebug() << Q_FUNC_INFO; + return false; +} + +void GenericProjectFile::modified(ReloadBehavior *) +{ + qDebug() << Q_FUNC_INFO; +} + diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h new file mode 100644 index 00000000000..3a9bcb2bf82 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericproject.h @@ -0,0 +1,148 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef GENERICPROJECT_H +#define GENERICPROJECT_H + +#include "genericprojectmanager.h" +#include "genericprojectnodes.h" +#include "makestep.h" + +#include +#include +#include +#include +#include +#include + +namespace GenericProjectManager { +namespace Internal{ + +class GenericProjectFile; + +class GenericProject : public ProjectExplorer::Project +{ + Q_OBJECT + +public: + GenericProject(Manager *manager, const QString &filename); + virtual ~GenericProject(); + + virtual QString name() const; + virtual Core::IFile *file() const; + virtual ProjectExplorer::IProjectManager *projectManager() const; + + virtual QList dependsOn(); + + virtual bool isApplication() const; + + virtual ProjectExplorer::Environment environment(const QString &buildConfiguration) const; + virtual QString buildDirectory(const QString &buildConfiguration) const; + + virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); + virtual QList subConfigWidgets(); + + virtual void newBuildConfiguration(const QString &buildConfiguration); + virtual ProjectExplorer::ProjectNode *rootProjectNode() const; + virtual QStringList files(FilesMode fileMode) const; + + void setToolChain(const QString &toolChainId); + + QStringList targets() const; + MakeStep *makeStep() const; + QString buildParser(const QString &buildConfiguration) const; + +private: + void refresh(); + +protected: + virtual void saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer); + virtual void restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader); + +private: + Manager *_manager; + QString _fileName; + GenericProjectFile *_file; + QString _projectName; + + GenericProjectNode* _rootNode; + ProjectExplorer::ToolChain *_toolChain; +}; + +class GenericProjectFile : public Core::IFile +{ + Q_OBJECT + +public: + GenericProjectFile(GenericProject *parent, QString fileName); + virtual ~GenericProjectFile(); + + virtual bool save(const QString &fileName = QString()); + virtual QString fileName() const; + + virtual QString defaultPath() const; + virtual QString suggestedFileName() const; + virtual QString mimeType() const; + + virtual bool isModified() const; + virtual bool isReadOnly() const; + virtual bool isSaveAsAllowed() const; + + virtual void modified(ReloadBehavior *behavior); + +private: + GenericProject *_project; + QString _fileName; +}; + +class GenericBuildSettingsWidget : public ProjectExplorer::BuildStepConfigWidget +{ + Q_OBJECT + +public: + GenericBuildSettingsWidget(GenericProject *project); + virtual ~GenericBuildSettingsWidget(); + + virtual QString displayName() const; + + virtual void init(const QString &buildConfiguration); + +private Q_SLOTS: + void buildDirectoryChanged(); + +private: + GenericProject *_project; + Core::Utils::PathChooser *_pathChooser; + QString _buildConfiguration; +}; + +} // namespace Internal +} // namespace GenericProjectManager + +#endif // GENERICPROJECT_H diff --git a/src/plugins/genericprojectmanager/genericproject.qrc b/src/plugins/genericprojectmanager/genericproject.qrc new file mode 100644 index 00000000000..e31e9270e7d --- /dev/null +++ b/src/plugins/genericprojectmanager/genericproject.qrc @@ -0,0 +1,5 @@ + + + GenericProject.mimetypes.xml + + diff --git a/src/plugins/genericprojectmanager/genericprojectconstants.h b/src/plugins/genericprojectmanager/genericprojectconstants.h new file mode 100644 index 00000000000..7a47effaff4 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectconstants.h @@ -0,0 +1,44 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef GENERICPROJECTCONSTANTS_H +#define GENERICPROJECTCONSTANTS_H + +namespace GenericProjectManager { +namespace Constants { + +const char *const PROJECTCONTEXT = "GenericProject.ProjectContext"; +const char *const GENERICMIMETYPE = "text/x-generic-project"; +const char *const MAKESTEP = "GenericProjectManager.MakeStep"; + + +} // namespace Constants +} // namespace GenericProjectManager + +#endif // GENERICPROJECTCONSTANTS_H diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.cpp b/src/plugins/genericprojectmanager/genericprojectmanager.cpp new file mode 100644 index 00000000000..28a629b011d --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectmanager.cpp @@ -0,0 +1,68 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "genericprojectmanager.h" +#include "genericprojectconstants.h" +#include "genericproject.h" + +#include +#include +#include + +using namespace GenericProjectManager::Internal; + +Manager::Manager() +{ + Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); + _projectContext = uidm->uniqueIdentifier(GenericProjectManager::Constants::PROJECTCONTEXT); + _projectLanguage = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX); +} + +Manager::~Manager() +{ } + +int Manager::projectContext() const +{ return _projectContext; } + +int Manager::projectLanguage() const +{ return _projectLanguage; } + +QString Manager::mimeType() const +{ return QLatin1String(Constants::GENERICMIMETYPE); } + +ProjectExplorer::Project *Manager::openProject(const QString &fileName) +{ + QFileInfo fileInfo(fileName); + + if (fileInfo.isFile()) + return new GenericProject(this, fileName); + + return 0; +} + diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.h b/src/plugins/genericprojectmanager/genericprojectmanager.h new file mode 100644 index 00000000000..56da9865190 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectmanager.h @@ -0,0 +1,60 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef GENERICPROJECTMANAGER_H +#define GENERICPROJECTMANAGER_H + +#include + +namespace GenericProjectManager { +namespace Internal { + +class Manager: public ProjectExplorer::IProjectManager +{ + Q_OBJECT + +public: + Manager(); + virtual ~Manager(); + + virtual int projectContext() const; + virtual int projectLanguage() const; + + virtual QString mimeType() const; + virtual ProjectExplorer::Project *openProject(const QString &fileName); + +private: + int _projectContext; + int _projectLanguage; +}; + +} // namespace Internal +} // namespace GenericProjectManager + +#endif // GENERICPROJECTMANAGER_H diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.pro b/src/plugins/genericprojectmanager/genericprojectmanager.pro new file mode 100644 index 00000000000..066816643e2 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectmanager.pro @@ -0,0 +1,17 @@ +TEMPLATE = lib +TARGET = GenericProjectManager +include(../../qworkbenchplugin.pri) +include(genericprojectmanager_dependencies.pri) +HEADERS = genericproject.h \ + genericprojectplugin.h \ + genericprojectmanager.h \ + genericprojectconstants.h \ + genericprojectnodes.h \ + makestep.h +SOURCES = genericproject.cpp \ + genericprojectplugin.cpp \ + genericprojectmanager.cpp \ + genericprojectnodes.cpp \ + makestep.cpp +RESOURCES += genericproject.qrc +FORMS += diff --git a/src/plugins/genericprojectmanager/genericprojectmanager_dependencies.pri b/src/plugins/genericprojectmanager/genericprojectmanager_dependencies.pri new file mode 100644 index 00000000000..80118ad122e --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectmanager_dependencies.pri @@ -0,0 +1,4 @@ +include(../../plugins/projectexplorer/projectexplorer.pri) +include(../../plugins/cpptools/cpptools.pri) +include(../../plugins/cppeditor/cppeditor.pri) +include(../../plugins/texteditor/texteditor.pri) diff --git a/src/plugins/genericprojectmanager/genericprojectnodes.cpp b/src/plugins/genericprojectmanager/genericprojectnodes.cpp new file mode 100644 index 00000000000..d06e1909bd1 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectnodes.cpp @@ -0,0 +1,160 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "genericprojectnodes.h" +#include +#include +#include + +using namespace GenericProjectManager; +using namespace GenericProjectManager::Internal; + +GenericProjectNode::GenericProjectNode(Core::IFile *projectFile) + : ProjectExplorer::ProjectNode(QFileInfo(projectFile->fileName()).absolutePath()), + _projectFile(projectFile) +{} + +GenericProjectNode::~GenericProjectNode() +{ } + +Core::IFile *GenericProjectNode::projectFile() const +{ return _projectFile; } + +QString GenericProjectNode::projectFilePath() const +{ return _projectFile->fileName(); } + +void GenericProjectNode::refresh() +{ + QSettings projectInfo(projectFilePath(), QSettings::IniFormat); + + _files = projectInfo.value(QLatin1String("files")).toStringList(); + _generated = projectInfo.value(QLatin1String("generated")).toStringList(); + _includePaths = projectInfo.value(QLatin1String("includes")).toStringList(); + _defines = projectInfo.value(QLatin1String("defines")).toStringList(); + _toolChainId = projectInfo.value(QLatin1String("toolchain"), QLatin1String("gcc")).toString().toLower(); + + using namespace ProjectExplorer; + + QList fileNodes; + + FileNode *projectFileNode = new FileNode(projectFilePath(), ProjectFileType, /*generated = */ false); + fileNodes.append(projectFileNode); + + foreach (const QString &file, _files) { + QFileInfo fileInfo(file); + + QString filePath = fileInfo.absoluteFilePath(); + + FileType fileType = SourceType; + + FileNode *fileNode = new FileNode(filePath, fileType, /*generated = */ false); + + fileNodes.append(fileNode); + } + + addFileNodes(fileNodes, this); +} + +QStringList GenericProjectNode::files() const +{ return _files; } + +QStringList GenericProjectNode::generated() const +{ return _generated; } + +QStringList GenericProjectNode::includePaths() const +{ return _includePaths; } + +QStringList GenericProjectNode::defines() const +{ return _defines; } + +QString GenericProjectNode::toolChainId() const +{ return _toolChainId; } + +bool GenericProjectNode::hasTargets() const +{ + qDebug() << Q_FUNC_INFO; + + return true; +} + +QList GenericProjectNode::supportedActions() const +{ + qDebug() << Q_FUNC_INFO; + + return QList(); +} + +bool GenericProjectNode::addSubProjects(const QStringList &proFilePaths) +{ + qDebug() << Q_FUNC_INFO; + + Q_UNUSED(proFilePaths); + return false; +} + +bool GenericProjectNode::removeSubProjects(const QStringList &proFilePaths) +{ + qDebug() << Q_FUNC_INFO; + + Q_UNUSED(proFilePaths); + return false; +} + +bool GenericProjectNode::addFiles(const ProjectExplorer::FileType fileType, + const QStringList &filePaths, QStringList *notAdded) +{ + qDebug() << Q_FUNC_INFO; + + Q_UNUSED(fileType); + Q_UNUSED(filePaths); + Q_UNUSED(notAdded); + return false; +} + +bool GenericProjectNode::removeFiles(const ProjectExplorer::FileType fileType, + const QStringList &filePaths, QStringList *notRemoved) +{ + qDebug() << Q_FUNC_INFO; + + Q_UNUSED(fileType); + Q_UNUSED(filePaths); + Q_UNUSED(notRemoved); + return false; +} + +bool GenericProjectNode::renameFile(const ProjectExplorer::FileType fileType, + const QString &filePath, const QString &newFilePath) +{ + qDebug() << Q_FUNC_INFO; + + Q_UNUSED(fileType); + Q_UNUSED(filePath); + Q_UNUSED(newFilePath); + return false; +} diff --git a/src/plugins/genericprojectmanager/genericprojectnodes.h b/src/plugins/genericprojectmanager/genericprojectnodes.h new file mode 100644 index 00000000000..6a44b778bc7 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectnodes.h @@ -0,0 +1,89 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef GENERICPROJECTNODE_H +#define GENERICPROJECTNODE_H + +#include +#include +#include + +namespace GenericProjectManager { +namespace Internal { + +class GenericProjectNode : public ProjectExplorer::ProjectNode +{ +public: + GenericProjectNode(Core::IFile *projectFile); + virtual ~GenericProjectNode(); + + Core::IFile *projectFile() const; + QString projectFilePath() const; + + virtual bool hasTargets() const; + + virtual QList supportedActions() const; + + virtual bool addSubProjects(const QStringList &proFilePaths); + virtual bool removeSubProjects(const QStringList &proFilePaths); + + virtual bool addFiles(const ProjectExplorer::FileType fileType, + const QStringList &filePaths, + QStringList *notAdded = 0); + + virtual bool removeFiles(const ProjectExplorer::FileType fileType, + const QStringList &filePaths, + QStringList *notRemoved = 0); + + virtual bool renameFile(const ProjectExplorer::FileType fileType, + const QString &filePath, + const QString &newFilePath); + + + void refresh(); + + QStringList files() const; + QStringList generated() const; + QStringList includePaths() const; + QStringList defines() const; + QString toolChainId() const; + +private: + Core::IFile *_projectFile; + QStringList _files; + QStringList _generated; + QStringList _includePaths; + QStringList _defines; + QString _toolChainId; +}; + +} // namespace Internal +} // namespace GenericProjectManager + +#endif // GENERICPROJECTNODE_H diff --git a/src/plugins/genericprojectmanager/genericprojectplugin.cpp b/src/plugins/genericprojectmanager/genericprojectplugin.cpp new file mode 100644 index 00000000000..cd6c10ff5d9 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectplugin.cpp @@ -0,0 +1,69 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "genericprojectplugin.h" +#include "genericprojectmanager.h" +#include "makestep.h" + +#include +#include + +#include +#include + +using namespace GenericProjectManager::Internal; + +GenericProjectPlugin::GenericProjectPlugin() +{ } + +GenericProjectPlugin::~GenericProjectPlugin() +{ } + +bool GenericProjectPlugin::initialize(const QStringList &, QString *errorMessage) +{ + using namespace Core; + + ICore *core = ICore::instance(); + Core::MimeDatabase *mimeDB = core->mimeDatabase(); + + const QLatin1String mimetypesXml(":genericproject/GenericProject.mimetypes.xml"); + + if (! mimeDB->addMimeTypes(mimetypesXml, errorMessage)) + return false; + + addAutoReleasedObject(new Manager()); + addAutoReleasedObject(new MakeBuildStepFactory()); + + return true; +} + +void GenericProjectPlugin::extensionsInitialized() +{ } + +Q_EXPORT_PLUGIN(GenericProjectPlugin) diff --git a/src/plugins/genericprojectmanager/genericprojectplugin.h b/src/plugins/genericprojectmanager/genericprojectplugin.h new file mode 100644 index 00000000000..287ef500ff1 --- /dev/null +++ b/src/plugins/genericprojectmanager/genericprojectplugin.h @@ -0,0 +1,55 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef GENERICPROJECTPLUGIN_H +#define GENERICPROJECTPLUGIN_H + +#include + +#include + +namespace GenericProjectManager { +namespace Internal { + +class GenericProjectPlugin: public ExtensionSystem::IPlugin +{ + Q_OBJECT + +public: + GenericProjectPlugin(); + ~GenericProjectPlugin(); + + virtual bool initialize(const QStringList &arguments, QString *errorString); + virtual void extensionsInitialized(); +}; + +} // namespace Internal +} // namespace GenericProject + +#endif // GENERICPROJECTPLUGIN_H diff --git a/src/plugins/genericprojectmanager/makestep.cpp b/src/plugins/genericprojectmanager/makestep.cpp new file mode 100644 index 00000000000..852315e8d18 --- /dev/null +++ b/src/plugins/genericprojectmanager/makestep.cpp @@ -0,0 +1,308 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "makestep.h" +#include "genericprojectconstants.h" +#include "genericproject.h" +#include + +#include +#include +#include +#include +#include +#include + +namespace { +bool debug = false; +} + + +using namespace GenericProjectManager; +using namespace GenericProjectManager::Internal; + +MakeStep::MakeStep(GenericProject *pro) + : AbstractProcessStep(pro), m_pro(pro), m_buildParser(0) +{ +} + +MakeStep::~MakeStep() +{ + delete m_buildParser; + m_buildParser = 0; +} + +bool MakeStep::init(const QString &buildConfiguration) +{ + qDebug() << "***************** here!"; + // TODO figure out the correct build parser + delete m_buildParser; + m_buildParser = 0; + + const QString buildParser = m_pro->buildParser(buildConfiguration); + qDebug() << "*** build parser:" << buildParser; + + QList buildParserFactories = + ExtensionSystem::PluginManager::instance()->getObjects(); + + qDebug() << "***** build parsers count:" << buildParserFactories.size(); + + foreach (ProjectExplorer::IBuildParserFactory *factory, buildParserFactories) { + if (factory->canCreate(buildParser)) { + m_buildParser = factory->create(buildParser); + break; + } + } + + if (m_buildParser) { + qDebug() << "***** set up the connections"; + + connect(m_buildParser, SIGNAL(addToOutputWindow(const QString &)), + this, SIGNAL(addToOutputWindow(const QString &)), + Qt::DirectConnection); + connect(m_buildParser, SIGNAL(addToTaskWindow(const QString &, int, int, const QString &)), + this, SLOT(slotAddToTaskWindow(const QString &, int, int, const QString &)), + Qt::DirectConnection); + connect(m_buildParser, SIGNAL(enterDirectory(const QString &)), + this, SLOT(addDirectory(const QString &)), + Qt::DirectConnection); + connect(m_buildParser, SIGNAL(leaveDirectory(const QString &)), + this, SLOT(removeDirectory(const QString &)), + Qt::DirectConnection); + } + + m_openDirectories.clear(); + addDirectory(m_pro->buildDirectory(buildConfiguration)); + + setEnabled(buildConfiguration, true); + setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(buildConfiguration)); +#ifdef Q_OS_WIN + setCommand(buildConfiguration, "mingw32-make"); +#else // Q_OS_WIN + setCommand(buildConfiguration, "make"); // TODO give full path here? +#endif // Q_OS_WIN + setArguments(buildConfiguration, value(buildConfiguration, "buildTargets").toStringList()); // TODO + setEnvironment(buildConfiguration, m_pro->environment(buildConfiguration)); + return AbstractProcessStep::init(buildConfiguration); +} + +void MakeStep::run(QFutureInterface &fi) +{ + AbstractProcessStep::run(fi); +} + +QString MakeStep::name() +{ + return Constants::MAKESTEP; +} + +QString MakeStep::displayName() +{ + return "Make"; +} + +ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget() +{ + return new MakeBuildStepConfigWidget(this); +} + +bool MakeStep::immutable() const +{ + return true; +} + +void MakeStep::stdOut(const QString &line) +{ + if (m_buildParser) + m_buildParser->stdOutput(line); + AbstractProcessStep::stdOut(line); +} + +void MakeStep::stdError(const QString &line) +{ + if (m_buildParser) + m_buildParser->stdError(line); + AbstractProcessStep::stdError(line); +} + +void MakeStep::slotAddToTaskWindow(const QString & fn, int type, int linenumber, const QString & description) +{ + qDebug() << "**************" << Q_FUNC_INFO; + + QString filePath = fn; + if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) { + // We have no save way to decide which file in which subfolder + // is meant. Therefore we apply following heuristics: + // 1. Search for unique file in directories currently indicated as open by GNU make + // (Enter directory xxx, Leave directory xxx...) + current directory + // 3. Check if file is unique in whole project + // 4. Otherwise give up + + filePath = filePath.trimmed(); + + QList possibleFiles; + foreach (const QString &dir, m_openDirectories) { + QFileInfo candidate(dir + QLatin1Char('/') + filePath); + if (debug) + qDebug() << "Checking path " << candidate.filePath(); + if (candidate.exists() + && !possibleFiles.contains(candidate)) { + if (debug) + qDebug() << candidate.filePath() << "exists!"; + possibleFiles << candidate; + } + } + if (possibleFiles.count() == 0) { + if (debug) + qDebug() << "No success. Trying all files in project ..."; + QString fileName = QFileInfo(filePath).fileName(); + foreach (const QString &file, project()->files(ProjectExplorer::Project::AllFiles)) { + QFileInfo candidate(file); + if (candidate.fileName() == fileName) { + if (debug) + qDebug() << "Found " << file; + possibleFiles << candidate; + } + } + } + if (possibleFiles.count() == 1) + filePath = possibleFiles.first().filePath(); + else + qWarning() << "Could not find absolute location of file " << filePath; + } + emit addToTaskWindow(filePath, type, linenumber, description); +} + +void MakeStep::addDirectory(const QString &dir) +{ + if (!m_openDirectories.contains(dir)) + m_openDirectories.insert(dir); +} + +void MakeStep::removeDirectory(const QString &dir) +{ + if (m_openDirectories.contains(dir)) + m_openDirectories.remove(dir); +} + + +GenericProject *MakeStep::project() const +{ + return m_pro; +} + +bool MakeStep::buildsTarget(const QString &buildConfiguration, const QString &target) const +{ + return value(buildConfiguration, "buildTargets").toStringList().contains(target); +} + +void MakeStep::setBuildTarget(const QString &buildConfiguration, const QString &target, bool on) +{ + QStringList old = value(buildConfiguration, "buildTargets").toStringList(); + if (on && !old.contains(target)) + setValue(buildConfiguration, "buildTargets", old << target); + else if(!on && old.contains(target)) + setValue(buildConfiguration, "buildTargets", old.removeOne(target)); +} + +// +// GenericBuildStepConfigWidget +// +MakeBuildStepConfigWidget::MakeBuildStepConfigWidget(MakeStep *makeStep) + : m_makeStep(makeStep) +{ + QFormLayout *fl = new QFormLayout(this); + setLayout(fl); + + m_targetsList = new QListWidget; + fl->addRow("Targets:", m_targetsList); + + // TODO update this list also on rescans of the GenericLists.txt + GenericProject *pro = m_makeStep->project(); + foreach(const QString& target, pro->targets()) { + QListWidgetItem *item = new QListWidgetItem(target, m_targetsList); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setCheckState(Qt::Unchecked); + } + connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); +} + +void MakeBuildStepConfigWidget::itemChanged(QListWidgetItem *item) +{ + m_makeStep->setBuildTarget(m_buildConfiguration, item->text(), item->checkState() & Qt::Checked); +} + +QString MakeBuildStepConfigWidget::displayName() const +{ + return "Make"; +} + +void MakeBuildStepConfigWidget::init(const QString &buildConfiguration) +{ + // TODO + + // disconnect to make the changes to the items + disconnect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); + m_buildConfiguration = buildConfiguration; + int count = m_targetsList->count(); + for(int i = 0; i < count; ++i) { + QListWidgetItem *item = m_targetsList->item(i); + item->setCheckState(m_makeStep->buildsTarget(buildConfiguration, item->text()) ? Qt::Checked : Qt::Unchecked); + } + // and connect again + connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); +} + +// +// MakeBuildStepFactory +// + +bool MakeBuildStepFactory::canCreate(const QString &name) const +{ + return (Constants::MAKESTEP == name); +} + +ProjectExplorer::BuildStep *MakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const +{ + Q_ASSERT(name == Constants::MAKESTEP); + GenericProject *pro = qobject_cast(project); + Q_ASSERT(pro); + return new MakeStep(pro); +} + +QStringList MakeBuildStepFactory::canCreateForProject(ProjectExplorer::Project * /* pro */) const +{ + return QStringList(); +} + +QString MakeBuildStepFactory::displayNameForName(const QString & /* name */) const +{ + return "Make"; +} + diff --git a/src/plugins/genericprojectmanager/makestep.h b/src/plugins/genericprojectmanager/makestep.h new file mode 100644 index 00000000000..8841c5ebf46 --- /dev/null +++ b/src/plugins/genericprojectmanager/makestep.h @@ -0,0 +1,102 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef MAKESTEP_H +#define MAKESTEP_H + +#include + +QT_BEGIN_NAMESPACE +class QLineEdit; +class QListWidget; +class QListWidgetItem; +QT_END_NAMESPACE + +namespace GenericProjectManager { +namespace Internal { + +class GenericProject; + +class MakeStep : public ProjectExplorer::AbstractProcessStep +{ + Q_OBJECT +public: + MakeStep(GenericProject *pro); + ~MakeStep(); + virtual bool init(const QString &buildConfiguration); + + virtual void run(QFutureInterface &fi); + + virtual QString name(); + virtual QString displayName(); + virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); + virtual bool immutable() const; + GenericProject *project() const; + bool buildsTarget(const QString &buildConfiguration, const QString &target) const; + void setBuildTarget(const QString &buildConfiguration, const QString &target, bool on); +private slots: + void slotAddToTaskWindow(const QString & fn, int type, int linenumber, const QString & description); + void addDirectory(const QString &dir); + void removeDirectory(const QString &dir); +protected: + virtual void stdOut(const QString &line); + virtual void stdError(const QString &line); +private: + GenericProject *m_pro; + ProjectExplorer::BuildParserInterface *m_buildParser; + QSet m_openDirectories; +}; + +class MakeBuildStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget +{ + Q_OBJECT +public: + MakeBuildStepConfigWidget(MakeStep *makeStep); + virtual QString displayName() const; + virtual void init(const QString &buildConfiguration); +private slots: + void itemChanged(QListWidgetItem*); +private: + QString m_buildConfiguration; + MakeStep * m_makeStep; + QListWidget *m_targetsList; +}; + +class MakeBuildStepFactory : public ProjectExplorer::IBuildStepFactory +{ + virtual bool canCreate(const QString &name) const; + virtual ProjectExplorer::BuildStep *create(ProjectExplorer::Project *pro, const QString &name) const; + virtual QStringList canCreateForProject(ProjectExplorer::Project *pro) const; + virtual QString displayNameForName(const QString &name) const; +}; + +} +} + +#endif // MAKESTEP_H diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index dcd7b09bf7a..0b312f589c0 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -28,7 +28,8 @@ SUBDIRS = plugin_coreplugin \ plugin_cmakeprojectmanager \ plugin_fakevim \ plugin_designer \ - plugin_resourceeditor + plugin_resourceeditor \ + plugin_genericprojectmanager plugin_coreplugin.subdir = coreplugin @@ -148,3 +149,10 @@ plugin_cmakeprojectmanager.depends += plugin_projectexplorer plugin_cmakeprojectmanager.depends += plugin_cpptools plugin_cmakeprojectmanager.depends += plugin_cppeditor plugin_cmakeprojectmanager.depends += plugin_help + +plugin_genericprojectmanager.subdir = genericprojectmanager +plugin_genericprojectmanager.depends = plugin_texteditor +plugin_genericprojectmanager.depends += plugin_projectexplorer +plugin_genericprojectmanager.depends += plugin_cpptools +plugin_genericprojectmanager.depends += plugin_cppeditor +plugin_genericprojectmanager.depends += plugin_help