mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-01 03:10:06 +00:00
Projucer: Only scan module paths on command-line when re-saving projects using global paths
This commit is contained in:
parent
e1e3b42b4f
commit
856d7dc333
2 changed files with 33 additions and 8 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue