diff options
Diffstat (limited to 'src/plugins/generator')
118 files changed, 579 insertions, 4525 deletions
diff --git a/src/plugins/generator/CMakeLists.txt b/src/plugins/generator/CMakeLists.txt new file mode 100644 index 000000000..738e428bc --- /dev/null +++ b/src/plugins/generator/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(clangcompilationdb) +add_subdirectory(iarew) +add_subdirectory(keiluv) +add_subdirectory(makefilegenerator) +add_subdirectory(visualstudio) diff --git a/src/plugins/generator/clangcompilationdb/CMakeLists.txt b/src/plugins/generator/clangcompilationdb/CMakeLists.txt new file mode 100644 index 000000000..237ae4650 --- /dev/null +++ b/src/plugins/generator/clangcompilationdb/CMakeLists.txt @@ -0,0 +1,10 @@ +set(SOURCES + clangcompilationdbgenerator.cpp + clangcompilationdbgenerator.h + clangcompilationdbgeneratorplugin.cpp + ) + +add_qbs_plugin(clangcompilationdbgenerator + DEPENDS qbscore + SOURCES ${SOURCES} + ) diff --git a/src/plugins/generator/clangcompilationdb/clangcompilationdb.pri b/src/plugins/generator/clangcompilationdb/clangcompilationdb.pri deleted file mode 100644 index 7c9a71129..000000000 --- a/src/plugins/generator/clangcompilationdb/clangcompilationdb.pri +++ /dev/null @@ -1 +0,0 @@ -qbsPluginTarget = clangcompilationdbgenerator diff --git a/src/plugins/generator/clangcompilationdb/clangcompilationdb.pro b/src/plugins/generator/clangcompilationdb/clangcompilationdb.pro deleted file mode 100644 index 1b5342598..000000000 --- a/src/plugins/generator/clangcompilationdb/clangcompilationdb.pro +++ /dev/null @@ -1,11 +0,0 @@ -include(clangcompilationdb.pri) -include(../../plugins.pri) - -QT = core - -HEADERS += \ - $$PWD/clangcompilationdbgenerator.h - -SOURCES += \ - $$PWD/clangcompilationdbgenerator.cpp \ - $$PWD/clangcompilationdbgeneratorplugin.cpp diff --git a/src/plugins/generator/clangcompilationdb/clangcompilationdb.qbs b/src/plugins/generator/clangcompilationdb/clangcompilationdb.qbs index 741d6dbf0..89f7c84b9 100644 --- a/src/plugins/generator/clangcompilationdb/clangcompilationdb.qbs +++ b/src/plugins/generator/clangcompilationdb/clangcompilationdb.qbs @@ -1,4 +1,3 @@ -import qbs import "../../qbsplugin.qbs" as QbsPlugin QbsPlugin { diff --git a/src/plugins/generator/clangcompilationdb/clangcompilationdbgenerator.cpp b/src/plugins/generator/clangcompilationdb/clangcompilationdbgenerator.cpp index 93be2804b..dc5450967 100644 --- a/src/plugins/generator/clangcompilationdb/clangcompilationdbgenerator.cpp +++ b/src/plugins/generator/clangcompilationdb/clangcompilationdbgenerator.cpp @@ -45,6 +45,7 @@ #include <tools/error.h> #include <tools/installoptions.h> #include <tools/shellutils.h> +#include <tools/stlutils.h> #include <QtCore/qdir.h> #include <QtCore/qfile.h> @@ -71,12 +72,10 @@ void ClangCompilationDatabaseGenerator::generate() for (const Project &theProject : projects) { QJsonArray database; const ProjectData projectData = theProject.projectData(); - const QString buildDir = projectData.buildDirectory(); + const QString &buildDir = projectData.buildDirectory(); - const auto products = projectData.allProducts(); - for (const ProductData &productData : products) { - const auto groups = productData.groups(); - for (const GroupData &groupData : groups) { + for (const ProductData &productData : projectData.allProducts()) { + for (const GroupData &groupData : productData.groups()) { const auto sourceArtifacts = groupData.allSourceArtifacts(); for (const ArtifactData &sourceArtifact : sourceArtifacts) { if (!hasValidInputFileTag(sourceArtifact.fileTags())) @@ -116,12 +115,11 @@ QJsonObject ClangCompilationDatabaseGenerator::createEntry(const QString &filePa const QStringList arguments = QStringList() << ruleCommand.executable() << ruleCommand.arguments(); - const QJsonObject object = { + return QJsonObject{ { QStringLiteral("directory"), QJsonValue(workDir) }, { QStringLiteral("arguments"), QJsonArray::fromStringList(arguments) }, { QStringLiteral("file"), QJsonValue(filePath) } }; - return object; } void ClangCompilationDatabaseGenerator::writeProjectDatabase(const QString &filePath, @@ -132,13 +130,11 @@ void ClangCompilationDatabaseGenerator::writeProjectDatabase(const QString &file if (!databaseFile.open(QFile::WriteOnly)) throw ErrorInfo(Tr::tr("Cannot open '%1' for writing: %2") - .arg(filePath) - .arg(databaseFile.errorString())); + .arg(filePath, databaseFile.errorString())); if (databaseFile.write(database.toJson()) == -1) throw ErrorInfo(Tr::tr("Error while writing '%1': %2") - .arg(filePath) - .arg(databaseFile.errorString())); + .arg(filePath, databaseFile.errorString())); } bool ClangCompilationDatabaseGenerator::hasValidInputFileTag(const QStringList &fileTags) const @@ -150,11 +146,9 @@ bool ClangCompilationDatabaseGenerator::hasValidInputFileTag(const QStringList & QStringLiteral("objcpp") }; - for (const QString &tag : fileTags) { - if (validFileTags.contains(tag)) - return true; - } - return false; + return Internal::any_of(fileTags, [](const auto &tag) { + return validFileTags.contains(tag); + }); } } // namespace qbs diff --git a/src/plugins/generator/generator.pro b/src/plugins/generator/generator.pro deleted file mode 100644 index 4a3861321..000000000 --- a/src/plugins/generator/generator.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += clangcompilationdb -SUBDIRS += makefilegenerator -SUBDIRS += visualstudio -SUBDIRS += iarew -SUBDIRS += keiluv diff --git a/src/plugins/generator/iarew/CMakeLists.txt b/src/plugins/generator/iarew/CMakeLists.txt new file mode 100644 index 000000000..32af6e282 --- /dev/null +++ b/src/plugins/generator/iarew/CMakeLists.txt @@ -0,0 +1,119 @@ +set(COMMON_SOURCES + iarewfileversionproperty.cpp + iarewfileversionproperty.h + iarewgenerator.cpp + iarewgenerator.h + iarewgeneratorplugin.cpp + iarewoptionpropertygroup.cpp + iarewoptionpropertygroup.h + iarewproject.cpp + iarewproject.h + iarewprojectwriter.cpp + iarewprojectwriter.h + iarewsettingspropertygroup.cpp + iarewsettingspropertygroup.h + iarewsourcefilepropertygroup.cpp + iarewsourcefilepropertygroup.h + iarewsourcefilespropertygroup.cpp + iarewsourcefilespropertygroup.h + iarewtoolchainpropertygroup.cpp + iarewtoolchainpropertygroup.h + iarewutils.cpp + iarewutils.h + iarewversioninfo.h + iarewworkspace.cpp + iarewworkspace.h + iarewworkspacewriter.cpp + iarewworkspacewriter.h + ) + +set(ARCHS_ARM_SOURCES + armarchiversettingsgroup_v8.cpp + armarchiversettingsgroup_v8.h + armassemblersettingsgroup_v8.cpp + armassemblersettingsgroup_v8.h + armbuildconfigurationgroup_v8.cpp + armbuildconfigurationgroup_v8.h + armcompilersettingsgroup_v8.cpp + armcompilersettingsgroup_v8.h + armgeneralsettingsgroup_v8.cpp + armgeneralsettingsgroup_v8.h + armlinkersettingsgroup_v8.cpp + armlinkersettingsgroup_v8.h + ) +list_transform_prepend(ARCHS_ARM_SOURCES archs/arm/) + +set(ARCHS_AVR_SOURCES + avrarchiversettingsgroup_v7.cpp + avrarchiversettingsgroup_v7.h + avrassemblersettingsgroup_v7.cpp + avrassemblersettingsgroup_v7.h + avrbuildconfigurationgroup_v7.cpp + avrbuildconfigurationgroup_v7.h + avrcompilersettingsgroup_v7.cpp + avrcompilersettingsgroup_v7.h + avrgeneralsettingsgroup_v7.cpp + avrgeneralsettingsgroup_v7.h + avrlinkersettingsgroup_v7.cpp + avrlinkersettingsgroup_v7.h + ) +list_transform_prepend(ARCHS_AVR_SOURCES archs/avr/) + +set(ARCHS_MCS51_SOURCES + mcs51archiversettingsgroup_v10.cpp + mcs51archiversettingsgroup_v10.h + mcs51assemblersettingsgroup_v10.cpp + mcs51assemblersettingsgroup_v10.h + mcs51buildconfigurationgroup_v10.cpp + mcs51buildconfigurationgroup_v10.h + mcs51compilersettingsgroup_v10.cpp + mcs51compilersettingsgroup_v10.h + mcs51generalsettingsgroup_v10.cpp + mcs51generalsettingsgroup_v10.h + mcs51linkersettingsgroup_v10.cpp + mcs51linkersettingsgroup_v10.h + ) +list_transform_prepend(ARCHS_MCS51_SOURCES archs/mcs51/) + +set(ARCHS_STM8_SOURCES + stm8archiversettingsgroup_v3.cpp + stm8archiversettingsgroup_v3.h + stm8assemblersettingsgroup_v3.cpp + stm8assemblersettingsgroup_v3.h + stm8buildconfigurationgroup_v3.cpp + stm8buildconfigurationgroup_v3.h + stm8compilersettingsgroup_v3.cpp + stm8compilersettingsgroup_v3.h + stm8generalsettingsgroup_v3.cpp + stm8generalsettingsgroup_v3.h + stm8linkersettingsgroup_v3.cpp + stm8linkersettingsgroup_v3.h + ) +list_transform_prepend(ARCHS_STM8_SOURCES archs/stm8/) + +set(ARCHS_MSP430_SOURCES + msp430archiversettingsgroup_v7.cpp + msp430archiversettingsgroup_v7.h + msp430assemblersettingsgroup_v7.cpp + msp430assemblersettingsgroup_v7.h + msp430buildconfigurationgroup_v7.cpp + msp430buildconfigurationgroup_v7.h + msp430compilersettingsgroup_v7.cpp + msp430compilersettingsgroup_v7.h + msp430generalsettingsgroup_v7.cpp + msp430generalsettingsgroup_v7.h + msp430linkersettingsgroup_v7.cpp + msp430linkersettingsgroup_v7.h + ) +list_transform_prepend(ARCHS_MSP430_SOURCES archs/msp430/) + +add_qbs_plugin(iarewgenerator + DEPENDS qbscore qbsjson + SOURCES + ${COMMON_SOURCES} + ${ARCHS_ARM_SOURCES} + ${ARCHS_AVR_SOURCES} + ${ARCHS_MCS51_SOURCES} + ${ARCHS_STM8_SOURCES} + ${ARCHS_MSP430_SOURCES} + ) diff --git a/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp b/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp index 911873cf4..a2395e3d7 100644 --- a/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp +++ b/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp @@ -105,7 +105,7 @@ struct CpuCoreEntry final }; // Dictionary of known ARM CPU cores and its compiler options. -static const CpuCoreEntry cpusDict[] = { +const CpuCoreEntry cpusDict[] = { {CpuCoreEntry::Arm7tdmi, "arm7tdmi"}, // same as 'sc100' {CpuCoreEntry::Arm7tdmis, "arm7tdmi-s"}, {CpuCoreEntry::Arm710t, "arm710t"}, @@ -187,7 +187,7 @@ struct FpuCoreEntry final }; // Dictionary of known ARM FPU cores and its compiler options. -static const FpuCoreEntry fpusDict[] = { +const FpuCoreEntry fpusDict[] = { {FpuCoreEntry::Vfp2, FpuCoreEntry::NoFpuRegisters, "vfpv2"}, {FpuCoreEntry::Vfp3d16, FpuCoreEntry::Fpu16Registers, "vfpv3_d16"}, {FpuCoreEntry::Vfp3, FpuCoreEntry::Fpu32Registers, "vfpv3"}, @@ -499,7 +499,7 @@ void ArmGeneralSettingsGroup::buildLibraryOptionsTwoPage( } void ArmGeneralSettingsGroup::buildLibraryConfigPage( - const QString baseDirectory, + const QString &baseDirectory, const ProductData &qbsProduct) { const LibraryConfigPageOptions opts(baseDirectory, qbsProduct); @@ -523,7 +523,7 @@ void ArmGeneralSettingsGroup::buildLibraryConfigPage( } void ArmGeneralSettingsGroup::buildOutputPage( - const QString baseDirectory, + const QString &baseDirectory, const ProductData &qbsProduct) { const OutputPageOptions opts(baseDirectory, qbsProduct); diff --git a/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.h b/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.h index 420e98008..0b1564b3c 100644 --- a/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.h +++ b/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.h @@ -49,9 +49,9 @@ private: void buildTargetPage(const ProductData &qbsProduct); void buildLibraryOptionsOnePage(const ProductData &qbsProduct); void buildLibraryOptionsTwoPage(const ProductData &qbsProduct); - void buildLibraryConfigPage(const QString baseDirectory, + void buildLibraryConfigPage(const QString &baseDirectory, const ProductData &qbsProduct); - void buildOutputPage(const QString baseDirectory, + void buildOutputPage(const QString &baseDirectory, const ProductData &qbsProduct); }; diff --git a/src/plugins/generator/iarew/archs/arm/armlinkersettingsgroup_v8.cpp b/src/plugins/generator/iarew/archs/arm/armlinkersettingsgroup_v8.cpp index 7e29c2788..2cabac587 100644 --- a/src/plugins/generator/iarew/archs/arm/armlinkersettingsgroup_v8.cpp +++ b/src/plugins/generator/iarew/archs/arm/armlinkersettingsgroup_v8.cpp @@ -60,8 +60,7 @@ struct ConfigPageOptions final // Enumerate all product linker config files // (which are set trough 'linkerscript' tag). - const auto qbsGroups = qbsProduct.groups(); - for (const auto &qbsGroup : qbsGroups) { + for (const auto &qbsGroup : qbsProduct.groups()) { if (!qbsGroup.isEnabled()) continue; const auto qbsArtifacts = qbsGroup.sourceArtifacts(); diff --git a/src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp b/src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp index a4819a90d..f3fb8647d 100644 --- a/src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp +++ b/src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp @@ -49,7 +49,7 @@ struct TargetMcuEntry final }; // Dictionary of known AVR MCU's and its compiler options. -static const TargetMcuEntry mcusDict[] = { +const TargetMcuEntry mcusDict[] = { {"AT43USB320A", "at43usb320a"}, {"AT43USB325", "at43usb325"}, {"AT43USB326", "at43usb326"}, diff --git a/src/plugins/generator/iarew/archs/avr/avrlinkersettingsgroup_v7.cpp b/src/plugins/generator/iarew/archs/avr/avrlinkersettingsgroup_v7.cpp index 59ba515d9..0af4f088b 100644 --- a/src/plugins/generator/iarew/archs/avr/avrlinkersettingsgroup_v7.cpp +++ b/src/plugins/generator/iarew/archs/avr/avrlinkersettingsgroup_v7.cpp @@ -60,8 +60,7 @@ struct ConfigPageOptions final // Enumerate all product linker config files // (which are set trough 'linkerscript' tag). - const auto qbsGroups = qbsProduct.groups(); - for (const auto &qbsGroup : qbsGroups) { + for (const auto &qbsGroup : qbsProduct.groups()) { const auto qbsArtifacts = qbsGroup.sourceArtifacts(); for (const auto &qbsArtifact : qbsArtifacts) { const auto qbsTags = qbsArtifact.fileTags(); diff --git a/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp b/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp index 43c160045..b3b68377f 100644 --- a/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp +++ b/src/plugins/generator/iarew/archs/mcs51/mcs51generalsettingsgroup_v10.cpp @@ -95,17 +95,15 @@ struct TargetPageOptions final const QString core = IarewUtils::flagValue( flags, QStringLiteral("--core")) .toLower(); - if (core == QLatin1String("plain")) { + // If the core variant is not set, then choose the + // default value, CorePlain (see the compiler datasheet for + // '--core' option). + if (core == QLatin1String("plain") || core.isEmpty()) { cpuCore = TargetPageOptions::CorePlain; } else if (core == QLatin1String("extended1")) { cpuCore = TargetPageOptions::CoreExtended1; } else if (core == QLatin1String("extended2")) { cpuCore = TargetPageOptions::CoreExtended2; - } else { - // If the core variant is not set, then choose the - // default values (see the compiler datasheet for - // '--core' option). - cpuCore = TargetPageOptions::CorePlain; } const QString cm = IarewUtils::flagValue( @@ -119,7 +117,7 @@ struct TargetPageOptions final codeModel = TargetPageOptions::CodeModelFar; } else if (cm == QLatin1String("banked_ext2")) { codeModel = TargetPageOptions::CodeModelBankedExtended2; - } else { + } else if (cm.isEmpty()) { // If the code model is not set, then choose the // default values (see the compiler datasheet for // '--code_model' option). @@ -145,7 +143,7 @@ struct TargetPageOptions final dataModel = TargetPageOptions::DataModelFarGeneric; } else if (dm == QLatin1String("far")) { dataModel = TargetPageOptions::DataModelFar; - } else { + } else if (dm.isEmpty()) { // If the data model is not set, then choose the // default values (see the compiler datasheet for // '--data_model' option). @@ -172,26 +170,26 @@ struct TargetPageOptions final const QString constPlace = IarewUtils::flagValue( flags, QStringLiteral("--place_constants")) .toLower(); - if (constPlace == QLatin1String("data")) { + // If this option is not set, then choose the + // default value (see the compiler datasheet for + // '--place_constants' option). + if (constPlace == QLatin1String("data") || constPlace.isEmpty()) { constPlacement = TargetPageOptions::RamMemoryPlace; } else if (constPlace == QLatin1String("data_rom")) { constPlacement = TargetPageOptions::RomMemoryPlace; } else if (constPlace == QLatin1String("code")) { constPlacement = TargetPageOptions::CodeMemoryPlace; - } else { - // If this option is not set, then choose the - // default value (see the compiler datasheet for - // '--place_constants' option). - constPlacement = TargetPageOptions::RamMemoryPlace; } - const QString cc = IarewUtils::flagValue( flags, QStringLiteral("--calling_convention")).toLower(); if (cc == QLatin1String("data_overlay")) { callingConvention = TargetPageOptions::DataOverlayConvention; } else if (cc == QLatin1String("idata_overlay")) { callingConvention = TargetPageOptions::IDataOverlayConvention; - } else if (cc == QLatin1String("idata_reentrant")) { + } else if (cc == QLatin1String("idata_reentrant") || cc.isEmpty()) { + // If this option is not set, then choose the + // default value (see the compiler datasheet for + // '--calling_convention' option). callingConvention = TargetPageOptions::IDataReentrantConvention; } else if (cc == QLatin1String("pdata_reentrant")) { callingConvention = TargetPageOptions::PDataReentrantConvention; @@ -199,11 +197,6 @@ struct TargetPageOptions final callingConvention = TargetPageOptions::XDataReentrantConvention; } else if (cc == QLatin1String("ext_stack_reentrant")) { callingConvention = TargetPageOptions::ExtendedStackReentrantConvention; - } else { - // If this option is not set, then choose the - // default value (see the compiler datasheet for - // '--calling_convention' option). - callingConvention = TargetPageOptions::IDataReentrantConvention; } } @@ -222,8 +215,7 @@ struct TargetPageOptions final // Enumerate all product linker config files // (which are set trough 'linkerscript' tag). - const auto qbsGroups = qbsProduct.groups(); - for (const auto &qbsGroup : qbsGroups) { + for (const auto &qbsGroup : qbsProduct.groups()) { const auto qbsArtifacts = qbsGroup.sourceArtifacts(); for (const auto &qbsArtifact : qbsArtifacts) { const auto qbsTags = qbsArtifact.fileTags(); @@ -238,7 +230,7 @@ struct TargetPageOptions final } const QString toolkitPath = IarewUtils::toolkitRootPath(qbsProduct); - for (const QVariant &configPath : configPaths) { + for (const QVariant &configPath : std::as_const(configPaths)) { const QString fullConfigPath = configPath.toString(); // We interested only in a config paths shipped inside of a toolkit. if (!fullConfigPath.startsWith(toolkitPath, Qt::CaseInsensitive)) @@ -447,13 +439,12 @@ struct DptrPageOptions final case VisibilityIndex: if (part == QLatin1String("shadowed")) dptrVisibility = DptrPageOptions::DptrShadowed; - else if (part == QLatin1String("separate")) - dptrVisibility = DptrPageOptions::DptrSeparate; - else - // If this option is not set, then choose the + else if (part == QLatin1String("separate") || part.isEmpty()) { + // If this option is not set or set to "separate", then choose the // default value (see the compiler datasheet for // '--dptr' option). dptrVisibility = DptrPageOptions::DptrSeparate; + } break; case SwitchMethodIndex: if (part == QLatin1String("inc")) { @@ -648,30 +639,22 @@ struct LibraryOptionsPageOptions final Qt::CaseInsensitive)) { const QString prop = flag.split( QLatin1Char('=')).at(0).toLower(); + // see the compiler datasheet for the '_formatted_write' option. if (prop == QLatin1String("-e_large_write")) printfFormatter = LibraryOptionsPageOptions::PrintfLargeFormatter; else if (prop == QLatin1String("-e_medium_write")) printfFormatter = LibraryOptionsPageOptions::PrintfMediumFormatter; else if (prop == QLatin1String("-e_small_write")) printfFormatter = LibraryOptionsPageOptions::PrintfSmallFormatter; - else - // If this option is not set, then choose the - // default value (see the compiler datasheet for - // '_formatted_write' option). - printfFormatter = LibraryOptionsPageOptions::PrintfMediumFormatter; } else if (flag.endsWith(QLatin1String("_formatted_read"), Qt::CaseInsensitive)) { const QString prop = flag.split(QLatin1Char('=')) .at(0).toLower(); + // see the compiler datasheet for the '_formatted_read' option. if (prop == QLatin1String("-e_large_read")) scanfFormatter = LibraryOptionsPageOptions::ScanfLargeFormatter; else if (prop == QLatin1String("-e_medium_read")) scanfFormatter = LibraryOptionsPageOptions::ScanfMediumFormatter; - else - // If this option is not set, then choose the - // default value (see the compiler datasheet for - // '_formatted_read' option). - scanfFormatter = LibraryOptionsPageOptions::ScanfMediumFormatter; } } } diff --git a/src/plugins/generator/iarew/archs/mcs51/mcs51linkersettingsgroup_v10.cpp b/src/plugins/generator/iarew/archs/mcs51/mcs51linkersettingsgroup_v10.cpp index a88ac22e1..d2c7f3846 100644 --- a/src/plugins/generator/iarew/archs/mcs51/mcs51linkersettingsgroup_v10.cpp +++ b/src/plugins/generator/iarew/archs/mcs51/mcs51linkersettingsgroup_v10.cpp @@ -59,8 +59,7 @@ struct ConfigPageOptions final // Enumerate all product linker config files // (which are set trough 'linkerscript' tag). - const auto qbsGroups = qbsProduct.groups(); - for (const auto &qbsGroup : qbsGroups) { + for (const auto &qbsGroup : qbsProduct.groups()) { const auto qbsArtifacts = qbsGroup.sourceArtifacts(); for (const auto &qbsArtifact : qbsArtifacts) { const auto qbsTags = qbsArtifact.fileTags(); diff --git a/src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp b/src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp index ac1c475d1..7b330ca7f 100644 --- a/src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp +++ b/src/plugins/generator/iarew/archs/msp430/msp430generalsettingsgroup_v7.cpp @@ -117,8 +117,7 @@ struct TargetPageOptions final // Enumerate all product linker config files // (which are set trough 'linkerscript' tag). - const auto qbsGroups = qbsProduct.groups(); - for (const auto &qbsGroup : qbsGroups) { + for (const auto &qbsGroup : qbsProduct.groups()) { const auto qbsArtifacts = qbsGroup.sourceArtifacts(); for (const auto &qbsArtifact : qbsArtifacts) { const auto qbsTags = qbsArtifact.fileTags(); @@ -282,7 +281,7 @@ struct LibraryOptionsPageOptions final else if (prop == QLatin1String("_printflarge")) printfFormatter = PrintfLargeFormatter; else if (prop == QLatin1String("_printflargenomb")) - printfFormatter = PrintfLargeFormatter; + printfFormatter = PrintfLargeNoMultibytesFormatter; else if (prop == QLatin1String("_printfsmall")) printfFormatter = PrintfSmallFormatter; else if (prop == QLatin1String("_printfsmallnomb")) @@ -300,7 +299,7 @@ struct LibraryOptionsPageOptions final else if (prop == QLatin1String("_scanflarge")) scanfFormatter = ScanfLargeFormatter; else if (prop == QLatin1String("_scanflargenomb")) - scanfFormatter = ScanfLargeFormatter; + scanfFormatter = ScanfLargeNoMultibytesFormatter; else if (prop == QLatin1String("_scanfsmall")) scanfFormatter = ScanfSmallFormatter; else if (prop == QLatin1String("_scanfsmallnomb")) diff --git a/src/plugins/generator/iarew/archs/msp430/msp430linkersettingsgroup_v7.cpp b/src/plugins/generator/iarew/archs/msp430/msp430linkersettingsgroup_v7.cpp index b85edbb83..85aac7e83 100644 --- a/src/plugins/generator/iarew/archs/msp430/msp430linkersettingsgroup_v7.cpp +++ b/src/plugins/generator/iarew/archs/msp430/msp430linkersettingsgroup_v7.cpp @@ -56,8 +56,7 @@ struct ConfigPageOptions final // Enumerate all product linker config files // (which are set trough 'linkerscript' tag). - const auto qbsGroups = qbsProduct.groups(); - for (const auto &qbsGroup : qbsGroups) { + for (const auto &qbsGroup : qbsProduct.groups()) { const auto qbsArtifacts = qbsGroup.sourceArtifacts(); for (const auto &qbsArtifact : qbsArtifacts) { const auto qbsTags = qbsArtifact.fileTags(); diff --git a/src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp b/src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp index 9477bc36e..83766442b 100644 --- a/src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp +++ b/src/plugins/generator/iarew/archs/stm8/stm8generalsettingsgroup_v3.cpp @@ -205,7 +205,7 @@ struct LibraryOptionsPageOptions final else if (prop == QLatin1String("_printffullnomb")) printfFormatter = PrintfFullNoMultibytesFormatter; else if (prop == QLatin1String("_printflarge")) - printfFormatter = PrintfLargeFormatter; + printfFormatter = PrintfLargeNoMultibytesFormatter; else if (prop == QLatin1String("_printflargenomb")) printfFormatter = PrintfLargeFormatter; else if (prop == QLatin1String("_printfsmall")) @@ -223,7 +223,7 @@ struct LibraryOptionsPageOptions final else if (prop == QLatin1String("_scanffullnomb")) scanfFormatter = ScanfFullNoMultibytesFormatter; else if (prop == QLatin1String("_scanflarge")) - scanfFormatter = ScanfLargeFormatter; + scanfFormatter = ScanfLargeNoMultibytesFormatter; else if (prop == QLatin1String("_scanflargenomb")) scanfFormatter = ScanfLargeFormatter; else if (prop == QLatin1String("_scanfsmall")) diff --git a/src/plugins/generator/iarew/archs/stm8/stm8linkersettingsgroup_v3.cpp b/src/plugins/generator/iarew/archs/stm8/stm8linkersettingsgroup_v3.cpp index 2d3780e4f..441333976 100644 --- a/src/plugins/generator/iarew/archs/stm8/stm8linkersettingsgroup_v3.cpp +++ b/src/plugins/generator/iarew/archs/stm8/stm8linkersettingsgroup_v3.cpp @@ -32,6 +32,8 @@ #include "../../iarewutils.h" +#include <tools/stlutils.h> + #include <QtCore/qdir.h> namespace qbs { @@ -56,8 +58,7 @@ struct ConfigPageOptions final // Enumerate all product linker config files // (which are set trough 'linkerscript' tag). - const auto qbsGroups = qbsProduct.groups(); - for (const auto &qbsGroup : qbsGroups) { + for (const auto &qbsGroup : qbsProduct.groups()) { const auto qbsArtifacts = qbsGroup.sourceArtifacts(); for (const auto &qbsArtifact : qbsArtifacts) { const auto qbsTags = qbsArtifact.fileTags(); @@ -101,14 +102,11 @@ struct ConfigPageOptions final // on the general page). configDefinitions = IarewUtils::flagValues( flags, QStringLiteral("--config_def")); - configDefinitions.erase(std::remove_if( - configDefinitions.begin(), - configDefinitions.end(), - [](const auto &definition){ + Internal::removeIf(configDefinitions, [](const auto &definition){ const auto def = definition.toString(); return def.startsWith(QLatin1String("_CSTACK_SIZE")) || def.startsWith(QLatin1String("_HEAP_SIZE")); - }), configDefinitions.end()); + }); } QVariantList configFilePaths; @@ -175,7 +173,7 @@ struct OptimizationsPageOptions final QLatin1String("--merge_duplicate_sections")); } - bool mergeDuplicateSections = 0; + bool mergeDuplicateSections = true; }; // Output page options. @@ -192,7 +190,7 @@ struct OutputPageOptions final } QString outputFile; - bool enableDebugInfo = 1; + bool enableDebugInfo = true; }; // List page options. diff --git a/src/plugins/generator/iarew/iarew.pri b/src/plugins/generator/iarew/iarew.pri deleted file mode 100644 index 68a3593fa..000000000 --- a/src/plugins/generator/iarew/iarew.pri +++ /dev/null @@ -1 +0,0 @@ -qbsPluginTarget = iarewgenerator diff --git a/src/plugins/generator/iarew/iarew.pro b/src/plugins/generator/iarew/iarew.pro deleted file mode 100644 index 074635047..000000000 --- a/src/plugins/generator/iarew/iarew.pro +++ /dev/null @@ -1,132 +0,0 @@ -include(iarew.pri) -include(../../plugins.pri) -include(../../../shared/json/json.pri) - -QT = core - -# Plugin file. - -SOURCES += \ - $$PWD/iarewgeneratorplugin.cpp \ - -# Common files. - -HEADERS += \ - $$PWD/iarewfileversionproperty.h \ - $$PWD/iarewgenerator.h \ - $$PWD/iarewoptionpropertygroup.h \ - $$PWD/iarewproject.h \ - $$PWD/iarewprojectwriter.h \ - $$PWD/iarewsettingspropertygroup.h \ - $$PWD/iarewsourcefilepropertygroup.h \ - $$PWD/iarewsourcefilespropertygroup.h \ - $$PWD/iarewtoolchainpropertygroup.h \ - $$PWD/iarewutils.h \ - $$PWD/iarewversioninfo.h \ - $$PWD/iarewworkspace.h \ - $$PWD/iarewworkspacewriter.h - -SOURCES += \ - $$PWD/iarewfileversionproperty.cpp \ - $$PWD/iarewgenerator.cpp \ - $$PWD/iarewoptionpropertygroup.cpp \ - $$PWD/iarewproject.cpp \ - $$PWD/iarewprojectwriter.cpp \ - $$PWD/iarewsettingspropertygroup.cpp \ - $$PWD/iarewsourcefilepropertygroup.cpp \ - $$PWD/iarewsourcefilespropertygroup.cpp \ - $$PWD/iarewtoolchainpropertygroup.cpp \ - $$PWD/iarewutils.cpp \ - $$PWD/iarewversioninfo.cpp \ - $$PWD/iarewworkspace.cpp \ - $$PWD/iarewworkspacewriter.cpp - -# For ARM architecture. - -HEADERS += \ - $$PWD/archs/arm/armarchiversettingsgroup_v8.h \ - $$PWD/archs/arm/armassemblersettingsgroup_v8.h \ - $$PWD/archs/arm/armbuildconfigurationgroup_v8.h \ - $$PWD/archs/arm/armcompilersettingsgroup_v8.h \ - $$PWD/archs/arm/armgeneralsettingsgroup_v8.h \ - $$PWD/archs/arm/armlinkersettingsgroup_v8.h - -SOURCES += \ - $$PWD/archs/arm/armarchiversettingsgroup_v8.cpp \ - $$PWD/archs/arm/armassemblersettingsgroup_v8.cpp \ - $$PWD/archs/arm/armbuildconfigurationgroup_v8.cpp \ - $$PWD/archs/arm/armcompilersettingsgroup_v8.cpp \ - $$PWD/archs/arm/armgeneralsettingsgroup_v8.cpp \ - $$PWD/archs/arm/armlinkersettingsgroup_v8.cpp - -# For AVR architecture. - -HEADERS += \ - $$PWD/archs/avr/avrarchiversettingsgroup_v7.h \ - $$PWD/archs/avr/avrassemblersettingsgroup_v7.h \ - $$PWD/archs/avr/avrbuildconfigurationgroup_v7.h \ - $$PWD/archs/avr/avrcompilersettingsgroup_v7.h \ - $$PWD/archs/avr/avrgeneralsettingsgroup_v7.h \ - $$PWD/archs/avr/avrlinkersettingsgroup_v7.h - -SOURCES += \ - $$PWD/archs/avr/avrarchiversettingsgroup_v7.cpp \ - $$PWD/archs/avr/avrassemblersettingsgroup_v7.cpp \ - $$PWD/archs/avr/avrbuildconfigurationgroup_v7.cpp \ - $$PWD/archs/avr/avrcompilersettingsgroup_v7.cpp \ - $$PWD/archs/avr/avrgeneralsettingsgroup_v7.cpp \ - $$PWD/archs/avr/avrlinkersettingsgroup_v7.cpp - -# For MCS51 architecture. - -HEADERS += \ - $$PWD/archs/mcs51/mcs51archiversettingsgroup_v10.h \ - $$PWD/archs/mcs51/mcs51assemblersettingsgroup_v10.h \ - $$PWD/archs/mcs51/mcs51buildconfigurationgroup_v10.h \ - $$PWD/archs/mcs51/mcs51compilersettingsgroup_v10.h \ - $$PWD/archs/mcs51/mcs51generalsettingsgroup_v10.h \ - $$PWD/archs/mcs51/mcs51linkersettingsgroup_v10.h - -SOURCES += \ - $$PWD/archs/mcs51/mcs51archiversettingsgroup_v10.cpp \ - $$PWD/archs/mcs51/mcs51assemblersettingsgroup_v10.cpp \ - $$PWD/archs/mcs51/mcs51buildconfigurationgroup_v10.cpp \ - $$PWD/archs/mcs51/mcs51compilersettingsgroup_v10.cpp \ - $$PWD/archs/mcs51/mcs51generalsettingsgroup_v10.cpp \ - $$PWD/archs/mcs51/mcs51linkersettingsgroup_v10.cpp - -# For STM8 architecture. - -HEADERS += \ - $$PWD/archs/stm8/stm8archiversettingsgroup_v3.h \ - $$PWD/archs/stm8/stm8assemblersettingsgroup_v3.h \ - $$PWD/archs/stm8/stm8buildconfigurationgroup_v3.h \ - $$PWD/archs/stm8/stm8compilersettingsgroup_v3.h \ - $$PWD/archs/stm8/stm8generalsettingsgroup_v3.h \ - $$PWD/archs/stm8/stm8linkersettingsgroup_v3.h - -SOURCES += \ - $$PWD/archs/stm8/stm8archiversettingsgroup_v3.cpp \ - $$PWD/archs/stm8/stm8assemblersettingsgroup_v3.cpp \ - $$PWD/archs/stm8/stm8buildconfigurationgroup_v3.cpp \ - $$PWD/archs/stm8/stm8compilersettingsgroup_v3.cpp \ - $$PWD/archs/stm8/stm8generalsettingsgroup_v3.cpp \ - $$PWD/archs/stm8/stm8linkersettingsgroup_v3.cpp - -# For MSP430 architecture. - -HEADERS += \ - $$PWD/archs/msp430/msp430archiversettingsgroup_v7.h \ - $$PWD/archs/msp430/msp430assemblersettingsgroup_v7.h \ - $$PWD/archs/msp430/msp430buildconfigurationgroup_v7.h \ - $$PWD/archs/msp430/msp430compilersettingsgroup_v7.h \ - $$PWD/archs/msp430/msp430generalsettingsgroup_v7.h \ - $$PWD/archs/msp430/msp430linkersettingsgroup_v7.h - -SOURCES += \ - $$PWD/archs/msp430/msp430archiversettingsgroup_v7.cpp \ - $$PWD/archs/msp430/msp430assemblersettingsgroup_v7.cpp \ - $$PWD/archs/msp430/msp430buildconfigurationgroup_v7.cpp \ - $$PWD/archs/msp430/msp430compilersettingsgroup_v7.cpp \ - $$PWD/archs/msp430/msp430generalsettingsgroup_v7.cpp \ - $$PWD/archs/msp430/msp430linkersettingsgroup_v7.cpp diff --git a/src/plugins/generator/iarew/iarew.qbs b/src/plugins/generator/iarew/iarew.qbs index 7b2270426..cf1af83b8 100644 --- a/src/plugins/generator/iarew/iarew.qbs +++ b/src/plugins/generator/iarew/iarew.qbs @@ -1,4 +1,3 @@ -import qbs import "../../qbsplugin.qbs" as QbsPlugin QbsPlugin { @@ -31,7 +30,6 @@ QbsPlugin { "iarewtoolchainpropertygroup.h", "iarewutils.cpp", "iarewutils.h", - "iarewversioninfo.cpp", "iarewversioninfo.h", "iarewworkspace.cpp", "iarewworkspace.h", diff --git a/src/plugins/generator/iarew/iarewfileversionproperty.cpp b/src/plugins/generator/iarew/iarewfileversionproperty.cpp index b84f37301..4324405a1 100644 --- a/src/plugins/generator/iarew/iarewfileversionproperty.cpp +++ b/src/plugins/generator/iarew/iarewfileversionproperty.cpp @@ -33,7 +33,7 @@ namespace qbs { -static QByteArray buildFileVersion(const IarewVersionInfo &versionInfo) +static QByteArray buildFileVersion(const gen::VersionInfo &versionInfo) { switch (versionInfo.marketingVersion()) { case 3: @@ -47,7 +47,7 @@ static QByteArray buildFileVersion(const IarewVersionInfo &versionInfo) } IarewFileVersionProperty::IarewFileVersionProperty( - const IarewVersionInfo &versionInfo) + const gen::VersionInfo &versionInfo) { setName(QByteArrayLiteral("fileVersion")); const QByteArray fileVersion = buildFileVersion(versionInfo); diff --git a/src/plugins/generator/iarew/iarewfileversionproperty.h b/src/plugins/generator/iarew/iarewfileversionproperty.h index d377979fa..2ed56c1e6 100644 --- a/src/plugins/generator/iarew/iarewfileversionproperty.h +++ b/src/plugins/generator/iarew/iarewfileversionproperty.h @@ -31,17 +31,16 @@ #ifndef QBS_IAREWFILEVERSIONPROPERTY_H #define QBS_IAREWFILEVERSIONPROPERTY_H +#include <generators/generatorversioninfo.h> #include <generators/xmlproperty.h> namespace qbs { -class IarewVersionInfo; - class IarewFileVersionProperty final : public gen::xml::Property { public: explicit IarewFileVersionProperty( - const IarewVersionInfo &versionInfo); + const gen::VersionInfo &versionInfo); }; } // namespace qbs diff --git a/src/plugins/generator/iarew/iarewgenerator.cpp b/src/plugins/generator/iarew/iarewgenerator.cpp index e6b308182..c5345a6dd 100644 --- a/src/plugins/generator/iarew/iarewgenerator.cpp +++ b/src/plugins/generator/iarew/iarewgenerator.cpp @@ -96,7 +96,7 @@ static void writeWorkspace(const std::shared_ptr<IarewWorkspace> &wokspace, QFileInfo(workspaceFilePath).fileName()); } -IarewGenerator::IarewGenerator(const IarewVersionInfo &versionInfo) +IarewGenerator::IarewGenerator(const gen::VersionInfo &versionInfo) : m_versionInfo(versionInfo) { } diff --git a/src/plugins/generator/iarew/iarewgenerator.h b/src/plugins/generator/iarew/iarewgenerator.h index f8c1298f0..fa1d93bc3 100644 --- a/src/plugins/generator/iarew/iarewgenerator.h +++ b/src/plugins/generator/iarew/iarewgenerator.h @@ -44,7 +44,7 @@ class IarewWorkspace; class IarewGenerator final : public ProjectGenerator, private IGeneratableProjectVisitor { public: - explicit IarewGenerator(const IarewVersionInfo &versionInfo); + explicit IarewGenerator(const gen::VersionInfo &versionInfo); QString generatorName() const final; void generate() final; @@ -59,7 +59,7 @@ private: const GeneratableProjectData &projectData, const GeneratableProductData &productData) final; - const IarewVersionInfo m_versionInfo; + const gen::VersionInfo m_versionInfo; std::shared_ptr<IarewWorkspace> m_workspace; QString m_workspaceFilePath; std::map<QString, std::shared_ptr<IarewProject>> m_projects; diff --git a/src/plugins/generator/iarew/iarewgeneratorplugin.cpp b/src/plugins/generator/iarew/iarewgeneratorplugin.cpp index bd75c7ad5..bdd15c485 100644 --- a/src/plugins/generator/iarew/iarewgeneratorplugin.cpp +++ b/src/plugins/generator/iarew/iarewgeneratorplugin.cpp @@ -45,7 +45,7 @@ static void QbsIarewGeneratorPluginLoad() { - for (const auto &info : qbs::IarewVersionInfo::knownVersions()) { + for (const auto &info : qbs::IarewVersionInfo::knownVersions) { qbs::ProjectGeneratorManager::registerGenerator( std::make_shared<qbs::IarewGenerator>(info)); } diff --git a/src/plugins/generator/iarew/iarewoptionpropertygroup.cpp b/src/plugins/generator/iarew/iarewoptionpropertygroup.cpp index bfe2c4548..c44b30ed2 100644 --- a/src/plugins/generator/iarew/iarewoptionpropertygroup.cpp +++ b/src/plugins/generator/iarew/iarewoptionpropertygroup.cpp @@ -33,12 +33,12 @@ namespace qbs { IarewOptionPropertyGroup::IarewOptionPropertyGroup( - QByteArray name, QVariantList states, int version) + const QByteArray &name, QVariantList states, int version) : gen::xml::PropertyGroup(QByteArrayLiteral("option")) { // Append name property item. appendChild<gen::xml::Property>(QByteArrayLiteral("name"), - std::move(name)); + name); // Append version property item. if (version >= 0) diff --git a/src/plugins/generator/iarew/iarewoptionpropertygroup.h b/src/plugins/generator/iarew/iarewoptionpropertygroup.h index 8844537c3..d80df2838 100644 --- a/src/plugins/generator/iarew/iarewoptionpropertygroup.h +++ b/src/plugins/generator/iarew/iarewoptionpropertygroup.h @@ -41,7 +41,7 @@ class IarewOptionPropertyGroup final : public gen::xml::PropertyGroup { public: - explicit IarewOptionPropertyGroup(QByteArray name, QVariantList states, + explicit IarewOptionPropertyGroup(const QByteArray &name, QVariantList states, int version = -1); }; diff --git a/src/plugins/generator/iarew/iarewproject.cpp b/src/plugins/generator/iarew/iarewproject.cpp index 3e6a03ac2..0387ae114 100644 --- a/src/plugins/generator/iarew/iarewproject.cpp +++ b/src/plugins/generator/iarew/iarewproject.cpp @@ -42,11 +42,13 @@ #include <logging/translator.h> +#include <tools/stlutils.h> + namespace qbs { IarewProject::IarewProject(const GeneratableProject &genProject, const GeneratableProductData &genProduct, - const IarewVersionInfo &versionInfo) + const gen::VersionInfo &versionInfo) { Q_ASSERT(genProject.projects.size() == genProject.commandLines.size()); Q_ASSERT(genProject.projects.size() == genProduct.data.size()); @@ -112,12 +114,10 @@ IarewProject::IarewProject(const GeneratableProject &genProject, continue; auto sourceArtifacts = group.sourceArtifacts(); // Remove the linker script artifacts. - sourceArtifacts.erase(std::remove_if(sourceArtifacts.begin(), - sourceArtifacts.end(), - [](const auto &artifact){ + Internal::removeIf(sourceArtifacts, [](const auto &artifact) { const auto tags = artifact.fileTags(); return tags.contains(QLatin1String("linkerscript")); - }), sourceArtifacts.end()); + }); if (sourceArtifacts.isEmpty()) continue; diff --git a/src/plugins/generator/iarew/iarewproject.h b/src/plugins/generator/iarew/iarewproject.h index 567a58c55..df260fcd8 100644 --- a/src/plugins/generator/iarew/iarewproject.h +++ b/src/plugins/generator/iarew/iarewproject.h @@ -39,14 +39,12 @@ namespace qbs { -class IarewVersionInfo; - class IarewProject final : public gen::xml::Project { public: explicit IarewProject(const GeneratableProject &genProject, const GeneratableProductData &genProduct, - const IarewVersionInfo &versionInfo); + const gen::VersionInfo &versionInfo); private: std::vector<std::unique_ptr<gen::xml::PropertyGroupFactory>> m_factories; }; diff --git a/src/plugins/generator/iarew/iarewsettingspropertygroup.cpp b/src/plugins/generator/iarew/iarewsettingspropertygroup.cpp index 1f08783ae..a07d59e0f 100644 --- a/src/plugins/generator/iarew/iarewsettingspropertygroup.cpp +++ b/src/plugins/generator/iarew/iarewsettingspropertygroup.cpp @@ -63,7 +63,7 @@ IarewSettingsPropertyGroup::IarewSettingsPropertyGroup() QByteArrayLiteral("debug"), QVariant{}); } -void IarewSettingsPropertyGroup::setName(QByteArray name) +void IarewSettingsPropertyGroup::setName(const QByteArray &name) { // There is no way to move-construct a QVariant from T, thus name is shallow-copied m_nameProperty->setValue(QVariant(name)); @@ -96,12 +96,11 @@ void IarewSettingsPropertyGroup::setDataDebugInfo(int debugInfo) } void IarewSettingsPropertyGroup::addOptionsGroup( - QByteArray name, + const QByteArray &name, QVariantList states, int version) { - m_dataPropertyGroup->appendChild<IarewOptionPropertyGroup>( - std::move(name), std::move(states), version); + m_dataPropertyGroup->appendChild<IarewOptionPropertyGroup>(name, std::move(states), version); } } // namespace qbs diff --git a/src/plugins/generator/iarew/iarewsettingspropertygroup.h b/src/plugins/generator/iarew/iarewsettingspropertygroup.h index 5ef9ef75c..b1feebcc7 100644 --- a/src/plugins/generator/iarew/iarewsettingspropertygroup.h +++ b/src/plugins/generator/iarew/iarewsettingspropertygroup.h @@ -40,7 +40,7 @@ class IarewSettingsPropertyGroup : public gen::xml::PropertyGroup public: explicit IarewSettingsPropertyGroup(); - void setName(QByteArray name); + void setName(const QByteArray &name); QByteArray name() const; void setArchiveVersion(int archiveVersion); @@ -50,7 +50,7 @@ protected: void setDataVersion(int dataVersion); void setDataDebugInfo(int debugInfo); - void addOptionsGroup(QByteArray name, QVariantList states, + void addOptionsGroup(const QByteArray &name, QVariantList states, int version = -1); private: diff --git a/src/plugins/generator/iarew/iarewutils.cpp b/src/plugins/generator/iarew/iarewutils.cpp index f00fce026..9d39ab264 100644 --- a/src/plugins/generator/iarew/iarewutils.cpp +++ b/src/plugins/generator/iarew/iarewutils.cpp @@ -76,7 +76,7 @@ QString projectRelativeFilePath(const QString &basePath, OutputBinaryType outputBinaryType(const ProductData &qbsProduct) { - const auto qbsProductType = qbsProduct.type(); + const auto &qbsProductType = qbsProduct.type(); if (qbsProductType.contains(QLatin1String("application"))) return ApplicationOutputType; if (qbsProductType.contains(QLatin1String("staticlibrary"))) @@ -105,9 +105,9 @@ QString flagValue(const QStringList &flags, const QString &flagKey) // Check that option is in form of 'flagKey=<flagValue>'. if (flagIt->contains(QLatin1Char('='))) { value = flagIt->split(QLatin1Char('=')).at(1).trimmed(); - } else if (flagKey.count() < flagIt->count()) { + } else if (flagKey.size() < flagIt->size()) { // In this case an option is in form of 'flagKey<flagValue>'. - value = flagIt->mid(flagKey.count()).trimmed(); + value = flagIt->mid(flagKey.size()).trimmed(); } else { // In this case an option is in form of 'flagKey <flagValue>'. ++flagIt; diff --git a/src/plugins/generator/iarew/iarewversioninfo.cpp b/src/plugins/generator/iarew/iarewversioninfo.cpp deleted file mode 100644 index 41a788e98..000000000 --- a/src/plugins/generator/iarew/iarewversioninfo.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 Denis Shienkov <denis.shienkov@gmail.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qbs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "iarewversioninfo.h" - -#include <QtCore/qdebug.h> - -namespace qbs { - -IarewVersionInfo::IarewVersionInfo( - const Version &version, - const std::set<gen::utils::Architecture> &archs) - : gen::VersionInfo(version, archs) -{ -} - -std::set<IarewVersionInfo> IarewVersionInfo::knownVersions() -{ - static const std::set<IarewVersionInfo> known = { - {Version(8), {gen::utils::Architecture::Arm}}, - {Version(7), {gen::utils::Architecture::Avr, - gen::utils::Architecture::Msp430}}, - {Version(10), {gen::utils::Architecture::Mcs51}}, - {Version(3), {gen::utils::Architecture::Stm8}}, - }; - return known; -} - -int IarewVersionInfo::marketingVersion() const -{ - const auto mv = gen::VersionInfo::marketingVersion(); - for (const IarewVersionInfo &known : knownVersions()) { - if (known.version().majorVersion() == mv) - return mv; - } - qWarning() << QStringLiteral("Unrecognized IAR EW version: ") - << version().toString(); - return 0; -} - -} // namespace qbs diff --git a/src/plugins/generator/iarew/iarewversioninfo.h b/src/plugins/generator/iarew/iarewversioninfo.h index 4fd1b1fbc..3dc459557 100644 --- a/src/plugins/generator/iarew/iarewversioninfo.h +++ b/src/plugins/generator/iarew/iarewversioninfo.h @@ -44,18 +44,17 @@ #include <generators/generatorversioninfo.h> namespace qbs { - -class IarewVersionInfo final : public gen::VersionInfo -{ -public: - IarewVersionInfo(const Version &version, - const std::set<gen::utils::Architecture> &archs); - - int marketingVersion() const final; - - static std::set<IarewVersionInfo> knownVersions(); +namespace IarewVersionInfo { + +constexpr gen::VersionInfo knownVersions[] = { + {Version(8), {gen::utils::Architecture::Arm}}, + {Version(7), {gen::utils::Architecture::Avr, + gen::utils::Architecture::Msp430}}, + {Version(10), {gen::utils::Architecture::Mcs51}}, + {Version(3), {gen::utils::Architecture::Stm8}}, }; +} // namespace IarewVersionInfo } // namespace qbs #endif // QBS_IAREWVERSIONINFO_H diff --git a/src/plugins/generator/keiluv/CMakeLists.txt b/src/plugins/generator/keiluv/CMakeLists.txt new file mode 100644 index 000000000..3b4afbe16 --- /dev/null +++ b/src/plugins/generator/keiluv/CMakeLists.txt @@ -0,0 +1,80 @@ +set(COMMON_SOURCES + keiluvfilesgroupspropertygroup.cpp + keiluvfilesgroupspropertygroup.h + keiluvgenerator.cpp + keiluvgenerator.h + keiluvgeneratorplugin.cpp + keiluvproject.cpp + keiluvproject.h + keiluvprojectwriter.cpp + keiluvprojectwriter.h + keiluvutils.cpp + keiluvutils.h + keiluvversioninfo.h + keiluvworkspace.cpp + keiluvworkspace.h + keiluvworkspacewriter.cpp + keiluvworkspacewriter.h + ) + +set(ARCHS_ARM_SOURCES + armbuildtargetgroup_v5.cpp + armbuildtargetgroup_v5.h + armcommonpropertygroup_v5.cpp + armcommonpropertygroup_v5.h + armdebugoptiongroup_v5.cpp + armdebugoptiongroup_v5.h + armdlloptiongroup_v5.cpp + armdlloptiongroup_v5.h + armtargetassemblergroup_v5.cpp + armtargetassemblergroup_v5.h + armtargetcommonoptionsgroup_v5.cpp + armtargetcommonoptionsgroup_v5.h + armtargetcompilergroup_v5.cpp + armtargetcompilergroup_v5.h + armtargetgroup_v5.cpp + armtargetgroup_v5.h + armtargetlinkergroup_v5.cpp + armtargetlinkergroup_v5.h + armtargetmiscgroup_v5.cpp + armtargetmiscgroup_v5.h + armutilitiesgroup_v5.cpp + armutilitiesgroup_v5.h + ) +list_transform_prepend(ARCHS_ARM_SOURCES archs/arm/) + +set(ARCHS_MCS51_SOURCES + mcs51buildtargetgroup_v5.cpp + mcs51buildtargetgroup_v5.h + mcs51commonpropertygroup_v5.cpp + mcs51commonpropertygroup_v5.h + mcs51debugoptiongroup_v5.cpp + mcs51debugoptiongroup_v5.h + mcs51dlloptiongroup_v5.cpp + mcs51dlloptiongroup_v5.h + mcs51targetassemblergroup_v5.cpp + mcs51targetassemblergroup_v5.h + mcs51targetcommonoptionsgroup_v5.cpp + mcs51targetcommonoptionsgroup_v5.h + mcs51targetcompilergroup_v5.cpp + mcs51targetcompilergroup_v5.h + mcs51targetgroup_v5.cpp + mcs51targetgroup_v5.h + mcs51targetlinkergroup_v5.cpp + mcs51targetlinkergroup_v5.h + mcs51targetmiscgroup_v5.cpp + mcs51targetmiscgroup_v5.h + mcs51utilitiesgroup_v5.cpp + mcs51utilitiesgroup_v5.h + mcs51utils.cpp + mcs51utils.h + ) +list_transform_prepend(ARCHS_MCS51_SOURCES archs/mcs51/) + +add_qbs_plugin(keiluvgenerator + DEPENDS qbscore qbsjson + SOURCES + ${COMMON_SOURCES} + ${ARCHS_ARM_SOURCES} + ${ARCHS_MCS51_SOURCES} + ) diff --git a/src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp b/src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp index 0ffbcaa5b..f7e3de3d9 100644 --- a/src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp +++ b/src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp @@ -41,7 +41,7 @@ namespace v5 { namespace { -static const struct DeviceEntry { +const struct DeviceEntry { QByteArray cpu; // CPU option. std::set<QByteArray> fpus; // FPU's options. QByteArray device; // Project file entry. diff --git a/src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp b/src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp index 930aae020..f2bc8367e 100644 --- a/src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp +++ b/src/plugins/generator/keiluv/archs/arm/armtargetlinkergroup_v5.cpp @@ -34,6 +34,8 @@ #include <generators/generatorutils.h> +#include <tools/stlutils.h> + namespace qbs { namespace keiluv { namespace arm { @@ -64,8 +66,7 @@ struct LinkerPageOptions final // Enumerate all product linker config files // (which are set trough 'linkerscript' tag). - const auto qbsGroups = qbsProduct.groups(); - for (const auto &qbsGroup : qbsGroups) { + for (const auto &qbsGroup : qbsProduct.groups()) { if (!qbsGroup.isEnabled()) continue; const auto qbsArtifacts = qbsGroup.sourceArtifacts(); @@ -92,18 +93,15 @@ struct LinkerPageOptions final // Transform all paths to relative. const QString baseDirectory = qbs::gen::utils::buildRootPath(qbsProject); - std::transform(scatterFiles.begin(), scatterFiles.end(), - std::back_inserter(scatterFiles), - [baseDirectory](const QString &scatterFile) { - return gen::utils::relativeFilePath(baseDirectory, scatterFile); - }); + Internal::transform(scatterFiles, [&baseDirectory](const auto &file) { + return gen::utils::relativeFilePath(baseDirectory, file); }); // Make a first scatter file as a main scatter file. // Other scatter files will be interpretes as a misc controls. if (scatterFiles.count() > 0) mainScatterFile = scatterFiles.takeFirst(); - for (const auto &scatterFile : qAsConst(scatterFiles)) { + for (const auto &scatterFile : std::as_const(scatterFiles)) { const auto control = QStringLiteral("--scatter %1").arg(scatterFile); miscControls.push_back(control); } diff --git a/src/plugins/generator/keiluv/archs/mcs51/mcs51utils.cpp b/src/plugins/generator/keiluv/archs/mcs51/mcs51utils.cpp index 698f0df78..70ec47a62 100644 --- a/src/plugins/generator/keiluv/archs/mcs51/mcs51utils.cpp +++ b/src/plugins/generator/keiluv/archs/mcs51/mcs51utils.cpp @@ -30,6 +30,8 @@ #include "mcs51utils.h" +#include <tools/stlutils.h> + namespace qbs { namespace keiluv { namespace mcs51 { @@ -71,8 +73,7 @@ QString flagValue(const QStringList &flags, const QString &flagKey) QStringList flagValueParts(const QString &flagValue, const QLatin1Char &sep) { auto parts = flagValue.split(sep); - std::transform(parts.begin(), parts.end(), parts.begin(), - [](const auto &part) { return part.trimmed(); }); + Internal::transform(parts, [](const auto &part) { return part.trimmed(); }); return parts; } diff --git a/src/plugins/generator/keiluv/keiluv.pri b/src/plugins/generator/keiluv/keiluv.pri deleted file mode 100644 index 6995fb059..000000000 --- a/src/plugins/generator/keiluv/keiluv.pri +++ /dev/null @@ -1 +0,0 @@ -qbsPluginTarget = keiluvgenerator diff --git a/src/plugins/generator/keiluv/keiluv.pro b/src/plugins/generator/keiluv/keiluv.pro deleted file mode 100644 index 52d7c0ed4..000000000 --- a/src/plugins/generator/keiluv/keiluv.pro +++ /dev/null @@ -1,91 +0,0 @@ -include(keiluv.pri) -include(../../plugins.pri) -include(../../../shared/json/json.pri) - -QT = core - -# Plugin file. - -SOURCES += \ - $$PWD/keiluvgeneratorplugin.cpp \ - -# Common files. - -HEADERS += \ - $$PWD/keiluvconstants.h \ - $$PWD/keiluvfilesgroupspropertygroup.h \ - $$PWD/keiluvgenerator.h \ - $$PWD/keiluvproject.h \ - $$PWD/keiluvprojectwriter.h \ - $$PWD/keiluvutils.h \ - $$PWD/keiluvversioninfo.h \ - $$PWD/keiluvworkspace.h \ - $$PWD/keiluvworkspacewriter.h - -SOURCES += \ - $$PWD/keiluvfilesgroupspropertygroup.cpp \ - $$PWD/keiluvgenerator.cpp \ - $$PWD/keiluvproject.cpp \ - $$PWD/keiluvprojectwriter.cpp \ - $$PWD/keiluvutils.cpp \ - $$PWD/keiluvversioninfo.cpp \ - $$PWD/keiluvworkspace.cpp \ - $$PWD/keiluvworkspacewriter.cpp - -# For MCS51 architecture. - -HEADERS += \ - $$PWD/archs/mcs51/mcs51buildtargetgroup_v5.h \ - $$PWD/archs/mcs51/mcs51commonpropertygroup_v5.h \ - $$PWD/archs/mcs51/mcs51debugoptiongroup_v5.h \ - $$PWD/archs/mcs51/mcs51dlloptiongroup_v5.h \ - $$PWD/archs/mcs51/mcs51targetassemblergroup_v5.h \ - $$PWD/archs/mcs51/mcs51targetcommonoptionsgroup_v5.h \ - $$PWD/archs/mcs51/mcs51targetcompilergroup_v5.h \ - $$PWD/archs/mcs51/mcs51targetgroup_v5.h \ - $$PWD/archs/mcs51/mcs51targetlinkergroup_v5.h \ - $$PWD/archs/mcs51/mcs51targetmiscgroup_v5.h \ - $$PWD/archs/mcs51/mcs51utilitiesgroup_v5.h \ - $$PWD/archs/mcs51/mcs51utils.h - -SOURCES += \ - $$PWD/archs/mcs51/mcs51buildtargetgroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51commonpropertygroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51debugoptiongroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51dlloptiongroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51targetassemblergroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51targetcommonoptionsgroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51targetcompilergroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51targetgroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51targetlinkergroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51targetmiscgroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51utilitiesgroup_v5.cpp \ - $$PWD/archs/mcs51/mcs51utils.cpp - -# For ARM architecture. - -HEADERS += \ - $$PWD/archs/arm/armbuildtargetgroup_v5.h \ - $$PWD/archs/arm/armcommonpropertygroup_v5.h \ - $$PWD/archs/arm/armdebugoptiongroup_v5.h \ - $$PWD/archs/arm/armdlloptiongroup_v5.h \ - $$PWD/archs/arm/armtargetassemblergroup_v5.h \ - $$PWD/archs/arm/armtargetcommonoptionsgroup_v5.h \ - $$PWD/archs/arm/armtargetcompilergroup_v5.h \ - $$PWD/archs/arm/armtargetgroup_v5.h \ - $$PWD/archs/arm/armtargetlinkergroup_v5.h \ - $$PWD/archs/arm/armtargetmiscgroup_v5.h \ - $$PWD/archs/arm/armutilitiesgroup_v5.h - -SOURCES += \ - $$PWD/archs/arm/armbuildtargetgroup_v5.cpp \ - $$PWD/archs/arm/armcommonpropertygroup_v5.cpp \ - $$PWD/archs/arm/armdebugoptiongroup_v5.cpp \ - $$PWD/archs/arm/armdlloptiongroup_v5.cpp \ - $$PWD/archs/arm/armtargetassemblergroup_v5.cpp \ - $$PWD/archs/arm/armtargetcommonoptionsgroup_v5.cpp \ - $$PWD/archs/arm/armtargetcompilergroup_v5.cpp \ - $$PWD/archs/arm/armtargetgroup_v5.cpp \ - $$PWD/archs/arm/armtargetlinkergroup_v5.cpp \ - $$PWD/archs/arm/armtargetmiscgroup_v5.cpp \ - $$PWD/archs/arm/armutilitiesgroup_v5.cpp diff --git a/src/plugins/generator/keiluv/keiluv.qbs b/src/plugins/generator/keiluv/keiluv.qbs index 65bf6d65b..6074380b4 100644 --- a/src/plugins/generator/keiluv/keiluv.qbs +++ b/src/plugins/generator/keiluv/keiluv.qbs @@ -1,4 +1,3 @@ -import qbs import "../../qbsplugin.qbs" as QbsPlugin QbsPlugin { @@ -21,7 +20,6 @@ QbsPlugin { "keiluvprojectwriter.h", "keiluvutils.cpp", "keiluvutils.h", - "keiluvversioninfo.cpp", "keiluvversioninfo.h", "keiluvworkspace.cpp", "keiluvworkspace.h", diff --git a/src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp b/src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp index b9a234d6a..79281a153 100644 --- a/src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp +++ b/src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp @@ -33,6 +33,7 @@ #include <generators/generatordata.h> +#include <tools/stlutils.h> #include <tools/stringconstants.h> namespace qbs { @@ -76,22 +77,24 @@ private: if (fileSuffix.compare(QLatin1String("c"), Qt::CaseInsensitive) == 0) { return CSourceFileType; - } else if (fileSuffix.compare(QLatin1String("cpp"), + } + if (fileSuffix.compare(QLatin1String("cpp"), Qt::CaseInsensitive) == 0) { return CppSourceFileType; - } else if (fileSuffix.compare(QLatin1String("s"), + } + if (fileSuffix.compare(QLatin1String("s"), Qt::CaseInsensitive) == 0 || fileSuffix.compare(QLatin1String("a51"), Qt::CaseInsensitive) == 0) { return AssemblerFileType; - } else if (fileSuffix.compare(QLatin1String("lib"), + } + if (fileSuffix.compare(QLatin1String("lib"), Qt::CaseInsensitive) == 0) { return LibraryFileType; - } else { - // All header files, text files and include files - // interpretes as a text file types. - return TextFileType; } + // All header files, text files and include files + // interpretes as a text file types. + return TextFileType; } }; @@ -158,19 +161,16 @@ KeiluvFilesGroupsPropertyGroup::KeiluvFilesGroupsPropertyGroup( const auto baseDirectory = gen::utils::buildRootPath(qbsProject); // Build source items. - const auto groups = qbsProduct.groups(); - for (const auto &group : groups) { + for (const auto &group : qbsProduct.groups()) { // Ignore disabled groups (e.g. when its condition property is false). if (!group.isEnabled()) continue; auto sourceArtifacts = group.sourceArtifacts(); // Remove the linker script artifacts. - sourceArtifacts.erase(std::remove_if(sourceArtifacts.begin(), - sourceArtifacts.end(), - [](const auto &artifact){ + Internal::removeIf(sourceArtifacts, [](const auto &artifact){ const auto tags = artifact.fileTags(); return tags.contains(QLatin1String("linkerscript")); - }), sourceArtifacts.end()); + }); if (sourceArtifacts.isEmpty()) continue; diff --git a/src/plugins/generator/keiluv/keiluvgenerator.cpp b/src/plugins/generator/keiluv/keiluvgenerator.cpp index e3c959e8d..f98f55abe 100644 --- a/src/plugins/generator/keiluv/keiluvgenerator.cpp +++ b/src/plugins/generator/keiluv/keiluvgenerator.cpp @@ -84,7 +84,7 @@ static void writeWorkspace(const std::shared_ptr<KeiluvWorkspace> &wokspace, QFileInfo(workspaceFilePath).fileName()); } -KeiluvGenerator::KeiluvGenerator(const KeiluvVersionInfo &versionInfo) +KeiluvGenerator::KeiluvGenerator(const gen::VersionInfo &versionInfo) : m_versionInfo(versionInfo) { } diff --git a/src/plugins/generator/keiluv/keiluvgenerator.h b/src/plugins/generator/keiluv/keiluvgenerator.h index 769519562..25b89b9c8 100644 --- a/src/plugins/generator/keiluv/keiluvgenerator.h +++ b/src/plugins/generator/keiluv/keiluvgenerator.h @@ -45,7 +45,7 @@ class KeiluvGenerator final : public ProjectGenerator, private IGeneratableProjectVisitor { public: - explicit KeiluvGenerator(const KeiluvVersionInfo &versionInfo); + explicit KeiluvGenerator(const gen::VersionInfo &versionInfo); QString generatorName() const final; void generate() final; @@ -60,7 +60,7 @@ private: const GeneratableProjectData &projectData, const GeneratableProductData &productData) final; - const KeiluvVersionInfo m_versionInfo; + const gen::VersionInfo m_versionInfo; std::shared_ptr<KeiluvWorkspace> m_workspace; QString m_workspaceFilePath; std::map<QString, std::shared_ptr<KeiluvProject>> m_projects; diff --git a/src/plugins/generator/keiluv/keiluvgeneratorplugin.cpp b/src/plugins/generator/keiluv/keiluvgeneratorplugin.cpp index 91b73ef71..abbccc3da 100644 --- a/src/plugins/generator/keiluv/keiluvgeneratorplugin.cpp +++ b/src/plugins/generator/keiluv/keiluvgeneratorplugin.cpp @@ -45,7 +45,7 @@ static void QbsKeiluvGeneratorPluginLoad() { - for (const auto &info : qbs::KeiluvVersionInfo::knownVersions()) { + for (const auto &info : qbs::KeiluvVersionInfo::knownVersions) { qbs::ProjectGeneratorManager::registerGenerator( std::make_shared<qbs::KeiluvGenerator>(info)); } diff --git a/src/plugins/generator/keiluv/keiluvproject.cpp b/src/plugins/generator/keiluv/keiluvproject.cpp index 476ce8e69..89db73b1f 100644 --- a/src/plugins/generator/keiluv/keiluvproject.cpp +++ b/src/plugins/generator/keiluv/keiluvproject.cpp @@ -40,7 +40,7 @@ namespace qbs { -static QString keilProjectSchema(const KeiluvVersionInfo &info) +static QString keilProjectSchema(const gen::VersionInfo &info) { const auto v = info.marketingVersion(); switch (v) { @@ -51,10 +51,9 @@ static QString keilProjectSchema(const KeiluvVersionInfo &info) } } -KeiluvProject::KeiluvProject( - const qbs::GeneratableProject &genProject, +KeiluvProject::KeiluvProject(const qbs::GeneratableProject &genProject, const qbs::GeneratableProductData &genProduct, - const KeiluvVersionInfo &versionInfo) + const gen::VersionInfo &versionInfo) { Q_ASSERT(genProject.projects.size() == genProject.commandLines.size()); Q_ASSERT(genProject.projects.size() == genProduct.data.size()); diff --git a/src/plugins/generator/keiluv/keiluvproject.h b/src/plugins/generator/keiluv/keiluvproject.h index 98b2815ed..da86f71fd 100644 --- a/src/plugins/generator/keiluv/keiluvproject.h +++ b/src/plugins/generator/keiluv/keiluvproject.h @@ -40,15 +40,13 @@ namespace qbs { -class KeiluvVersionInfo; - class KeiluvProject final : public gen::xml::Project { public: explicit KeiluvProject( const qbs::GeneratableProject &genProject, const qbs::GeneratableProductData &genProduct, - const KeiluvVersionInfo &versionInfo); + const gen::VersionInfo &versionInfo); private: std::vector<std::unique_ptr<gen::xml::PropertyGroupFactory>> m_factories; }; diff --git a/src/plugins/generator/keiluv/keiluvutils.cpp b/src/plugins/generator/keiluv/keiluvutils.cpp index 8932f0f16..628a8e98a 100644 --- a/src/plugins/generator/keiluv/keiluvutils.cpp +++ b/src/plugins/generator/keiluv/keiluvutils.cpp @@ -32,12 +32,14 @@ #include <generators/generatorutils.h> +#include <tools/stlutils.h> + namespace qbs { namespace KeiluvUtils { OutputBinaryType outputBinaryType(const ProductData &qbsProduct) { - const auto qbsProductType = qbsProduct.type(); + const auto &qbsProductType = qbsProduct.type(); if (qbsProductType.contains(QLatin1String("application"))) return ApplicationOutputType; if (qbsProductType.contains(QLatin1String("staticlibrary"))) @@ -82,10 +84,8 @@ QStringList includes(const PropertyMap &qbsProps) qbsProps, {QStringLiteral("includePaths"), QStringLiteral("systemIncludePaths")}); // Transform include path separators to native. - std::transform(paths.begin(), paths.end(), paths.begin(), - [](const auto &path) { - return QDir::toNativeSeparators(path); - }); + Internal::transform(paths, [](const auto &path) { + return QDir::toNativeSeparators(path); }); return paths; } @@ -100,23 +100,18 @@ QStringList staticLibraries(const PropertyMap &qbsProps) auto libs = gen::utils::cppStringModuleProperties( qbsProps, {QStringLiteral("staticLibraries")}); // Transform library path separators to native. - std::transform(libs.begin(), libs.end(), libs.begin(), - [](const auto &path) { - return QDir::toNativeSeparators(path); - }); + Internal::transform(libs, [](const auto &path) { + return QDir::toNativeSeparators(path); }); return libs; } QStringList dependencies(const std::vector<ProductData> &qbsProductDeps) { - QStringList deps; - for (const ProductData &qbsProductDep : qbsProductDeps) { - const auto path = qbsProductDep.buildDirectory() - + QLatin1String("/obj/") - + gen::utils::targetBinary(qbsProductDep); - deps.push_back(QDir::toNativeSeparators(path)); - } - return deps; + return Internal::transformed<QStringList>(qbsProductDeps, [](const auto &dep) { + const auto path = dep.buildDirectory() + QLatin1String("/obj/") + + gen::utils::targetBinary(dep); + return QDir::toNativeSeparators(path); + }); } } // namespace KeiluvUtils diff --git a/src/plugins/generator/keiluv/keiluvversioninfo.cpp b/src/plugins/generator/keiluv/keiluvversioninfo.cpp deleted file mode 100644 index 973d0a420..000000000 --- a/src/plugins/generator/keiluv/keiluvversioninfo.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 Denis Shienkov <denis.shienkov@gmail.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qbs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "keiluvconstants.h" -#include "keiluvversioninfo.h" - -#include <QtCore/qdebug.h> - -namespace qbs { - -KeiluvVersionInfo::KeiluvVersionInfo( - const Version &version, - const std::set<gen::utils::Architecture> &archs) - : gen::VersionInfo(version, archs) -{ -} - -std::set<KeiluvVersionInfo> KeiluvVersionInfo::knownVersions() -{ - static const std::set<KeiluvVersionInfo> known = { - {Version(KeiluvConstants::v5::kUVisionVersion), - {gen::utils::Architecture::Mcs51, - gen::utils::Architecture::Arm}}, - }; - return known; -} - -int KeiluvVersionInfo::marketingVersion() const -{ - const auto mv = gen::VersionInfo::marketingVersion(); - for (const KeiluvVersionInfo &known : knownVersions()) { - if (known.version().majorVersion() == mv) - return mv; - } - qWarning() << QStringLiteral("Unrecognized KEIL UV version: ") - << version().toString(); - return 0; -} - -} // namespace qbs diff --git a/src/plugins/generator/keiluv/keiluvversioninfo.h b/src/plugins/generator/keiluv/keiluvversioninfo.h index a64513492..cc379c3d7 100644 --- a/src/plugins/generator/keiluv/keiluvversioninfo.h +++ b/src/plugins/generator/keiluv/keiluvversioninfo.h @@ -40,22 +40,21 @@ #ifndef QBS_KEILUVVERSIONINFO_H #define QBS_KEILUVVERSIONINFO_H +#include "keiluvconstants.h" + #include <generators/generatorutils.h> #include <generators/generatorversioninfo.h> namespace qbs { +namespace KeiluvVersionInfo { -class KeiluvVersionInfo final : public gen::VersionInfo -{ -public: - KeiluvVersionInfo(const Version &version, - const std::set<gen::utils::Architecture> &archs); - - int marketingVersion() const final; - - static std::set<KeiluvVersionInfo> knownVersions(); +constexpr gen::VersionInfo knownVersions[] = { + {Version(KeiluvConstants::v5::kUVisionVersion), + {gen::utils::Architecture::Mcs51, + gen::utils::Architecture::Arm}}, }; +} // namespace KeiluvVersionInfo } // namespace qbs #endif // QBS_KEILUVVERSIONINFO_H diff --git a/src/plugins/generator/makefilegenerator/CMakeLists.txt b/src/plugins/generator/makefilegenerator/CMakeLists.txt new file mode 100644 index 000000000..8e6e3510a --- /dev/null +++ b/src/plugins/generator/makefilegenerator/CMakeLists.txt @@ -0,0 +1,10 @@ +set(SOURCES + makefilegenerator.cpp + makefilegenerator.h + makefilegeneratorplugin.cpp + ) + +add_qbs_plugin(makefilegenerator + DEPENDS qbscore + SOURCES ${SOURCES} + ) diff --git a/src/plugins/generator/makefilegenerator/makefilegenerator.cpp b/src/plugins/generator/makefilegenerator/makefilegenerator.cpp index 24aff5a33..690d83569 100644 --- a/src/plugins/generator/makefilegenerator/makefilegenerator.cpp +++ b/src/plugins/generator/makefilegenerator/makefilegenerator.cpp @@ -167,7 +167,7 @@ void qbs::MakefileGenerator::generate() } QTextStream stream(&makefile); ErrorInfo error; - ProjectTransformerData projectTransformerData = theProject.transformerData(&error); + const ProjectTransformerData projectTransformerData = theProject.transformerData(&error); if (error.hasError()) throw error; stream << "# This file was generated by qbs" << "\n\n"; @@ -182,7 +182,7 @@ void qbs::MakefileGenerator::generate() "is not supported by this generator.").arg(srcDir)); } stream << "SRCDIR = " << QDir::toNativeSeparators(srcDir) << '\n'; - const QString buildDir = projectData.buildDirectory(); + const QString &buildDir = projectData.buildDirectory(); if (buildDir.contains(QLatin1Char(' '))) { throw ErrorInfo(Tr::tr("The build directory '%1' contains space characters, which" "is not supported by this generator.").arg(buildDir)); @@ -286,8 +286,8 @@ void qbs::MakefileGenerator::generate() } if (!processCommandEncountered && builtByDefault) { const auto outputs = transformerData.outputs(); - for (const ArtifactData &output : outputs) - filesCreatedByJsCommands.push_back(output.filePath()); + transform(outputs, filesCreatedByJsCommands, [](const auto &output) { + return output.filePath(); }); } } stream << "install-" << productTarget << ": " << productTarget << '\n'; @@ -319,8 +319,7 @@ void qbs::MakefileGenerator::generate() << transformedInputFilePath << ' ' << transformedOutputDir << '\n'; } stream << "clean-" << productTarget << ":\n"; - const auto generatedArtifacts = productData.generatedArtifacts(); - for (const ArtifactData &artifact : generatedArtifacts) { + for (const ArtifactData &artifact : productData.generatedArtifacts()) { const QFileInfo fileInfo(artifact.filePath()); const QString transformedFilePath = QDir::toNativeSeparators( prefixifiedBuildDirPath(fileInfo.path()) @@ -333,15 +332,15 @@ void qbs::MakefileGenerator::generate() } stream << "all:"; - for (const QString &target : qAsConst(allDefaultTargets)) + for (const QString &target : std::as_const(allDefaultTargets)) stream << ' ' << target; stream << '\n'; stream << "install:"; - for (const QString &target : qAsConst(allDefaultTargets)) + for (const QString &target : std::as_const(allDefaultTargets)) stream << ' ' << "install-" << target; stream << '\n'; stream << "clean:"; - for (const QString &target : qAsConst(allTargets)) + for (const QString &target : std::as_const(allTargets)) stream << ' ' << "clean-" << target; stream << '\n'; if (!filesCreatedByJsCommands.empty()) { diff --git a/src/plugins/generator/makefilegenerator/makefilegenerator.pri b/src/plugins/generator/makefilegenerator/makefilegenerator.pri deleted file mode 100644 index 971e63d24..000000000 --- a/src/plugins/generator/makefilegenerator/makefilegenerator.pri +++ /dev/null @@ -1 +0,0 @@ -qbsPluginTarget = makefilegenerator diff --git a/src/plugins/generator/makefilegenerator/makefilegenerator.pro b/src/plugins/generator/makefilegenerator/makefilegenerator.pro deleted file mode 100644 index c03191c39..000000000 --- a/src/plugins/generator/makefilegenerator/makefilegenerator.pro +++ /dev/null @@ -1,11 +0,0 @@ -include(makefilegenerator.pri) -include(../../plugins.pri) - -QT = core - -HEADERS += \ - $$PWD/makefilegenerator.h - -SOURCES += \ - $$PWD/makefilegenerator.cpp \ - $$PWD/makefilegeneratorplugin.cpp diff --git a/src/plugins/generator/makefilegenerator/makefilegenerator.qbs b/src/plugins/generator/makefilegenerator/makefilegenerator.qbs index baabc43e3..8d61defe1 100644 --- a/src/plugins/generator/makefilegenerator/makefilegenerator.qbs +++ b/src/plugins/generator/makefilegenerator/makefilegenerator.qbs @@ -1,4 +1,3 @@ -import qbs import "../../qbsplugin.qbs" as QbsPlugin QbsPlugin { 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(); } } |