diff options
Diffstat (limited to 'src/plugins/generator/visualstudio')
61 files changed, 208 insertions, 3918 deletions
diff --git a/src/plugins/generator/visualstudio/CMakeLists.txt b/src/plugins/generator/visualstudio/CMakeLists.txt new file mode 100644 index 000000000..01d0abbfa --- /dev/null +++ b/src/plugins/generator/visualstudio/CMakeLists.txt @@ -0,0 +1,25 @@ +set(SOURCES + msbuildfiltersproject.cpp + msbuildfiltersproject.h + msbuildqbsgenerateproject.cpp + msbuildqbsgenerateproject.h + msbuildqbsproductproject.cpp + msbuildqbsproductproject.h + msbuildsharedsolutionpropertiesproject.cpp + msbuildsharedsolutionpropertiesproject.h + msbuildsolutionpropertiesproject.cpp + msbuildsolutionpropertiesproject.h + msbuildtargetproject.cpp + msbuildtargetproject.h + msbuildutils.h + visualstudiogenerator.cpp + visualstudiogenerator.h + visualstudioguidpool.cpp + visualstudioguidpool.h + visualstudiogeneratorplugin.cpp + ) + +add_qbs_plugin(visualstudiogenerator + DEPENDS qbscore qbsmsbuild qbsjson + SOURCES ${SOURCES} + ) diff --git a/src/plugins/generator/visualstudio/io/msbuildprojectwriter.cpp b/src/plugins/generator/visualstudio/io/msbuildprojectwriter.cpp deleted file mode 100644 index 12fbe2da5..000000000 --- a/src/plugins/generator/visualstudio/io/msbuildprojectwriter.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildprojectwriter.h" - -#include "../msbuild/imsbuildnodevisitor.h" -#include "../msbuild/msbuildimport.h" -#include "../msbuild/msbuildimportgroup.h" -#include "../msbuild/msbuilditem.h" -#include "../msbuild/msbuilditemdefinitiongroup.h" -#include "../msbuild/msbuilditemgroup.h" -#include "../msbuild/msbuilditemmetadata.h" -#include "../msbuild/msbuildproject.h" -#include "../msbuild/msbuildproperty.h" -#include "../msbuild/msbuildpropertygroup.h" - -#include <QtCore/qxmlstream.h> - -#include <memory> - -namespace qbs { - -static const QString kMSBuildSchemaURI = - QStringLiteral("http://schemas.microsoft.com/developer/msbuild/2003"); - -class MSBuildProjectWriterPrivate : public IMSBuildNodeVisitor -{ -public: - std::ostream *device = nullptr; - QByteArray buffer; - std::unique_ptr<QXmlStreamWriter> writer; - - void visitStart(const MSBuildImport *import) override; - void visitEnd(const MSBuildImport *import) override; - - void visitStart(const MSBuildImportGroup *importGroup) override; - void visitEnd(const MSBuildImportGroup *importGroup) override; - - void visitStart(const MSBuildItem *item) override; - void visitEnd(const MSBuildItem *item) override; - - void visitStart(const MSBuildItemDefinitionGroup *itemDefinitionGroup) override; - void visitEnd(const MSBuildItemDefinitionGroup *itemDefinitionGroup) override; - - void visitStart(const MSBuildItemGroup *itemGroup) override; - void visitEnd(const MSBuildItemGroup *itemGroup) override; - - void visitStart(const MSBuildItemMetadata *itemMetadata) override; - void visitEnd(const MSBuildItemMetadata *itemMetadata) override; - - void visitStart(const MSBuildProject *project) override; - void visitEnd(const MSBuildProject *project) override; - - void visitStart(const MSBuildProperty *property) override; - void visitEnd(const MSBuildProperty *property) override; - - void visitStart(const MSBuildPropertyGroup *propertyGroup) override; - void visitEnd(const MSBuildPropertyGroup *propertyGroup) override; -}; - -MSBuildProjectWriter::MSBuildProjectWriter(std::ostream *device) - : d(new MSBuildProjectWriterPrivate) -{ - d->device = device; - d->writer = std::make_unique<QXmlStreamWriter>(&d->buffer); - d->writer->setAutoFormatting(true); -} - -MSBuildProjectWriter::~MSBuildProjectWriter() -{ - delete d; -} - -bool MSBuildProjectWriter::write(const MSBuildProject *project) -{ - d->buffer.clear(); - d->writer->writeStartDocument(); - project->accept(d); - d->writer->writeEndDocument(); - if (d->writer->hasError()) - return false; - d->device->write(&*std::begin(d->buffer), d->buffer.size()); - return d->device->good(); -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildImport *import) -{ - writer->writeStartElement(QStringLiteral("Import")); - writer->writeAttribute(QStringLiteral("Project"), import->project()); - if (!import->condition().isEmpty()) - writer->writeAttribute(QStringLiteral("Condition"), import->condition()); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildImport *) -{ - writer->writeEndElement(); -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildImportGroup *importGroup) -{ - writer->writeStartElement(QStringLiteral("ImportGroup")); - if (!importGroup->condition().isEmpty()) - writer->writeAttribute(QStringLiteral("Condition"), importGroup->condition()); - if (!importGroup->label().isEmpty()) - writer->writeAttribute(QStringLiteral("Label"), importGroup->label()); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildImportGroup *) -{ - writer->writeEndElement(); -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildItem *item) -{ - writer->writeStartElement(item->name()); - if (!item->include().isEmpty()) - writer->writeAttribute(QStringLiteral("Include"), item->include()); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildItem *) -{ - writer->writeEndElement(); -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildItemDefinitionGroup *itemDefinitionGroup) -{ - writer->writeStartElement(QStringLiteral("ItemDefinitionGroup")); - if (!itemDefinitionGroup->condition().isEmpty()) - writer->writeAttribute(QStringLiteral("Condition"), itemDefinitionGroup->condition()); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildItemDefinitionGroup *) -{ - writer->writeEndElement(); -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildItemGroup *itemGroup) -{ - writer->writeStartElement(QStringLiteral("ItemGroup")); - if (!itemGroup->condition().isEmpty()) - writer->writeAttribute(QStringLiteral("Condition"), itemGroup->condition()); - if (!itemGroup->label().isEmpty()) - writer->writeAttribute(QStringLiteral("Label"), itemGroup->label()); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildItemGroup *) -{ - writer->writeEndElement(); -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildItemMetadata *itemMetadata) -{ - QString stringValue; - if (itemMetadata->value().type() == QVariant::Bool) { - stringValue = itemMetadata->value().toBool() - ? QStringLiteral("True") - : QStringLiteral("False"); - } else { - stringValue = itemMetadata->value().toString(); - } - writer->writeTextElement(itemMetadata->name(), stringValue); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildItemMetadata *) -{ -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildProject *project) -{ - writer->writeStartElement(QStringLiteral("Project")); - if (!project->defaultTargets().isEmpty()) - writer->writeAttribute(QStringLiteral("DefaultTargets"), project->defaultTargets()); - if (!project->toolsVersion().isEmpty()) - writer->writeAttribute(QStringLiteral("ToolsVersion"), project->toolsVersion()); - writer->writeAttribute(QStringLiteral("xmlns"), kMSBuildSchemaURI); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildProject *) -{ - writer->writeEndElement(); -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildProperty *property) -{ - QString stringValue; - if (property->value().type() == QVariant::Bool) - stringValue = property->value().toBool() ? QStringLiteral("True") : QStringLiteral("False"); - else - stringValue = property->value().toString(); - writer->writeTextElement(property->name(), stringValue); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildProperty *) -{ -} - -void MSBuildProjectWriterPrivate::visitStart(const MSBuildPropertyGroup *propertyGroup) -{ - writer->writeStartElement(QStringLiteral("PropertyGroup")); - if (!propertyGroup->condition().isEmpty()) - writer->writeAttribute(QStringLiteral("Condition"), propertyGroup->condition()); - if (!propertyGroup->label().isEmpty()) - writer->writeAttribute(QStringLiteral("Label"), propertyGroup->label()); -} - -void MSBuildProjectWriterPrivate::visitEnd(const MSBuildPropertyGroup *) -{ - writer->writeEndElement(); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/io/msbuildprojectwriter.h b/src/plugins/generator/visualstudio/io/msbuildprojectwriter.h deleted file mode 100644 index cfe6beb7b..000000000 --- a/src/plugins/generator/visualstudio/io/msbuildprojectwriter.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDPROJECTWRITER_H -#define MSBUILDPROJECTWRITER_H - -#include <ostream> - -#include <QtCore/qglobal.h> - -namespace qbs { - -class MSBuildProject; -class MSBuildProjectWriterPrivate; - -class MSBuildProjectWriter -{ - Q_DISABLE_COPY(MSBuildProjectWriter) -public: - explicit MSBuildProjectWriter(std::ostream *device); - ~MSBuildProjectWriter(); - - bool write(const MSBuildProject *project); - -private: - MSBuildProjectWriterPrivate *d; -}; - -} // namespace qbs - -#endif // MSBUILDPROJECTWRITER_H diff --git a/src/plugins/generator/visualstudio/io/visualstudiosolutionwriter.cpp b/src/plugins/generator/visualstudio/io/visualstudiosolutionwriter.cpp deleted file mode 100644 index 625489ac6..000000000 --- a/src/plugins/generator/visualstudio/io/visualstudiosolutionwriter.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "visualstudiosolutionwriter.h" - -#include "../solution/visualstudiosolutionfileproject.h" -#include "../solution/visualstudiosolutionfolderproject.h" -#include "../solution/visualstudiosolutionglobalsection.h" -#include "../solution/visualstudiosolution.h" - -#include <tools/hostosinfo.h> -#include <tools/pathutils.h> -#include <tools/stlutils.h> -#include <tools/visualstudioversioninfo.h> - -#include <QtCore/qdir.h> -#include <QtCore/qfile.h> -#include <QtCore/qfileinfo.h> -#include <QtCore/quuid.h> - -#include <vector> - -namespace qbs { - -using namespace Internal; - -class VisualStudioSolutionWriterPrivate -{ -public: - std::ostream *device = nullptr; - std::string baseDir; -}; - -VisualStudioSolutionWriter::VisualStudioSolutionWriter(std::ostream *device) - : d(new VisualStudioSolutionWriterPrivate) -{ - d->device = device; -} - -VisualStudioSolutionWriter::~VisualStudioSolutionWriter() = default; - -std::string VisualStudioSolutionWriter::projectBaseDirectory() const -{ - return d->baseDir; -} - -void VisualStudioSolutionWriter::setProjectBaseDirectory(const std::string &dir) -{ - d->baseDir = dir; -} - -bool VisualStudioSolutionWriter::write(const VisualStudioSolution *solution) -{ - auto &out = *d->device; - out << u8"Microsoft Visual Studio Solution File, Format Version " - << solution->versionInfo().solutionVersion().toStdString() - << u8"\n# Visual Studio " - << solution->versionInfo().version().majorVersion() - << u8"\n"; - - const auto fileProjects = solution->fileProjects(); - for (const auto &project : fileProjects) { - auto projectFilePath = project->filePath().toStdString(); - - // Try to make the project file path relative to the - // solution file path if we're writing to a file device - if (!d->baseDir.empty()) { - const QDir solutionDir(QString::fromStdString(d->baseDir)); - projectFilePath = Internal::PathUtils::toNativeSeparators( - solutionDir.relativeFilePath(QString::fromStdString(projectFilePath)), - Internal::HostOsInfo::HostOsWindows).toStdString(); - } - - out << u8"Project(\"" - << project->projectTypeGuid().toString().toStdString() - << u8"\") = \"" - << QFileInfo(QString::fromStdString(projectFilePath)).baseName().toStdString() - << u8"\", \"" - << projectFilePath - << u8"\", \"" - << project->guid().toString().toStdString() - << u8"\"\n"; - - const auto dependencies = solution->dependencies(project); - if (!dependencies.empty()) { - out << u8"\tProjectSection(ProjectDependencies) = postProject\n"; - - for (const auto &dependency : dependencies) - out << u8"\t\t" - << dependency->guid().toString().toStdString() - << u8" = " - << dependency->guid().toString().toStdString() - << u8"\n"; - - out << u8"\tEndProjectSection\n"; - } - - out << u8"EndProject\n"; - } - - const auto folderProjects = solution->folderProjects(); - for (const auto &project : folderProjects) { - out << u8"Project(\"" - << project->projectTypeGuid().toString().toStdString() - << u8"\") = \"" - << project->name().toStdString() - << u8"\", \"" - << project->name().toStdString() - << u8"\", \"" - << project->guid().toString().toStdString() - << u8"\"\n"; - - out << u8"EndProject\n"; - } - - out << u8"Global\n"; - - const auto globalSections = solution->globalSections(); - for (const auto &globalSection : globalSections) { - out << u8"\tGlobalSection(" - << globalSection->name().toStdString() - << u8") = " - << (globalSection->isPost() ? u8"postSolution" : u8"preSolution") - << u8"\n"; - for (const auto &property : globalSection->properties()) - out << u8"\t\t" - << property.first.toStdString() - << u8" = " - << property.second.toStdString() - << u8"\n"; - - out << u8"\tEndGlobalSection\n"; - } - - out << u8"EndGlobal\n"; - - return out.good(); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/io/visualstudiosolutionwriter.h b/src/plugins/generator/visualstudio/io/visualstudiosolutionwriter.h deleted file mode 100644 index 62ab45ead..000000000 --- a/src/plugins/generator/visualstudio/io/visualstudiosolutionwriter.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef VISUALSTUDIOSOLUTIONWRITER_H -#define VISUALSTUDIOSOLUTIONWRITER_H - -#include <memory> -#include <ostream> -#include <string> - -#include <QtCore/qglobal.h> - -namespace qbs { - -namespace Internal { class VisualStudioVersionInfo; } - -class VisualStudioSolution; -class VisualStudioSolutionWriterPrivate; - -class VisualStudioSolutionWriter -{ - Q_DISABLE_COPY(VisualStudioSolutionWriter) -public: - explicit VisualStudioSolutionWriter(std::ostream *device); - ~VisualStudioSolutionWriter(); - - std::string projectBaseDirectory() const; - void setProjectBaseDirectory(const std::string &dir); - - bool write(const VisualStudioSolution *solution); - -private: - void addDefaultGlobalSections(); - - std::unique_ptr<VisualStudioSolutionWriterPrivate> d; -}; - -} // namespace qbs - -#endif // VISUALSTUDIOSOLUTIONWRITER_H diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.cpp b/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.cpp deleted file mode 100644 index 81078ecb9..000000000 --- a/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "imsbuildgroup.h" -#include "msbuildproject.h" - -namespace qbs { - -class IMSBuildGroupPrivate -{ -public: - QString condition; -}; - -IMSBuildGroup::IMSBuildGroup(MSBuildProject *parent) - : QObject(parent) - , d(new IMSBuildGroupPrivate) -{ -} - -IMSBuildGroup::~IMSBuildGroup() = default; - -QString IMSBuildGroup::condition() const -{ - return d->condition; -} - -void IMSBuildGroup::setCondition(const QString &condition) -{ - d->condition = condition; -} - -IMSBuildItemGroup::IMSBuildItemGroup(MSBuildProject *parent) - : IMSBuildGroup(parent) -{ -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.h b/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.h deleted file mode 100644 index 3d9115643..000000000 --- a/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef IMSBUILDGROUP_H -#define IMSBUILDGROUP_H - -#include <QtCore/qobject.h> - -#include <memory> - -namespace qbs { - -class MSBuildProject; -class IMSBuildGroupPrivate; - -class IMSBuildGroup : public QObject -{ - Q_OBJECT -public: - explicit IMSBuildGroup(MSBuildProject *parent = nullptr); - ~IMSBuildGroup() override; - - QString condition() const; - void setCondition(const QString &condition); - -private: - std::unique_ptr<IMSBuildGroupPrivate> d; -}; - -class IMSBuildItemGroup : public IMSBuildGroup -{ - Q_OBJECT -public: - explicit IMSBuildItemGroup(MSBuildProject *parent = nullptr); -}; - -} // namespace qbs - -#endif // IMSBUILDGROUP_H diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildnode.cpp b/src/plugins/generator/visualstudio/msbuild/imsbuildnode.cpp deleted file mode 100644 index f563f7b07..000000000 --- a/src/plugins/generator/visualstudio/msbuild/imsbuildnode.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "imsbuildnode.h" - -namespace qbs { - -IMSBuildNode::~IMSBuildNode() = default; - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildnode.h b/src/plugins/generator/visualstudio/msbuild/imsbuildnode.h deleted file mode 100644 index 67fb10081..000000000 --- a/src/plugins/generator/visualstudio/msbuild/imsbuildnode.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef IMSBUILDNODE_H -#define IMSBUILDNODE_H - -namespace qbs { - -class IMSBuildNodeVisitor; - -class IMSBuildNode -{ -public: - virtual ~IMSBuildNode(); - virtual void accept(IMSBuildNodeVisitor *visitor) const = 0; -}; - -} // namespace qbs - -#endif // IMSBUILDNODE_H diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildnodevisitor.h b/src/plugins/generator/visualstudio/msbuild/imsbuildnodevisitor.h deleted file mode 100644 index 84239d648..000000000 --- a/src/plugins/generator/visualstudio/msbuild/imsbuildnodevisitor.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef IMSBUILDNODEVISITOR_H -#define IMSBUILDNODEVISITOR_H - -namespace qbs { - -class MSBuildImport; -class MSBuildImportGroup; -class MSBuildItem; -class MSBuildItemDefinitionGroup; -class MSBuildItemGroup; -class MSBuildItemMetadata; -class MSBuildProject; -class MSBuildProperty; -class MSBuildPropertyGroup; - -class IMSBuildNodeVisitor -{ -public: - virtual ~IMSBuildNodeVisitor() = default; - - virtual void visitStart(const MSBuildImport *import) = 0; - virtual void visitEnd(const MSBuildImport *import) = 0; - - virtual void visitStart(const MSBuildImportGroup *importGroup) = 0; - virtual void visitEnd(const MSBuildImportGroup *importGroup) = 0; - - virtual void visitStart(const MSBuildItem *item) = 0; - virtual void visitEnd(const MSBuildItem *item) = 0; - - virtual void visitStart(const MSBuildItemDefinitionGroup *itemDefinitionGroup) = 0; - virtual void visitEnd(const MSBuildItemDefinitionGroup *itemDefinitionGroup) = 0; - - virtual void visitStart(const MSBuildItemGroup *itemGroup) = 0; - virtual void visitEnd(const MSBuildItemGroup *itemGroup) = 0; - - virtual void visitStart(const MSBuildItemMetadata *itemMetadata) = 0; - virtual void visitEnd(const MSBuildItemMetadata *itemMetadata) = 0; - - virtual void visitStart(const MSBuildProject *project) = 0; - virtual void visitEnd(const MSBuildProject *project) = 0; - - virtual void visitStart(const MSBuildProperty *property) = 0; - virtual void visitEnd(const MSBuildProperty *property) = 0; - - virtual void visitStart(const MSBuildPropertyGroup *propertyGroup) = 0; - virtual void visitEnd(const MSBuildPropertyGroup *propertyGroup) = 0; -}; - -} // namespace qbs - -#endif // IMSBUILDNODEVISITOR_H diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.cpp b/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.cpp deleted file mode 100644 index be18f1a5b..000000000 --- a/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "imsbuildproperty.h" - -namespace qbs { - -class IMSBuildPropertyPrivate -{ -public: - QString condition; - QString name; - QVariant value; -}; - -IMSBuildProperty::IMSBuildProperty(QObject *parent) - : QObject(parent) - , d(new IMSBuildPropertyPrivate) -{ -} - -IMSBuildProperty::~IMSBuildProperty() = default; - -QString IMSBuildProperty::condition() const -{ - return d->condition; -} - -void IMSBuildProperty::setCondition(const QString &condition) -{ - d->condition = condition; -} - -QString IMSBuildProperty::name() const -{ - return d->name; -} - -void IMSBuildProperty::setName(const QString &name) -{ - d->name = name; -} - -QVariant IMSBuildProperty::value() const -{ - return d->value; -} - -void IMSBuildProperty::setValue(const QVariant &value) -{ - d->value = value; -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.h b/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.h deleted file mode 100644 index 13f26f070..000000000 --- a/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef IMSBUILDPROPERTY_H -#define IMSBUILDPROPERTY_H - -#include <QtCore/qobject.h> -#include <QtCore/qvariant.h> - -#include <memory> - -namespace qbs { - -class IMSBuildPropertyPrivate; - -class IMSBuildProperty : public QObject -{ - Q_OBJECT -protected: - explicit IMSBuildProperty(QObject *parent = nullptr); - -public: - ~IMSBuildProperty() override; - - QString condition() const; - void setCondition(const QString &condition); - - QString name() const; - void setName(const QString &name); - - QVariant value() const; - void setValue(const QVariant &value); - -private: - std::unique_ptr<IMSBuildPropertyPrivate> d; -}; - -} // namespace qbs - -#endif // IMSBUILDPROPERTY_H diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.cpp b/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.cpp deleted file mode 100644 index d8a587454..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildclcompile.h" - -namespace qbs { - -static const QString MSBuildClCompileItemName = QStringLiteral("ClCompile"); - -MSBuildClCompile::MSBuildClCompile(IMSBuildItemGroup *parent) - : MSBuildFileItem(MSBuildClCompileItemName, parent) -{ -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.h deleted file mode 100644 index 8c326a036..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDCLCOMPILE_H -#define MSBUILDCLCOMPILE_H - -#include "msbuildfileitem.h" - -namespace qbs { - -class MSBuildClCompile : public MSBuildFileItem -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildClCompile) -public: - explicit MSBuildClCompile(IMSBuildItemGroup *parent = nullptr); -}; - -} // namespace qbs - -#endif // MSBUILDCLCOMPILE_H diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.cpp b/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.cpp deleted file mode 100644 index d9c61bece..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildclinclude.h" - -namespace qbs { - -static const QString MSBuildClIncludeItemName = QStringLiteral("ClInclude"); - -MSBuildClInclude::MSBuildClInclude(IMSBuildItemGroup *parent) - : MSBuildFileItem(MSBuildClIncludeItemName, parent) -{ -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.h deleted file mode 100644 index 77d8e0ff2..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDCLINCLUDE_H -#define MSBUILDCLINCLUDE_H - -#include "msbuildfileitem.h" - -namespace qbs { - -class MSBuildClInclude : public MSBuildFileItem -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildClInclude) -public: - explicit MSBuildClInclude(IMSBuildItemGroup *parent = nullptr); -}; - -} // namespace qbs - -#endif // MSBUILDCLINCLUDE_H diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.cpp b/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.cpp deleted file mode 100644 index 4cbb01d04..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildfileitem.h" - -#include <memory> -#include "../msbuilditemmetadata.h" - -namespace qbs { - -class MSBuildFileItemPrivate -{ -public: - std::unique_ptr<MSBuildItemMetadata> filter; -}; - -MSBuildFileItem::MSBuildFileItem(const QString &name, IMSBuildItemGroup *parent) - : MSBuildItem(name, parent) - , d(new MSBuildFileItemPrivate) -{ - d->filter = std::make_unique<MSBuildItemMetadata>(QStringLiteral("Filter"), QVariant()); -} - -MSBuildFileItem::~MSBuildFileItem() = default; - -QString MSBuildFileItem::filePath() const -{ - return include(); -} - -void MSBuildFileItem::setFilePath(const QString &filePath) -{ - setInclude(filePath); -} - -QString MSBuildFileItem::filterName() const -{ - return d->filter->value().toString(); -} - -void MSBuildFileItem::setFilterName(const QString &filterName) -{ - d->filter->setValue(filterName); - d->filter->setParent(!filterName.isEmpty() ? this : nullptr); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.h deleted file mode 100644 index f34ac119a..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDFILEITEM_H -#define MSBUILDFILEITEM_H - -#include "../msbuilditem.h" - -namespace qbs { - -class MSBuildFileItemPrivate; - -class MSBuildFileItem : public MSBuildItem -{ -public: - ~MSBuildFileItem() override; - - QString filePath() const; - void setFilePath(const QString &filePath); - - QString filterName() const; - void setFilterName(const QString &filterName); - -protected: - explicit MSBuildFileItem(const QString &name, IMSBuildItemGroup *parent = nullptr); - -private: - std::unique_ptr<MSBuildFileItemPrivate> d; -}; - -} // namespace qbs - -#endif // MSBUILDFILEITEM_H diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.cpp b/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.cpp deleted file mode 100644 index 0b9c2c86a..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildfilter.h" -#include "../msbuilditemmetadata.h" -#include <tools/hostosinfo.h> -#include <QtCore/quuid.h> - -namespace qbs { - -static const QString MSBuildFilterItemName = QStringLiteral("Filter"); - -class MSBuildFilterPrivate -{ -public: - QUuid identifier; - QList<QString> extensions; - bool parseFiles = true; - bool sourceControlFiles = true; - MSBuildItemMetadata *identifierMetadata = nullptr; - MSBuildItemMetadata *extensionsMetadata = nullptr; -}; - -MSBuildFilter::MSBuildFilter(IMSBuildItemGroup *parent) - : MSBuildItem(MSBuildFilterItemName, parent) - , d(new MSBuildFilterPrivate) -{ - d->identifierMetadata = new MSBuildItemMetadata(QStringLiteral("UniqueIdentifier"), - QVariant(), this); - d->extensionsMetadata = new MSBuildItemMetadata(QStringLiteral("Extensions"), - QVariant(), this); - setIdentifier(QUuid::createUuid()); -} - -MSBuildFilter::MSBuildFilter(const QString &name, - const QList<QString> &extensions, - IMSBuildItemGroup *parent) - : MSBuildFilter(parent) -{ - setInclude(name); - setExtensions(extensions); -} - -MSBuildFilter::~MSBuildFilter() = default; - -QUuid MSBuildFilter::identifier() const -{ - return d->identifier; -} - -void MSBuildFilter::setIdentifier(const QUuid &identifier) -{ - d->identifier = identifier; - d->identifierMetadata->setValue(identifier.toString()); -} - -QList<QString> MSBuildFilter::extensions() const -{ - return d->extensions; -} - -void MSBuildFilter::setExtensions(const QList<QString> &extensions) -{ - d->extensions = extensions; - d->extensionsMetadata->setValue(QStringList(extensions).join( - Internal::HostOsInfo::pathListSeparator( - Internal::HostOsInfo::HostOsWindows))); -} - -bool MSBuildFilter::parseFiles() const -{ - return d->parseFiles; -} - -void MSBuildFilter::setParseFiles(bool parseFiles) -{ - d->parseFiles = parseFiles; -} - -bool MSBuildFilter::sourceControlFiles() const -{ - return d->sourceControlFiles; -} - -void MSBuildFilter::setSourceControlFiles(bool sourceControlFiles) -{ - d->sourceControlFiles = sourceControlFiles; -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.h deleted file mode 100644 index fb977f1cc..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDFILTER_H -#define MSBUILDFILTER_H - -#include "../msbuilditem.h" - -namespace qbs { - -class IMSBuildItemGroup; -class MSBuildFilterPrivate; - -class MSBuildFilter : public MSBuildItem -{ - Q_OBJECT -public: - explicit MSBuildFilter(IMSBuildItemGroup *parent = nullptr); - MSBuildFilter(const QString &name, const QList<QString> &extensions, - IMSBuildItemGroup *parent = nullptr); - ~MSBuildFilter() override; - - QUuid identifier() const; - void setIdentifier(const QUuid &identifier); - - QList<QString> extensions() const; - void setExtensions(const QList<QString> &extensions); - - bool parseFiles() const; - void setParseFiles(bool parseFiles); - - bool sourceControlFiles() const; - void setSourceControlFiles(bool sourceControlFiles); - -private: - std::unique_ptr<MSBuildFilterPrivate> d; -}; - -} // namespace qbs - -#endif // MSBUILDFILTER_H diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.cpp b/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.cpp deleted file mode 100644 index cae1a63a3..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildlink.h" - -#include "../imsbuildgroup.h" - -namespace qbs { - -static const QString MSBuildLinkItemName = QStringLiteral("Link"); - -MSBuildLink::MSBuildLink(IMSBuildItemGroup *parent) - : MSBuildItem(MSBuildLinkItemName, parent) -{ -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.h deleted file mode 100644 index 3d7a3ab44..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDLINK_H -#define MSBUILDLINK_H - -#include "../msbuilditem.h" - -namespace qbs { - -class IMSBuildItemGroup; - -class MSBuildLink : public MSBuildItem -{ - Q_OBJECT -public: - explicit MSBuildLink(IMSBuildItemGroup *parent = nullptr); -}; - -} // namespace qbs - -#endif // MSBUILDLINK_H diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.cpp b/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.cpp deleted file mode 100644 index a590c6e9f..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildnone.h" - -namespace qbs { - -MSBuildNone::MSBuildNone(IMSBuildItemGroup *parent) - : MSBuildFileItem(QStringLiteral("None"), parent) -{ -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.h deleted file mode 100644 index 3779da04f..000000000 --- a/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDNONE_H -#define MSBUILDNONE_H - -#include "msbuildfileitem.h" - -namespace qbs { - -class MSBuildNone : public MSBuildFileItem -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildNone) -public: - explicit MSBuildNone(IMSBuildItemGroup *parent = nullptr); -}; - -} // namespace qbs - -#endif // MSBUILDNONE_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildimport.cpp b/src/plugins/generator/visualstudio/msbuild/msbuildimport.cpp deleted file mode 100644 index 000af4496..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildimport.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildimport.h" - -#include "imsbuildnodevisitor.h" -#include "msbuildimportgroup.h" -#include "msbuildproject.h" - -namespace qbs { - -class MSBuildImportPrivate -{ -public: - QString project; - QString condition; -}; - -MSBuildImport::MSBuildImport(MSBuildProject *parent) - : QObject(parent) - , d(new MSBuildImportPrivate) -{ -} - -MSBuildImport::MSBuildImport(MSBuildImportGroup *parent) - : QObject(parent) - , d(new MSBuildImportPrivate) -{ -} - -MSBuildImport::~MSBuildImport() = default; - -QString MSBuildImport::project() const -{ - return d->project; -} - -void MSBuildImport::setProject(const QString &project) -{ - d->project = project; -} - -QString MSBuildImport::condition() const -{ - return d->condition; -} - -void MSBuildImport::setCondition(const QString &condition) -{ - d->condition = condition; -} - -void MSBuildImport::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildimport.h b/src/plugins/generator/visualstudio/msbuild/msbuildimport.h deleted file mode 100644 index 65f9bc056..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildimport.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef MSBUILDIMPORT_H -#define MSBUILDIMPORT_H - -#include <QtCore/qobject.h> -#include "imsbuildnode.h" - -#include <memory> - -namespace qbs { - -class MSBuildImportGroup; -class MSBuildImportPrivate; -class MSBuildProject; - -/*! - * \brief The MSBuildImport class represents an MSBuild Import element. - * - * https://msdn.microsoft.com/en-us/library/92x05xfs.aspx - */ -class MSBuildImport : public QObject, public IMSBuildNode -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildImport) -public: - explicit MSBuildImport(MSBuildProject *parent); - explicit MSBuildImport(MSBuildImportGroup *parent); - ~MSBuildImport() override; - - QString project() const; - void setProject(const QString &project); - - QString condition() const; - void setCondition(const QString &condition); - - void accept(IMSBuildNodeVisitor *visitor) const override; - -private: - std::unique_ptr<MSBuildImportPrivate> d; -}; - -} // namespace qbs - -#endif // MSBUILDIMPORT_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.cpp b/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.cpp deleted file mode 100644 index d84d81783..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildimportgroup.h" - -#include "imsbuildnodevisitor.h" -#include "msbuildimport.h" - -namespace qbs { - -class MSBuildImportGroupPrivate -{ -public: - QString label; -}; - -MSBuildImportGroup::MSBuildImportGroup(MSBuildProject *parent) - : IMSBuildGroup(parent) - , d(new MSBuildImportGroupPrivate) -{ -} - -MSBuildImportGroup::~MSBuildImportGroup() = default; - -QString MSBuildImportGroup::label() const -{ - return d->label; -} - -void MSBuildImportGroup::setLabel(const QString &label) -{ - d->label = label; -} - -void MSBuildImportGroup::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - - for (const auto &child : children()) { - if (const auto import = qobject_cast<const MSBuildImport *>(child)) - import->accept(visitor); - } - - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.h b/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.h deleted file mode 100644 index a21cb5a54..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDIMPORTGROUP_H -#define MSBUILDIMPORTGROUP_H - -#include "imsbuildgroup.h" -#include "imsbuildnode.h" - -namespace qbs { - -class MSBuildProject; -class MSBuildImportGroupPrivate; - -/*! - * \brief The MSBuildImportGroup class represents an MSBuild ImportGroup element. - * - * https://msdn.microsoft.com/en-us/library/ff606262.aspx - */ -class MSBuildImportGroup : public IMSBuildGroup, public IMSBuildNode -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildImportGroup) -public: - explicit MSBuildImportGroup(MSBuildProject *parent = nullptr); - ~MSBuildImportGroup() override; - - QString label() const; - void setLabel(const QString &label); - - void accept(IMSBuildNodeVisitor *visitor) const override; - -private: - std::unique_ptr<MSBuildImportGroupPrivate> d; -}; - -} // namespace qbs - -#endif // MSBUILDIMPORTGROUP_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditem.cpp b/src/plugins/generator/visualstudio/msbuild/msbuilditem.cpp deleted file mode 100644 index ed181a453..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuilditem.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuilditem.h" - -#include "imsbuildnodevisitor.h" -#include "msbuilditemdefinitiongroup.h" -#include "msbuilditemgroup.h" -#include "msbuilditemmetadata.h" - -namespace qbs { - -class MSBuildItemPrivate -{ -public: - QString name = QStringLiteral("Item"); - QString include; -}; - -MSBuildItem::MSBuildItem(const QString &name, IMSBuildItemGroup *parent) - : QObject(parent) - , d(new MSBuildItemPrivate) -{ - setName(name); -} - -MSBuildItem::~MSBuildItem() = default; - -QString MSBuildItem::name() const -{ - return d->name; -} - -void MSBuildItem::setName(const QString &name) -{ - d->name = name; -} - -QString MSBuildItem::include() const -{ - return d->include; -} - -void MSBuildItem::setInclude(const QString &include) -{ - d->include = include; -} - -void MSBuildItem::appendProperty(const QString &name, const QVariant &value) -{ - new MSBuildItemMetadata(name, value, this); -} - -void MSBuildItem::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - - for (const auto &child : children()) { - if (const auto itemMetadata = qobject_cast<const MSBuildItemMetadata *>(child)) - itemMetadata->accept(visitor); - } - - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditem.h b/src/plugins/generator/visualstudio/msbuild/msbuilditem.h deleted file mode 100644 index d01a357a2..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuilditem.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDITEM_H -#define MSBUILDITEM_H - -#include <QtCore/qobject.h> -#include "imsbuildnode.h" - -#include <memory> - -namespace qbs { - -class IMSBuildItemGroup; -class MSBuildItemDefinitionGroup; -class MSBuildItemGroup; -class MSBuildItemPrivate; - -/*! - * \brief The MSBuildItem class represents an MSBuild Item element. - * - * https://msdn.microsoft.com/en-us/library/ms164283.aspx - */ -class MSBuildItem : public QObject, public IMSBuildNode -{ - Q_OBJECT -public: - explicit MSBuildItem(const QString &name, IMSBuildItemGroup *parent = nullptr); - ~MSBuildItem() override; - - QString name() const; - void setName(const QString &name); - - QString include() const; - void setInclude(const QString &include); - - void appendProperty(const QString &name, const QVariant &value); - - void accept(IMSBuildNodeVisitor *visitor) const override; - -private: - std::unique_ptr<MSBuildItemPrivate> d; -}; - -} // namespace qbs - -#endif // MSBUILDITEM_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.cpp b/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.cpp deleted file mode 100644 index 1479577c5..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuilditemdefinitiongroup.h" - -#include "imsbuildnodevisitor.h" -#include "msbuilditem.h" - -namespace qbs { - -MSBuildItemDefinitionGroup::MSBuildItemDefinitionGroup(MSBuildProject *parent) - : IMSBuildItemGroup(parent) -{ -} - -MSBuildItemDefinitionGroup::~MSBuildItemDefinitionGroup() = default; - -void MSBuildItemDefinitionGroup::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - - for (const auto &child : children()) { - if (const auto item = qobject_cast<MSBuildItem *>(child)) - item->accept(visitor); - } - - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.h b/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.h deleted file mode 100644 index 3c324699d..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDITEMDEFINITIONGROUP_H -#define MSBUILDITEMDEFINITIONGROUP_H - -#include "imsbuildgroup.h" -#include "imsbuildnode.h" - -namespace qbs { - -class MSBuildProject; -class MSBuildItemDefinitionGroupPrivate; - -/*! - * \brief The MSBuildItemDefinitionGroup class represents an MSBuild ItemDefinitionGroup element. - * - * https://msdn.microsoft.com/en-us/library/bb629392.aspx - */ -class MSBuildItemDefinitionGroup : public IMSBuildItemGroup, public IMSBuildNode -{ - Q_OBJECT -public: - explicit MSBuildItemDefinitionGroup(MSBuildProject *parent = nullptr); - ~MSBuildItemDefinitionGroup() override; - - void accept(IMSBuildNodeVisitor *visitor) const override; -}; - -} // namespace qbs - -#endif // MSBUILDITEMDEFINITIONGROUP_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.cpp b/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.cpp deleted file mode 100644 index 48f919709..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuilditemgroup.h" - -#include "imsbuildnodevisitor.h" -#include "msbuilditem.h" - -#include <memory> - -namespace qbs { - -class MSBuildItemGroupPrivate -{ -public: - QString label; -}; - -MSBuildItemGroup::MSBuildItemGroup(MSBuildProject *parent) - : IMSBuildItemGroup(parent) - , d(new MSBuildItemGroupPrivate) -{ -} - -MSBuildItemGroup::~MSBuildItemGroup() = default; - -QString MSBuildItemGroup::label() const -{ - return d->label; -} - -void MSBuildItemGroup::setLabel(const QString &label) -{ - d->label = label; -} - -void MSBuildItemGroup::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - - for (const auto &child : children()) { - if (const MSBuildItem *item = qobject_cast<MSBuildItem *>(child)) - item->accept(visitor); - } - - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.h b/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.h deleted file mode 100644 index bbbdb0e69..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDITEMGROUP_H -#define MSBUILDITEMGROUP_H - -#include "imsbuildgroup.h" -#include "imsbuildnode.h" - -#include <memory> - -namespace qbs { - -class MSBuildProject; -class MSBuildItemGroupPrivate; - -/*! - * \brief The MSBuildItemGroup class represents an MSBuild ItemGroup element. - * - * https://msdn.microsoft.com/en-us/library/646dk05y.aspx - */ -class MSBuildItemGroup : public IMSBuildItemGroup, public IMSBuildNode -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildItemGroup) -public: - explicit MSBuildItemGroup(MSBuildProject *parent = nullptr); - ~MSBuildItemGroup() override; - - QString label() const; - void setLabel(const QString &label); - - void accept(IMSBuildNodeVisitor *visitor) const override; - -private: - std::unique_ptr<MSBuildItemGroupPrivate> d; -}; - -} // namespace qbs - -#endif // MSBUILDITEMGROUP_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.cpp b/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.cpp deleted file mode 100644 index daaa4c6b3..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuilditemmetadata.h" - -#include "imsbuildnodevisitor.h" -#include "msbuilditem.h" - -namespace qbs { - -MSBuildItemMetadata::MSBuildItemMetadata(MSBuildItem *parent) - : IMSBuildProperty(parent) -{ -} - -MSBuildItemMetadata::MSBuildItemMetadata(const QString &name, const QVariant &value, - MSBuildItem *parent) - : MSBuildItemMetadata(parent) -{ - setName(name); - setValue(value); -} - -void MSBuildItemMetadata::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.h b/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.h deleted file mode 100644 index 09da2649c..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDITEMMETADATA_H -#define MSBUILDITEMMETADATA_H - -#include "imsbuildproperty.h" -#include "imsbuildnode.h" - -namespace qbs { - -class MSBuildItem; - -/*! - * \brief The MSBuildItemMetadata class represents an MSBuild ItemMetadata element. - * - * https://msdn.microsoft.com/en-us/library/ms164284.aspx - */ -class MSBuildItemMetadata : public IMSBuildProperty, public IMSBuildNode -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildItemMetadata) -public: - explicit MSBuildItemMetadata(MSBuildItem *parent = nullptr); - MSBuildItemMetadata(const QString &name, const QVariant &value = QVariant(), - MSBuildItem *parent = nullptr); - - void accept(IMSBuildNodeVisitor *visitor) const override; -}; - -} // namespace qbs - -#endif // MSBUILDITEMMETADATA_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildproject.cpp b/src/plugins/generator/visualstudio/msbuild/msbuildproject.cpp deleted file mode 100644 index 11b5b81ea..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildproject.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildproject.h" - -#include "imsbuildnodevisitor.h" -#include "msbuildimport.h" -#include "msbuildimportgroup.h" -#include "msbuilditemdefinitiongroup.h" -#include "msbuilditemgroup.h" -#include "msbuildpropertygroup.h" - -namespace qbs { - -class MSBuildProjectPrivate -{ -public: - QString defaultTargets; - QString toolsVersion; -}; - -MSBuildProject::MSBuildProject(QObject *parent) - : QObject(parent) - , d(new MSBuildProjectPrivate) -{ -} - -MSBuildProject::~MSBuildProject() = default; - -QString MSBuildProject::defaultTargets() const -{ - return d->defaultTargets; -} - -void MSBuildProject::setDefaultTargets(const QString &defaultTargets) -{ - d->defaultTargets = defaultTargets; -} - -QString MSBuildProject::toolsVersion() const -{ - return d->toolsVersion; -} - -void MSBuildProject::setToolsVersion(const QString &toolsVersion) -{ - d->toolsVersion = toolsVersion; -} - -void MSBuildProject::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - - for (const auto &child : children()) { - if (const auto node = qobject_cast<MSBuildImport *>(child)) - node->accept(visitor); - else if (const auto node = qobject_cast<MSBuildImportGroup *>(child)) - node->accept(visitor); - else if (const auto node = qobject_cast<MSBuildItemDefinitionGroup *>(child)) - node->accept(visitor); - else if (const auto node = qobject_cast<MSBuildItemGroup *>(child)) - node->accept(visitor); - else if (const auto node = qobject_cast<MSBuildPropertyGroup *>(child)) - node->accept(visitor); - } - - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildproject.h b/src/plugins/generator/visualstudio/msbuild/msbuildproject.h deleted file mode 100644 index 5281f615d..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildproject.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDPROJECT_H -#define MSBUILDPROJECT_H - -#include <QtCore/qobject.h> -#include "imsbuildnode.h" - -#include <memory> - -namespace qbs { - -class MSBuildProjectPrivate; - -/*! - * \brief The MSBuildProject class represents an MSBuild Project element. - * - * https://msdn.microsoft.com/en-us/library/bcxfsh87.aspx - */ -class MSBuildProject : public QObject, public IMSBuildNode -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildProject) -public: - explicit MSBuildProject(QObject *parent = nullptr); - ~MSBuildProject() override; - - QString defaultTargets() const; - void setDefaultTargets(const QString &defaultTargets); - - QString toolsVersion() const; - void setToolsVersion(const QString &toolsVersion); - - void accept(IMSBuildNodeVisitor *visitor) const override; - -private: - std::unique_ptr<MSBuildProjectPrivate> d; -}; - -} // namespace qbs - -#endif // MSBUILDPROJECT_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildproperty.cpp b/src/plugins/generator/visualstudio/msbuild/msbuildproperty.cpp deleted file mode 100644 index 410e2a694..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildproperty.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildproperty.h" - -#include "imsbuildnodevisitor.h" -#include "msbuildpropertygroup.h" - -namespace qbs { - -MSBuildProperty::MSBuildProperty(MSBuildPropertyGroup *parent) - : IMSBuildProperty(parent) -{ -} - -MSBuildProperty::MSBuildProperty(const QString &name, const QVariant &value, - MSBuildPropertyGroup *parent) - : MSBuildProperty(parent) -{ - setName(name); - setValue(value); -} - -void MSBuildProperty::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildproperty.h b/src/plugins/generator/visualstudio/msbuild/msbuildproperty.h deleted file mode 100644 index de2c52394..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildproperty.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDPROPERTY_H -#define MSBUILDPROPERTY_H - -#include "imsbuildproperty.h" -#include "imsbuildnode.h" - -namespace qbs { - -class MSBuildPropertyGroup; - -/*! - * \brief The MSBuildProperty class represents an MSBuild Property element. - * - * https://msdn.microsoft.com/en-us/library/ms164288.aspx - */ -class MSBuildProperty : public IMSBuildProperty, public IMSBuildNode -{ - Q_OBJECT -public: - explicit MSBuildProperty(MSBuildPropertyGroup *parent = nullptr); - MSBuildProperty(const QString &name, const QVariant &value = QVariant(), - MSBuildPropertyGroup *parent = nullptr); - - void accept(IMSBuildNodeVisitor *visitor) const override; -}; - -} // namespace qbs - -#endif // MSBUILDPROPERTY_H diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.cpp b/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.cpp deleted file mode 100644 index 5acb73dad..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "msbuildpropertygroup.h" - -#include "imsbuildnodevisitor.h" -#include "msbuildproperty.h" - -namespace qbs { - -class MSBuildPropertyGroupPrivate -{ -public: - QString condition; - QString label; -}; - -MSBuildPropertyGroup::MSBuildPropertyGroup(MSBuildProject *parent) - : IMSBuildGroup(parent) - , d(new MSBuildPropertyGroupPrivate) -{ -} - -MSBuildPropertyGroup::~MSBuildPropertyGroup() = default; - -QString MSBuildPropertyGroup::label() const -{ - return d->label; -} - -void MSBuildPropertyGroup::setLabel(const QString &label) -{ - d->label = label; -} - -void MSBuildPropertyGroup::appendProperty(const QString &name, const QVariant &value) -{ - new MSBuildProperty(name, value, this); -} - -void MSBuildPropertyGroup::accept(IMSBuildNodeVisitor *visitor) const -{ - visitor->visitStart(this); - - for (const auto &child : children()) { - if (const MSBuildProperty *property = qobject_cast<MSBuildProperty *>(child)) - property->accept(visitor); - } - - visitor->visitEnd(this); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.h b/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.h deleted file mode 100644 index 60bdb008e..000000000 --- a/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef MSBUILDPROPERTYGROUP_H -#define MSBUILDPROPERTYGROUP_H - -#include "imsbuildgroup.h" -#include "imsbuildnode.h" - -namespace qbs { - -class MSBuildProject; -class MSBuildPropertyGroupPrivate; - -/*! - * \brief The MSBuildPropertyGroup class represents an MSBuild PropertyGroup element. - * - * https://msdn.microsoft.com/en-us/library/t4w159bs.aspx - */ -class MSBuildPropertyGroup : public IMSBuildGroup, public IMSBuildNode -{ - Q_OBJECT - Q_DISABLE_COPY(MSBuildPropertyGroup) -public: - explicit MSBuildPropertyGroup(MSBuildProject *parent = nullptr); - ~MSBuildPropertyGroup() override; - - QString label() const; - void setLabel(const QString &label); - - void appendProperty(const QString &name, const QVariant &value); - - void accept(IMSBuildNodeVisitor *visitor) const override; - -private: - std::unique_ptr<MSBuildPropertyGroupPrivate> d; -}; - -} // namespace qbs - -#endif // MSBUILDPROPERTYGROUP_H diff --git a/src/plugins/generator/visualstudio/msbuildfiltersproject.cpp b/src/plugins/generator/visualstudio/msbuildfiltersproject.cpp index 1cd2573c3..127d6a438 100644 --- a/src/plugins/generator/visualstudio/msbuildfiltersproject.cpp +++ b/src/plugins/generator/visualstudio/msbuildfiltersproject.cpp @@ -45,110 +45,203 @@ namespace qbs { -static QStringList sourceFileExtensions() +namespace { + +const QStringList & sourceFileExtensions() { - return {QStringLiteral("c"), QStringLiteral("C"), QStringLiteral("cpp"), - QStringLiteral("cxx"), QStringLiteral("c++"), QStringLiteral("cc"), - QStringLiteral("cs"), QStringLiteral("def"), QStringLiteral("java"), - QStringLiteral("m"), QStringLiteral("mm")}; + static const QStringList EXTENSIONS{ + QStringLiteral("c"), + QStringLiteral("C"), + QStringLiteral("cpp"), + QStringLiteral("cxx"), + QStringLiteral("c++"), + QStringLiteral("cc"), + QStringLiteral("cs"), + QStringLiteral("def"), + QStringLiteral("java"), + QStringLiteral("m"), + QStringLiteral("mm")}; + + return EXTENSIONS; } -static QStringList headerFileExtensions() +const QStringList & headerFileExtensions() { - return {QStringLiteral("h"), QStringLiteral("H"), QStringLiteral("hpp"), - QStringLiteral("hxx"), QStringLiteral("h++")}; + static const QStringList EXTENSIONS{ + QStringLiteral("h"), + QStringLiteral("H"), + QStringLiteral("hpp"), + QStringLiteral("hxx"), + QStringLiteral("h++")}; + + return EXTENSIONS; } -static std::vector<MSBuildFilter *> defaultItemGroupFilters(IMSBuildItemGroup *parent = nullptr) +struct FilterInfo +{ + QString name; + QList<QString> extensions; + bool parseFiles{ true }; + bool sourceControlFiles{ true }; +}; + +const std::vector<FilterInfo> & getDefaultFilterInfo() { - const auto sourceFilter = new MSBuildFilter(QStringLiteral("Source Files"), sourceFileExtensions(), parent); - const auto headerFilter = new MSBuildFilter(QStringLiteral("Header Files"), headerFileExtensions(), parent); - - const auto formFilter = new MSBuildFilter(QStringLiteral("Form Files"), - QStringList() << QStringLiteral("ui"), parent); - const auto resourceFilter = new MSBuildFilter(QStringLiteral("Resource Files"), - QStringList() - << QStringLiteral("qrc") - << QStringLiteral("rc") - << QStringLiteral("*"), parent); - resourceFilter->setParseFiles(false); - const auto generatedFilter = new MSBuildFilter(QStringLiteral("Generated Files"), - QStringList() << QStringLiteral("moc"), parent); - generatedFilter->setSourceControlFiles(false); - const auto translationFilter = new MSBuildFilter(QStringLiteral("Translation Files"), - QStringList() << QStringLiteral("ts"), parent); - translationFilter->setParseFiles(false); - - return std::vector<MSBuildFilter *> { - sourceFilter, headerFilter, formFilter, resourceFilter, generatedFilter, translationFilter + static const std::vector<FilterInfo> INFOS { + {QStringLiteral("Source Files"), sourceFileExtensions()}, + {QStringLiteral("Header Files"), headerFileExtensions()}, + {QStringLiteral("Form Files"), QStringList() << QStringLiteral("ui")}, + {QStringLiteral("Resource Files"), QStringList() << QStringLiteral("qrc") << QStringLiteral("rc") << QStringLiteral("*"), false}, + {QStringLiteral("Generated Files"), QStringList() << QStringLiteral("moc"), true, false}, + {QStringLiteral("Translation Files"), QStringList() << QStringLiteral("ts"), false}, }; + + return INFOS; } -static bool matchesFilter(const MSBuildFilter *filter, const QString &filePath) +MSBuildFilter * makeBuildFilter(const FilterInfo &filterInfo, + MSBuildItemGroup *itemFiltersGroup) { - return filter->extensions().contains(QFileInfo(filePath).completeSuffix()); + const auto filter = new MSBuildFilter(filterInfo.name, filterInfo.extensions, itemFiltersGroup); + filter->appendProperty(QStringLiteral("ParseFiles"), filterInfo.parseFiles); + filter->appendProperty(QStringLiteral("SourceControlFiles"), filterInfo.sourceControlFiles); + return filter; } -MSBuildFiltersProject::MSBuildFiltersProject(const GeneratableProductData &product, - QObject *parent) - : MSBuildProject(parent) +bool matchesFilter(const FilterInfo &filterInfo, + const QString &filePath) { - // Normally this would be versionInfo.toolsVersion() but for some reason it seems - // filters projects are always v4.0 - setToolsVersion(QStringLiteral("4.0")); + return filterInfo.extensions.contains(QFileInfo(filePath).completeSuffix()); +} + +bool isHeaderFile(const QString &filePath) +{ + return headerFileExtensions().contains(QFileInfo(filePath).completeSuffix()); +} + +bool isSourceFile(const QString &filePath) +{ + return sourceFileExtensions().contains(QFileInfo(filePath).completeSuffix()); +} + +MSBuildFileItem * makeFileItem(const QString& filePath, + MSBuildItemGroup *itemGroup) +{ + if (isHeaderFile(filePath)) + return new MSBuildClInclude(itemGroup); + + if (isSourceFile(filePath)) + return new MSBuildClCompile(itemGroup); + + return new MSBuildNone(itemGroup); +} + - const auto itemGroup = new MSBuildItemGroup(this); - const auto filterOptions = defaultItemGroupFilters(); - for (const auto options : filterOptions) { - const auto filter = new MSBuildFilter(options->include(), options->extensions(), itemGroup); - filter->appendProperty(QStringLiteral("ParseFiles"), options->parseFiles()); - filter->appendProperty(QStringLiteral("SourceControlFiles"), options->sourceControlFiles()); +class ProductProcessor +{ +public: + using StringSet = Internal::Set<QString>; + + ProductProcessor(MSBuildProject *parent) + : m_parent(parent) + , m_itemFiltersGroup(new MSBuildItemGroup(m_parent)) + { } - Internal::Set<QString> allFiles; - const auto productDatas = product.data.values(); - for (const auto &productData : productDatas) { - const auto groups = productData.groups(); - for (const auto &groupData : groups) - if (groupData.isEnabled()) - allFiles.unite(Internal::Set<QString>::fromList(groupData.allFilePaths())); + void operator()(const QList<ProductData> &productDatas) + { + for (const auto &productData : productDatas) { + const auto &productName = productData.name(); + + for (const auto &groupData : productData.groups()) { + if (groupData.name() == productName) { + processProductFiles(Internal::rangeTo<StringSet>(groupData.allFilePaths())); + } else { + processGroup(groupData); + } + } + } } - MSBuildItemGroup *headerFilesGroup = nullptr; - MSBuildItemGroup *sourceFilesGroup = nullptr; - MSBuildItemGroup *filesGroup = nullptr; - - for (const auto &filePath : allFiles) { - MSBuildFileItem *fileItem = nullptr; - - for (const MSBuildFilter *options : filterOptions) { - if (matchesFilter(options, filePath)) { - if (options->include() == QStringLiteral("Header Files")) { - if (!headerFilesGroup) - headerFilesGroup = new MSBuildItemGroup(this); - fileItem = new MSBuildClInclude(headerFilesGroup); - } else if (options->include() == QStringLiteral("Source Files")) { - if (!sourceFilesGroup) - sourceFilesGroup = new MSBuildItemGroup(this); - fileItem = new MSBuildClCompile(sourceFilesGroup); + void processProductFiles(const StringSet &files) + { + for (const auto &filePath : files) { + MSBuildFileItem *fileItem = nullptr; + + for (const auto &filterInfo : getDefaultFilterInfo()) { + if (matchesFilter(filterInfo, filePath)) { + makeFilter(filterInfo); + + if (filterInfo.name == QStringLiteral("Header Files")) { + if (!m_headerFilesGroup) + m_headerFilesGroup = new MSBuildItemGroup(m_parent); + fileItem = new MSBuildClInclude(m_headerFilesGroup); + } else if (filterInfo.name == QStringLiteral("Source Files")) { + if (!m_sourceFilesGroup) + m_sourceFilesGroup = new MSBuildItemGroup(m_parent); + fileItem = new MSBuildClCompile(m_sourceFilesGroup); + } + + if (fileItem) { + fileItem->setFilterName(filterInfo.name); + break; + } } + } - if (fileItem) { - fileItem->setFilterName(options->include()); - break; + if (!fileItem) { + if (!m_filesGroup) { + m_filesGroup = new MSBuildItemGroup(m_parent); } + + fileItem = new MSBuildNone(m_filesGroup); } + + fileItem->setFilePath(filePath); } + } - if (!fileItem) { - if (!filesGroup) - filesGroup = new MSBuildItemGroup(this); - fileItem = new MSBuildNone(filesGroup); + void processGroup(const GroupData &groupData) + { + makeFilter({groupData.name(), QStringList() << QStringLiteral("*")}); + + auto *itemGroup = new MSBuildItemGroup(m_parent); + const auto &files = groupData.allFilePaths(); + for (const auto &filePath : files) { + auto *fileItem = makeFileItem(filePath, itemGroup); + fileItem->setFilePath(filePath); + fileItem->setFilterName(groupData.name()); } - fileItem->setFilePath(filePath); } - qDeleteAll(filterOptions); + void makeFilter(const FilterInfo &filterInfo) + { + if (!m_createdFilters.contains(filterInfo.name)) { + makeBuildFilter(filterInfo, m_itemFiltersGroup); + m_createdFilters.insert(filterInfo.name); + } + } + +private: + MSBuildProject *m_parent = nullptr; + MSBuildItemGroup *m_itemFiltersGroup = nullptr; + MSBuildItemGroup *m_headerFilesGroup = nullptr; + MSBuildItemGroup *m_sourceFilesGroup = nullptr; + MSBuildItemGroup *m_filesGroup = nullptr; + QSet<QString> m_createdFilters; +}; + +} // namespace + +MSBuildFiltersProject::MSBuildFiltersProject(const GeneratableProductData &product, + QObject *parent) + : MSBuildProject(parent) +{ + // Normally this would be versionInfo.toolsVersion() but for some reason it seems + // filters projects are always v4.0 + setToolsVersion(QStringLiteral("4.0")); + + ProductProcessor(this)(product.data.values()); } } // namespace qbs diff --git a/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp b/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp index 2d679ceb1..6f77212d4 100644 --- a/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp +++ b/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp @@ -126,7 +126,7 @@ void MSBuildQbsProductProject::addConfiguration(const GeneratableProject &projec relativeTargetDir = QStringLiteral("$(SolutionDir)$(Configuration)") + relativeTargetDir.mid(configurationDir.size()); - const auto properties = productData.moduleProperties(); + const auto &properties = productData.moduleProperties(); const bool debugBuild = properties.getModuleProperty(StringConstants::qbsModule(), QStringLiteral("debugInformation")) @@ -248,7 +248,7 @@ static QString subsystemVersion(const QString &version) void MSBuildQbsProductProject::addItemDefGroup(const Project &project, const ProductData &productData) { - const auto properties = productData.moduleProperties(); + const auto &properties = productData.moduleProperties(); const bool consoleApp = productData.properties().value(QStringLiteral("consoleApplication")) .toBool(); diff --git a/src/plugins/generator/visualstudio/msbuildtargetproject.cpp b/src/plugins/generator/visualstudio/msbuildtargetproject.cpp index bcd654061..33ce9d9ae 100644 --- a/src/plugins/generator/visualstudio/msbuildtargetproject.cpp +++ b/src/plugins/generator/visualstudio/msbuildtargetproject.cpp @@ -92,7 +92,7 @@ const Internal::VisualStudioVersionInfo &MSBuildTargetProject::versionInfo() con QUuid MSBuildTargetProject::guid() const { - return {d->projectGuidProperty->value().toString()}; + return QUuid{d->projectGuidProperty->value().toString()}; } void MSBuildTargetProject::setGuid(const QUuid &guid) diff --git a/src/plugins/generator/visualstudio/msbuildutils.h b/src/plugins/generator/visualstudio/msbuildutils.h index 3eceeba2e..cf4c7eb0d 100644 --- a/src/plugins/generator/visualstudio/msbuildutils.h +++ b/src/plugins/generator/visualstudio/msbuildutils.h @@ -92,14 +92,12 @@ public: static QString fullDisplayName(const qbs::Project &project) { - return QStringLiteral("%1|%2") - .arg(configurationName(project)) - .arg(displayPlatform(project)); + return QStringLiteral("%1|%2").arg(configurationName(project), displayPlatform(project)); } static QString fullName(const qbs::Project &project) { - return QStringLiteral("%1|%2").arg(configurationName(project)).arg(platform(project)); + return QStringLiteral("%1|%2").arg(configurationName(project), platform(project)); } static QString buildTaskCondition(const Project &buildTask) diff --git a/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.cpp b/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.cpp deleted file mode 100644 index 4623b5d4d..000000000 --- a/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "ivisualstudiosolutionproject.h" - -namespace qbs { - -class IVisualStudioSolutionProjectPrivate -{ -public: - QUuid guid = QUuid::createUuid(); - QString name; - QString filePath; -}; - -IVisualStudioSolutionProject::IVisualStudioSolutionProject(QObject *parent) - : QObject(parent) - , d(new IVisualStudioSolutionProjectPrivate) -{ -} - -IVisualStudioSolutionProject::~IVisualStudioSolutionProject() = default; - -QUuid IVisualStudioSolutionProject::guid() const -{ - return d->guid; -} - -void IVisualStudioSolutionProject::setGuid(const QUuid &guid) -{ - d->guid = guid; -} - -QString IVisualStudioSolutionProject::name() const -{ - return d->name; -} - -void IVisualStudioSolutionProject::setName(const QString &name) -{ - d->name = name; -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.h b/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.h deleted file mode 100644 index 6f8574aed..000000000 --- a/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef IVISUALSTUDIOSOLUTIONPROJECT_H -#define IVISUALSTUDIOSOLUTIONPROJECT_H - -#include <QtCore/qobject.h> -#include <QtCore/qstring.h> -#include <QtCore/quuid.h> - -#include <memory> - -namespace qbs { - -class IVisualStudioSolutionProjectPrivate; - -class IVisualStudioSolutionProject : public QObject -{ - Q_OBJECT -protected: - explicit IVisualStudioSolutionProject(QObject *parent = nullptr); - -public: - ~IVisualStudioSolutionProject() override; - - virtual QUuid projectTypeGuid() const = 0; - - QUuid guid() const; - void setGuid(const QUuid &guid); - - virtual QString name() const; - void setName(const QString &name); - -private: - std::unique_ptr<IVisualStudioSolutionProjectPrivate> d; -}; - -} // namespace qbs - -#endif // IVISUALSTUDIOSOLUTIONPROJECT_H diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolution.cpp b/src/plugins/generator/visualstudio/solution/visualstudiosolution.cpp deleted file mode 100644 index 89b266647..000000000 --- a/src/plugins/generator/visualstudio/solution/visualstudiosolution.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "visualstudiosolution.h" - -#include "visualstudiosolutionfileproject.h" -#include "visualstudiosolutionfolderproject.h" - -#include <tools/visualstudioversioninfo.h> - -#include <QtCore/qmap.h> - -namespace qbs { - -class VisualStudioSolutionPrivate -{ -public: - VisualStudioSolutionPrivate(const Internal::VisualStudioVersionInfo &versionInfo) - : versionInfo(versionInfo) { } - const Internal::VisualStudioVersionInfo versionInfo; - QList<IVisualStudioSolutionProject *> projects; - QMap<VisualStudioSolutionFileProject *, QList<VisualStudioSolutionFileProject *>> dependencies; - QList<VisualStudioSolutionGlobalSection *> globalSections; -}; - -VisualStudioSolution::VisualStudioSolution(const Internal::VisualStudioVersionInfo &versionInfo, - QObject *parent) - : QObject(parent) - , d(new VisualStudioSolutionPrivate(versionInfo)) -{ -} - -VisualStudioSolution::~VisualStudioSolution() = default; - -Internal::VisualStudioVersionInfo VisualStudioSolution::versionInfo() const -{ - return d->versionInfo; -} - -QList<IVisualStudioSolutionProject *> VisualStudioSolution::projects() const -{ - return d->projects; -} - -QList<VisualStudioSolutionFileProject *> VisualStudioSolution::fileProjects() const -{ - QList<VisualStudioSolutionFileProject *> list; - for (const auto &project : qAsConst(d->projects)) - if (auto fileProject = qobject_cast<VisualStudioSolutionFileProject *>(project)) - list.push_back(fileProject); - return list; -} - -QList<VisualStudioSolutionFolderProject *> VisualStudioSolution::folderProjects() const -{ - QList<VisualStudioSolutionFolderProject *> list; - for (const auto &project : qAsConst(d->projects)) - if (auto folderProject = qobject_cast<VisualStudioSolutionFolderProject *>(project)) - list.push_back(folderProject); - return list; -} - -void VisualStudioSolution::appendProject(IVisualStudioSolutionProject *project) -{ - d->projects.push_back(project); -} - -QList<VisualStudioSolutionFileProject *> VisualStudioSolution::dependencies( - VisualStudioSolutionFileProject *project) const -{ - return d->dependencies.value(project); -} - -void VisualStudioSolution::addDependency(VisualStudioSolutionFileProject *project, - VisualStudioSolutionFileProject *dependency) -{ - d->dependencies[project].push_back(dependency); -} - -QList<VisualStudioSolutionGlobalSection *> VisualStudioSolution::globalSections() const -{ - return d->globalSections; -} - -void VisualStudioSolution::appendGlobalSection(VisualStudioSolutionGlobalSection *globalSection) -{ - d->globalSections.push_back(globalSection); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolution.h b/src/plugins/generator/visualstudio/solution/visualstudiosolution.h deleted file mode 100644 index ba304c00c..000000000 --- a/src/plugins/generator/visualstudio/solution/visualstudiosolution.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef VISUALSTUDIOSOLUTION_H -#define VISUALSTUDIOSOLUTION_H - -#include <QtCore/qobject.h> - -#include <memory> - -namespace qbs { - -namespace Internal { class VisualStudioVersionInfo; } - -class MSBuildProject; - -class IVisualStudioSolutionProject; -class VisualStudioSolutionFileProject; -class VisualStudioSolutionFolderProject; -class VisualStudioSolutionGlobalSection; - -class VisualStudioSolutionPrivate; - -class VisualStudioSolution : public QObject -{ - Q_OBJECT - Q_DISABLE_COPY(VisualStudioSolution) -public: - explicit VisualStudioSolution(const Internal::VisualStudioVersionInfo &versionInfo, - QObject *parent = nullptr); - ~VisualStudioSolution() override; - - Internal::VisualStudioVersionInfo versionInfo() const; - - QList<IVisualStudioSolutionProject *> projects() const; - QList<VisualStudioSolutionFileProject *> fileProjects() const; - QList<VisualStudioSolutionFolderProject *> folderProjects() const; - void appendProject(IVisualStudioSolutionProject *project); - void removeProject(const IVisualStudioSolutionProject *project); - void clearProjects(); - - QList<VisualStudioSolutionFileProject *> dependencies( - VisualStudioSolutionFileProject *project) const; - void addDependency(VisualStudioSolutionFileProject *project, - VisualStudioSolutionFileProject *dependency); - - QList<VisualStudioSolutionGlobalSection *> globalSections() const; - void appendGlobalSection(VisualStudioSolutionGlobalSection *globalSection); - -private: - void addDefaultGlobalSections(); - - std::unique_ptr<VisualStudioSolutionPrivate> d; -}; - -} // namespace qbs - -#endif // VISUALSTUDIOSOLUTION_H diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.cpp b/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.cpp deleted file mode 100644 index ab5db088d..000000000 --- a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "visualstudiosolutionfileproject.h" - -#include <QtCore/qfileinfo.h> - -namespace qbs { - -class VisualStudioSolutionFileProjectPrivate -{ -public: - QString filePath; -}; - -VisualStudioSolutionFileProject::VisualStudioSolutionFileProject(const QString &filePath, - QObject *parent) - : IVisualStudioSolutionProject(parent) - , d(new VisualStudioSolutionFileProjectPrivate) -{ - setFilePath(filePath); -} - -VisualStudioSolutionFileProject::~VisualStudioSolutionFileProject() = default; - -QString VisualStudioSolutionFileProject::name() const -{ - const auto projectName = IVisualStudioSolutionProject::name(); - if (projectName.isEmpty()) - return QFileInfo(filePath()).baseName(); - return projectName; -} - -QUuid VisualStudioSolutionFileProject::projectTypeGuid() const -{ - return QStringLiteral("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"); // C++ -} - -QString VisualStudioSolutionFileProject::filePath() const -{ - return d->filePath; -} - -void VisualStudioSolutionFileProject::setFilePath(const QString &filePath) -{ - d->filePath = filePath; -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.h b/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.h deleted file mode 100644 index 2039146b6..000000000 --- a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef VISUALSTUDIOSOLUTIONFILEPROJECT_H -#define VISUALSTUDIOSOLUTIONFILEPROJECT_H - -#include <QtCore/qobject.h> -#include "ivisualstudiosolutionproject.h" - -#include <memory> - -namespace qbs { - -class VisualStudioSolutionFileProjectPrivate; - -class VisualStudioSolutionFileProject : public IVisualStudioSolutionProject -{ - Q_OBJECT -public: - explicit VisualStudioSolutionFileProject(const QString &filePath, QObject *parent = nullptr); - ~VisualStudioSolutionFileProject() override; - - QString name() const override; - - QString filePath() const; - void setFilePath(const QString &filePath); - - QUuid projectTypeGuid() const override; - -private: - std::unique_ptr<VisualStudioSolutionFileProjectPrivate> d; -}; - -} // namespace qbs - -#endif // VISUALSTUDIOSOLUTIONFILEPROJECT_H diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfolderproject.cpp b/src/plugins/generator/visualstudio/solution/visualstudiosolutionfolderproject.cpp deleted file mode 100644 index d59d1e1ed..000000000 --- a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfolderproject.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "visualstudiosolutionfolderproject.h" - -#include <QtCore/qfileinfo.h> - -namespace qbs { - -VisualStudioSolutionFolderProject::VisualStudioSolutionFolderProject(QObject *parent) - : IVisualStudioSolutionProject(parent) -{ -} - -QUuid VisualStudioSolutionFolderProject::projectTypeGuid() const -{ - return QStringLiteral("{2150E333-8FDC-42A3-9474-1A3956D46DE8}"); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfolderproject.h b/src/plugins/generator/visualstudio/solution/visualstudiosolutionfolderproject.h deleted file mode 100644 index a7fd180cc..000000000 --- a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfolderproject.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef VISUALSTUDIOSOLUTIONFOLDERPROJECT_H -#define VISUALSTUDIOSOLUTIONFOLDERPROJECT_H - -#include <QtCore/qobject.h> -#include "ivisualstudiosolutionproject.h" - -namespace qbs { - -class VisualStudioSolutionFolderProject : public IVisualStudioSolutionProject -{ - Q_OBJECT -public: - explicit VisualStudioSolutionFolderProject(QObject *parent); - - QUuid projectTypeGuid() const override; -}; - -} // namespace qbs - -#endif // VISUALSTUDIOSOLUTIONFOLDERPROJECT_H diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.cpp b/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.cpp deleted file mode 100644 index 5cbb0cd61..000000000 --- a/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "visualstudiosolutionglobalsection.h" - -#include <utility> -#include <vector> - -namespace qbs { - -class VisualStudioSolutionGlobalSectionPrivate -{ -public: - QString name; - std::vector<std::pair<QString, QString>> properties; - bool post = false; -}; - -VisualStudioSolutionGlobalSection::VisualStudioSolutionGlobalSection(const QString &name, - QObject *parent) - : QObject(parent) - , d(new VisualStudioSolutionGlobalSectionPrivate) -{ - setName(name); -} - -VisualStudioSolutionGlobalSection::~VisualStudioSolutionGlobalSection() = default; - -QString VisualStudioSolutionGlobalSection::name() const -{ - return d->name; -} - -void VisualStudioSolutionGlobalSection::setName(const QString &name) -{ - d->name = name; -} - -bool VisualStudioSolutionGlobalSection::isPost() const -{ - return d->post; -} - -void VisualStudioSolutionGlobalSection::setPost(bool post) -{ - d->post = post; -} - -std::vector<std::pair<QString, QString> > VisualStudioSolutionGlobalSection::properties() const -{ - return d->properties; -} - -void VisualStudioSolutionGlobalSection::appendProperty(const QString &key, const QString &value) -{ - d->properties.emplace_back(key, value); -} - -} // namespace qbs diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.h b/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.h deleted file mode 100644 index 6d383e7d4..000000000 --- a/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing -** -** This file is part of Qbs. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms and -** conditions see http://www.qt.io/terms-conditions. For further information -** use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef VISUALSTUDIOSOLUTIONGLOBALSECTION_H -#define VISUALSTUDIOSOLUTIONGLOBALSECTION_H - -#include <QtCore/qobject.h> - -#include <memory> - -namespace qbs { - -class VisualStudioSolutionGlobalSectionPrivate; - -class VisualStudioSolutionGlobalSection : public QObject -{ - Q_OBJECT - Q_DISABLE_COPY(VisualStudioSolutionGlobalSection) -public: - explicit VisualStudioSolutionGlobalSection(const QString &name, QObject *parent = nullptr); - ~VisualStudioSolutionGlobalSection() override; - - QString name() const; - void setName(const QString &name); - - bool isPost() const; - void setPost(bool post); - - std::vector<std::pair<QString, QString> > properties() const; - void appendProperty(const QString &key, const QString &value); - -private: - std::unique_ptr<VisualStudioSolutionGlobalSectionPrivate> d; -}; - -} // namespace qbs - -#endif // VISUALSTUDIOSOLUTIONGLOBALSECTION_H diff --git a/src/plugins/generator/visualstudio/visualstudio.pri b/src/plugins/generator/visualstudio/visualstudio.pri deleted file mode 100644 index 13a48e85d..000000000 --- a/src/plugins/generator/visualstudio/visualstudio.pri +++ /dev/null @@ -1 +0,0 @@ -qbsPluginTarget = visualstudiogenerator diff --git a/src/plugins/generator/visualstudio/visualstudio.pro b/src/plugins/generator/visualstudio/visualstudio.pro deleted file mode 100644 index 7d2398c8d..000000000 --- a/src/plugins/generator/visualstudio/visualstudio.pro +++ /dev/null @@ -1,94 +0,0 @@ -include(visualstudio.pri) -include(../../plugins.pri) -include(../../../shared/json/json.pri) - -QT = core - -HEADERS += \ - $$PWD/msbuildfiltersproject.h \ - $$PWD/msbuildqbsgenerateproject.h \ - $$PWD/msbuildqbsproductproject.h \ - $$PWD/msbuildsharedsolutionpropertiesproject.h \ - $$PWD/msbuildsolutionpropertiesproject.h \ - $$PWD/msbuildtargetproject.h \ - $$PWD/msbuildutils.h \ - $$PWD/visualstudiogenerator.h \ - $$PWD/visualstudioguidpool.h - -SOURCES += \ - $$PWD/msbuildfiltersproject.cpp \ - $$PWD/msbuildqbsgenerateproject.cpp \ - $$PWD/msbuildqbsproductproject.cpp \ - $$PWD/msbuildsharedsolutionpropertiesproject.cpp \ - $$PWD/msbuildsolutionpropertiesproject.cpp \ - $$PWD/msbuildtargetproject.cpp \ - $$PWD/visualstudiogenerator.cpp \ - $$PWD/visualstudiogeneratorplugin.cpp \ - $$PWD/visualstudioguidpool.cpp - -HEADERS += \ - $$PWD/solution/ivisualstudiosolutionproject.h \ - $$PWD/solution/visualstudiosolutionfileproject.h \ - $$PWD/solution/visualstudiosolutionfolderproject.h \ - $$PWD/solution/visualstudiosolution.h \ - $$PWD/solution/visualstudiosolutionglobalsection.h \ - -SOURCES += \ - $$PWD/solution/ivisualstudiosolutionproject.cpp \ - $$PWD/solution/visualstudiosolutionfileproject.cpp \ - $$PWD/solution/visualstudiosolutionfolderproject.cpp \ - $$PWD/solution/visualstudiosolution.cpp \ - $$PWD/solution/visualstudiosolutionglobalsection.cpp - -HEADERS += \ - $$PWD/msbuild/imsbuildgroup.h \ - $$PWD/msbuild/imsbuildnode.h \ - $$PWD/msbuild/imsbuildnodevisitor.h \ - $$PWD/msbuild/imsbuildproperty.h \ - $$PWD/msbuild/msbuildimport.h \ - $$PWD/msbuild/msbuildimportgroup.h \ - $$PWD/msbuild/msbuilditem.h \ - $$PWD/msbuild/msbuilditemdefinitiongroup.h \ - $$PWD/msbuild/msbuilditemgroup.h \ - $$PWD/msbuild/msbuilditemmetadata.h \ - $$PWD/msbuild/msbuildproject.h \ - $$PWD/msbuild/msbuildproperty.h \ - $$PWD/msbuild/msbuildpropertygroup.h - -SOURCES += \ - $$PWD/msbuild/imsbuildgroup.cpp \ - $$PWD/msbuild/imsbuildnode.cpp \ - $$PWD/msbuild/imsbuildproperty.cpp \ - $$PWD/msbuild/msbuildimport.cpp \ - $$PWD/msbuild/msbuildimportgroup.cpp \ - $$PWD/msbuild/msbuilditem.cpp \ - $$PWD/msbuild/msbuilditemdefinitiongroup.cpp \ - $$PWD/msbuild/msbuilditemgroup.cpp \ - $$PWD/msbuild/msbuilditemmetadata.cpp \ - $$PWD/msbuild/msbuildproject.cpp \ - $$PWD/msbuild/msbuildproperty.cpp \ - $$PWD/msbuild/msbuildpropertygroup.cpp - -HEADERS += \ - $$PWD/msbuild/items/msbuildclcompile.h \ - $$PWD/msbuild/items/msbuildclinclude.h \ - $$PWD/msbuild/items/msbuildfileitem.h \ - $$PWD/msbuild/items/msbuildfilter.h \ - $$PWD/msbuild/items/msbuildlink.h \ - $$PWD/msbuild/items/msbuildnone.h - -SOURCES += \ - $$PWD/msbuild/items/msbuildclcompile.cpp \ - $$PWD/msbuild/items/msbuildclinclude.cpp \ - $$PWD/msbuild/items/msbuildfileitem.cpp \ - $$PWD/msbuild/items/msbuildfilter.cpp \ - $$PWD/msbuild/items/msbuildlink.cpp \ - $$PWD/msbuild/items/msbuildnone.cpp - -HEADERS += \ - $$PWD/io/msbuildprojectwriter.h \ - $$PWD/io/visualstudiosolutionwriter.h - -SOURCES += \ - $$PWD/io/msbuildprojectwriter.cpp \ - $$PWD/io/visualstudiosolutionwriter.cpp diff --git a/src/plugins/generator/visualstudio/visualstudio.qbs b/src/plugins/generator/visualstudio/visualstudio.qbs index 41a620252..718c8523e 100644 --- a/src/plugins/generator/visualstudio/visualstudio.qbs +++ b/src/plugins/generator/visualstudio/visualstudio.qbs @@ -1,8 +1,8 @@ -import qbs import "../../qbsplugin.qbs" as QbsPlugin QbsPlugin { Depends { name: "qbsjson" } + Depends { name: "qbsmsbuild" } name: "visualstudiogenerator" @@ -30,79 +30,4 @@ QbsPlugin { "visualstudioguidpool.h", ] } - Group { - name: "Solution Object Model" - prefix: "solution/" - files: [ - "ivisualstudiosolutionproject.cpp", - "ivisualstudiosolutionproject.h", - "visualstudiosolutionfileproject.cpp", - "visualstudiosolutionfileproject.h", - "visualstudiosolutionfolderproject.cpp", - "visualstudiosolutionfolderproject.h", - "visualstudiosolution.cpp", - "visualstudiosolution.h", - "visualstudiosolutionglobalsection.cpp", - "visualstudiosolutionglobalsection.h", - ] - } - Group { - name: "MSBuild Object Model" - prefix: "msbuild/" - files: [ - "imsbuildgroup.cpp", - "imsbuildgroup.h", - "imsbuildnode.cpp", - "imsbuildnode.h", - "imsbuildnodevisitor.h", - "imsbuildproperty.cpp", - "imsbuildproperty.h", - "msbuildimport.cpp", - "msbuildimport.h", - "msbuildimportgroup.cpp", - "msbuildimportgroup.h", - "msbuilditem.cpp", - "msbuilditem.h", - "msbuilditemdefinitiongroup.cpp", - "msbuilditemdefinitiongroup.h", - "msbuilditemgroup.cpp", - "msbuilditemgroup.h", - "msbuilditemmetadata.cpp", - "msbuilditemmetadata.h", - "msbuildproject.cpp", - "msbuildproject.h", - "msbuildproperty.cpp", - "msbuildproperty.h", - "msbuildpropertygroup.cpp", - "msbuildpropertygroup.h", - ] - } - Group { - name: "MSBuild Object Model Items" - prefix: "msbuild/items/" - files: [ - "msbuildclcompile.cpp", - "msbuildclcompile.h", - "msbuildclinclude.cpp", - "msbuildclinclude.h", - "msbuildfileitem.cpp", - "msbuildfileitem.h", - "msbuildfilter.cpp", - "msbuildfilter.h", - "msbuildlink.cpp", - "msbuildlink.h", - "msbuildnone.cpp", - "msbuildnone.h", - ] - } - Group { - name: "Visual Studio Object Model I/O" - prefix: "io/" - files: [ - "msbuildprojectwriter.cpp", - "msbuildprojectwriter.h", - "visualstudiosolutionwriter.cpp", - "visualstudiosolutionwriter.h", - ] - } } diff --git a/src/plugins/generator/visualstudio/visualstudiogenerator.cpp b/src/plugins/generator/visualstudio/visualstudiogenerator.cpp index 2ce54e73e..d6add9c6f 100644 --- a/src/plugins/generator/visualstudio/visualstudiogenerator.cpp +++ b/src/plugins/generator/visualstudio/visualstudiogenerator.cpp @@ -153,7 +153,7 @@ VisualStudioGenerator::VisualStudioGenerator(const VisualStudioVersionInfo &vers { if (d->versionInfo.usesVcBuild()) throw ErrorInfo(Tr::tr("VCBuild (Visual Studio 2008 and below) is not supported")); - else if (!d->versionInfo.usesMsBuild()) + if (!d->versionInfo.usesMsBuild()) throw ErrorInfo(Tr::tr("Unknown/unsupported build engine")); Q_ASSERT(d->versionInfo.usesSolutions()); } @@ -189,7 +189,7 @@ void VisualStudioGenerator::addPropertySheets(const GeneratableProject &project) void VisualStudioGenerator::addPropertySheets( const std::shared_ptr<MSBuildTargetProject> &targetProject) { - for (const auto &pair : qAsConst(d->propertySheetNames)) { + for (const auto &pair : std::as_const(d->propertySheetNames)) { targetProject->appendPropertySheet( QStringLiteral("$(SolutionDir)\\") + pair.first, pair.second); } @@ -220,18 +220,16 @@ static void addDefaultGlobalSections(const GeneratableProject &topLevelProject, QStringLiteral("ProjectConfigurationPlatforms"), solution); solution->appendGlobalSection(projectConfigurationPlatformsSection); projectConfigurationPlatformsSection->setPost(true); - const auto projects = solution->projects(); + const auto projects = solution->fileProjects(); for (const auto project : projects) { for (const auto &qbsProject : topLevelProject.projects) { projectConfigurationPlatformsSection->appendProperty( - QStringLiteral("%1.%2.ActiveCfg") - .arg(project->guid().toString()) - .arg(MSBuildUtils::fullDisplayName(qbsProject)), + QStringLiteral("%1.%2.ActiveCfg").arg(project->guid().toString(), + MSBuildUtils::fullDisplayName(qbsProject)), MSBuildUtils::fullName(qbsProject)); projectConfigurationPlatformsSection->appendProperty( - QStringLiteral("%1.%2.Build.0") - .arg(project->guid().toString()) - .arg(MSBuildUtils::fullDisplayName(qbsProject)), + QStringLiteral("%1.%2.Build.0").arg(project->guid().toString(), + MSBuildUtils::fullDisplayName(qbsProject)), MSBuildUtils::fullName(qbsProject)); } } diff --git a/src/plugins/generator/visualstudio/visualstudioguidpool.cpp b/src/plugins/generator/visualstudio/visualstudioguidpool.cpp index d6d716ff2..d770a448f 100644 --- a/src/plugins/generator/visualstudio/visualstudioguidpool.cpp +++ b/src/plugins/generator/visualstudio/visualstudioguidpool.cpp @@ -78,7 +78,7 @@ VisualStudioGuidPool::~VisualStudioGuidPool() productData.insert(it.first, it.second.toString().toStdString()); const auto data = JsonDocument(productData).toJson(); - file.write(std::vector<char> { data.cbegin(), data.cend() }); + file.write({data.data(), data.size()}); file.commit(); } } |