Browse Source

Projucer: Only scan module paths on command-line when re-saving projects using global paths

tags/2021-05-28
ed 7 years ago
parent
commit
856d7dc333
2 changed files with 33 additions and 8 deletions
  1. +0
    -6
      extras/Projucer/Source/Application/jucer_Application.cpp
  2. +33
    -2
      extras/Projucer/Source/Application/jucer_CommandLine.cpp

+ 0
- 6
extras/Projucer/Source/Application/jucer_Application.cpp View File

@@ -136,12 +136,6 @@ void ProjucerApplication::initialiseBasics()
ImageCache::setCacheTimeout (30 * 1000);
icons.reset (new Icons());
tooltipWindow.setMillisecondsBeforeTipAppears (1200);
if (isRunningCommandLine)
{
rescanJUCEPathModules();
rescanUserPathModules();
}
}
bool ProjucerApplication::initialiseLogger (const char* filePrefix)


+ 33
- 2
extras/Projucer/Source/Application/jucer_CommandLine.cpp View File

@@ -25,9 +25,8 @@
*/
#include "jucer_Headers.h"
#include "../Project/jucer_Module.h"
#include "jucer_Application.h"
#include "../Utility/Helpers/jucer_TranslationHelpers.h"
#include "../Utility/PIPs/jucer_PIPGenerator.h"
#include "jucer_CommandLine.h"
@@ -94,6 +93,9 @@ namespace
{
if (project != nullptr)
{
if (! justSaveResources)
rescanModulePathsIfNecessary();
auto error = justSaveResources ? project->saveResourcesOnly (project->getFile())
: project->saveProject (project->getFile(), true);
@@ -104,6 +106,35 @@ namespace
}
}
void rescanModulePathsIfNecessary()
{
bool scanJUCEPath = false, scanUserPaths = false;
const auto& modules = project->getEnabledModules();
for (auto i = modules.getNumModules(); --i >= 0;)
{
const auto& id = modules.getModuleID (i);
if (isJUCEModule (id) && ! scanJUCEPath)
{
if (modules.shouldUseGlobalPath (id))
scanJUCEPath = true;
}
else if (! scanUserPaths)
{
if (modules.shouldUseGlobalPath (id))
scanUserPaths = true;
}
}
if (scanJUCEPath)
ProjucerApplication::getApp().rescanJUCEPathModules();
if (scanUserPaths)
ProjucerApplication::getApp().rescanUserPathModules();
}
std::unique_ptr<Project> project;
};


Loading…
Cancel
Save