1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-14 00:14:18 +00:00

Projucer: Fixed a bug where modules added from the global user module path weren't being added to generated projects correctly

This commit is contained in:
ed 2017-07-03 16:35:03 +01:00
parent aef6a296e0
commit 2540725b6a
3 changed files with 21 additions and 23 deletions

View file

@ -684,6 +684,24 @@ File EnabledModuleList::getModuleFolderFromPathIfItExists (const String& path, c
return {};
}
File EnabledModuleList::findUserModuleFolder (const String& possiblePaths, const String& moduleID)
{
auto paths = StringArray::fromTokens (possiblePaths, ";", {});
for (auto p : paths)
{
auto f = File::createFileWithoutCheckingPath (p.trim());
if (f.exists())
{
auto moduleFolder = getModuleFolderFromPathIfItExists (f.getFullPathName(), moduleID, project);
if (moduleFolder != File())
return moduleFolder;
}
}
return {};
}
File EnabledModuleList::getModuleFolder (const String& moduleID)
{
if (shouldUseGlobalPath (moduleID).getValue())
@ -691,7 +709,7 @@ File EnabledModuleList::getModuleFolder (const String& moduleID)
if (isJuceModule (moduleID))
return getModuleFolderFromPathIfItExists (getAppSettings().getStoredPath (Ids::defaultJuceModulePath).toString(), moduleID, project);
return findUserModuleFolder (moduleID, getAppSettings().getStoredPath (Ids::defaultUserModulePath).toString(), project);
return findUserModuleFolder (moduleID, getAppSettings().getStoredPath (Ids::defaultUserModulePath).toString());
}
auto paths = getAllPossibleModulePathsFromExporters (project);
@ -874,24 +892,6 @@ File EnabledModuleList::findDefaultModulesFolder (Project& project)
return File::getCurrentWorkingDirectory();
}
File EnabledModuleList::findUserModuleFolder (const String& moduleID, const String& possiblePaths, const Project& project)
{
auto paths = StringArray::fromTokens (possiblePaths, ";", {});
for (auto p : paths)
{
auto f = File::createFileWithoutCheckingPath (p.trim());
if (f.exists())
{
auto moduleFolder = getModuleFolderFromPathIfItExists (f.getFullPathName(), moduleID, project);
if (moduleFolder != File())
return moduleFolder;
}
}
return {};
}
bool EnabledModuleList::isJuceModule (const String& moduleID)
{
static StringArray juceModuleIds =