From 336398893d2523055a5c8bdab4911c5af044f956 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Fri, 23 Oct 2020 16:57:15 +0100 Subject: [PATCH] Projucer: Deprecate the CLion exporter --- .../Projucer/Source/Project/jucer_Project.cpp | 27 +++++++++++++++++++ .../Projucer/Source/Project/jucer_Project.h | 17 +++++++----- .../ProjectSaving/jucer_ProjectExport_CLion.h | 16 +++++++++-- 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/extras/Projucer/Source/Project/jucer_Project.cpp b/extras/Projucer/Source/Project/jucer_Project.cpp index 8533ec4b4b..ea8bd28835 100644 --- a/extras/Projucer/Source/Project/jucer_Project.cpp +++ b/extras/Projucer/Source/Project/jucer_Project.cpp @@ -653,6 +653,7 @@ Result Project::loadDocument (const File& file) setChangedFlag (false); + updateExporterWarnings(); updateLicenseWarning(); return Result::ok(); @@ -828,6 +829,20 @@ void Project::updateModuleWarnings() updateModuleNotFoundWarning (moduleNotFound); } +void Project::updateExporterWarnings() +{ + auto isClionPresent = [this]() + { + for (ExporterIterator exporter (*this); exporter.next();) + if (exporter->isCLion()) + return true; + + return false; + }(); + + updateCLionWarning (isClionPresent); +} + void Project::updateCppStandardWarning (bool showWarning) { if (showWarning) @@ -893,6 +908,14 @@ void Project::updateOldProjucerWarning (bool showWarning) removeProjectMessage (ProjectMessages::Ids::oldProjucer); } +void Project::updateCLionWarning (bool showWarning) +{ + if (showWarning) + addProjectMessage (ProjectMessages::Ids::cLion, {}); + else + removeProjectMessage (ProjectMessages::Ids::cLion); +} + void Project::updateModuleNotFoundWarning (bool showWarning) { if (showWarning) @@ -1050,6 +1073,8 @@ void Project::valueTreeChildAdded (ValueTree& parent, ValueTree& child) if (child.getType() == Ids::MODULE) updateModuleWarnings(); + else if (parent.getType() == Ids::EXPORTFORMATS) + updateExporterWarnings(); changed(); } @@ -1060,6 +1085,8 @@ void Project::valueTreeChildRemoved (ValueTree& parent, ValueTree& child, int in if (child.getType() == Ids::MODULE) updateModuleWarnings(); + else if (parent.getType() == Ids::EXPORTFORMATS) + updateExporterWarnings(); changed(); } diff --git a/extras/Projucer/Source/Project/jucer_Project.h b/extras/Projucer/Source/Project/jucer_Project.h index 3e220c657f..f2b352d44b 100644 --- a/extras/Projucer/Source/Project/jucer_Project.h +++ b/extras/Projucer/Source/Project/jucer_Project.h @@ -48,6 +48,7 @@ namespace ProjectMessages DECLARE_ID (jucerFileModified); DECLARE_ID (missingModuleDependencies); DECLARE_ID (oldProjucer); + DECLARE_ID (cLion); DECLARE_ID (newVersionAvailable); DECLARE_ID (notification); @@ -60,17 +61,15 @@ namespace ProjectMessages inline Identifier getTypeForMessage (const Identifier& message) { - if (message == Ids::incompatibleLicense || message == Ids::cppStandard || message == Ids::moduleNotFound - || message == Ids::jucePath || message == Ids::jucerFileModified || message == Ids::missingModuleDependencies - || message == Ids::oldProjucer) - { + static Identifier warnings[] = { Ids::incompatibleLicense, Ids::cppStandard, Ids::moduleNotFound, + Ids::jucePath, Ids::jucerFileModified, Ids::missingModuleDependencies, + Ids::oldProjucer, Ids::cLion }; + + if (std::find (std::begin (warnings), std::end (warnings), message) != std::end (warnings)) return Ids::warning; - } if (message == Ids::newVersionAvailable) - { return Ids::notification; - } jassertfalse; return {}; @@ -86,6 +85,7 @@ namespace ProjectMessages if (message == Ids::missingModuleDependencies) return "Missing Module Dependencies"; if (message == Ids::oldProjucer) return "Projucer Out of Date"; if (message == Ids::newVersionAvailable) return "New Version Available"; + if (message == Ids::cLion) return "Deprecated Exporter"; jassertfalse; return {}; @@ -101,6 +101,7 @@ namespace ProjectMessages if (message == Ids::missingModuleDependencies) return "Module(s) have missing dependencies."; if (message == Ids::oldProjucer) return "The version of the Projucer you are using is out of date."; if (message == Ids::newVersionAvailable) return "A new version of JUCE is available to download."; + if (message == Ids::cLion) return "The CLion exporter is deprecated. Use JUCE's CMake support instead."; jassertfalse; return {}; @@ -609,9 +610,11 @@ private: void updateJUCEPathWarning(); void updateModuleWarnings(); + void updateExporterWarnings(); void updateCppStandardWarning (bool showWarning); void updateMissingModuleDependenciesWarning (bool showWarning); void updateOldProjucerWarning (bool showWarning); + void updateCLionWarning (bool showWarning); void updateModuleNotFoundWarning (bool showWarning); ValueTree projectMessages { ProjectMessages::Ids::projectMessages, {}, diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h index 371dc49c27..a01fdf7892 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h @@ -53,7 +53,7 @@ protected: public: //============================================================================== - static String getDisplayName() { return "CLion (beta)"; } + static String getDisplayName() { return "CLion [Deprecated]"; } static String getValueTreeTypeName() { return "CLION"; } static String getTargetFolderName() { return "CLion"; } @@ -131,7 +131,19 @@ public: { String description; - description << "The " << getDisplayName() << " exporter produces a single CMakeLists.txt file with " + description << "*****" << newLine + << newLine + << "This exporter is deprecated." << newLine + << newLine + << "CLion can open any CMake-based projects and JUCE's direct CMake support provides a much more " + << "flexible way of configuring CMake. To get started using JUCE with CMake please see the guide in " + << "the 'docs/CMake API.md' file in the JUCE source code." << newLine + << newLine + << "This exporter will no longer be updated and will eventually be removed from the Projucer." << newLine + << newLine + << "*****" << newLine + << newLine + << "This CLion exporter produces a single CMakeLists.txt file with " << "multiple platform dependent sections, where the configuration for each section " << "is inherited from other exporters added to this project." << newLine << newLine