mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: improved the set of browsable files that are added to target projects for each module
This commit is contained in:
parent
1601c907ae
commit
fad8d0526e
7 changed files with 17 additions and 29 deletions
|
|
@ -604,14 +604,6 @@ private:
|
|||
replaceFileIfDifferent (generatedCodeFolder.getChildFile ("ReadMe.txt"), out);
|
||||
}
|
||||
|
||||
static void sortGroupRecursively (Project::Item group)
|
||||
{
|
||||
group.sortAlphabetically (true);
|
||||
|
||||
for (int i = group.getNumChildren(); --i >= 0;)
|
||||
sortGroupRecursively (group.getChild(i));
|
||||
}
|
||||
|
||||
void addError (const String& message)
|
||||
{
|
||||
const ScopedLock sl (errorLock);
|
||||
|
|
@ -645,7 +637,7 @@ private:
|
|||
if (project.getProjectType().isAudioPlugin())
|
||||
writePluginCharacteristicsFile();
|
||||
|
||||
sortGroupRecursively (generatedFilesGroup);
|
||||
generatedFilesGroup.sortAlphabetically (true, true);
|
||||
exporter->getAllGroups().add (generatedFilesGroup);
|
||||
|
||||
threadPool.addJob (new ExporterJob (*this, exporter.exporter.release(), modules), true);
|
||||
|
|
|
|||
|
|
@ -496,29 +496,19 @@ static void addFileWithGroups (Project::Item& group, const RelativePath& file, c
|
|||
}
|
||||
}
|
||||
|
||||
static void findWildcardMatches (const File& folder, Array<File>& result)
|
||||
void LibraryModule::findBrowseableFiles (const File& folder, Array<File>& filesFound) const
|
||||
{
|
||||
Array<File> tempList;
|
||||
FileSorter sorter;
|
||||
|
||||
DirectoryIterator iter (folder, false, "*");
|
||||
DirectoryIterator iter (folder, true, "*", File::findFiles);
|
||||
bool isHiddenFile;
|
||||
|
||||
while (iter.next (nullptr, &isHiddenFile, nullptr, nullptr, nullptr, nullptr))
|
||||
if (! isHiddenFile)
|
||||
if (! isHiddenFile && iter.getFile().hasFileExtension (browseableFileExtensions))
|
||||
tempList.addSorted (sorter, iter.getFile());
|
||||
|
||||
result.addArray (tempList);
|
||||
}
|
||||
|
||||
void LibraryModule::findBrowseableFiles (const File& localModuleFolder, Array<File>& filesFound) const
|
||||
{
|
||||
DirectoryIterator iter (localModuleFolder, true, "*", File::findDirectories);
|
||||
bool isHiddenFile;
|
||||
|
||||
while (iter.next (nullptr, &isHiddenFile, nullptr, nullptr, nullptr, nullptr))
|
||||
if (! isHiddenFile)
|
||||
findWildcardMatches (iter.getFile(), filesFound);
|
||||
filesFound.addArray (tempList);
|
||||
}
|
||||
|
||||
void LibraryModule::addBrowseableCode (ProjectExporter& exporter, const Array<File>& compiled, const File& localModuleFolder) const
|
||||
|
|
@ -542,6 +532,7 @@ void LibraryModule::addBrowseableCode (ProjectExporter& exporter, const Array<Fi
|
|||
pathWithinModule);
|
||||
}
|
||||
|
||||
sourceGroup.sortAlphabetically (true, true);
|
||||
sourceGroup.addFileAtIndex (moduleInfo.getHeader(), -1, false);
|
||||
|
||||
exporter.getModulesGroup().state.addChild (sourceGroup.state.createCopy(), -1, nullptr);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ struct ModuleDescription
|
|||
String getPreprocessorDefs() const { return moduleInfo [Ids::defines].toString(); }
|
||||
String getExtraSearchPaths() const { return moduleInfo [Ids::searchpaths].toString(); }
|
||||
|
||||
File getFolder() const { jassert (moduleFolder != File::nonexistent); return moduleFolder; }
|
||||
File getFolder() const { jassert (moduleFolder != File()); return moduleFolder; }
|
||||
File getHeader() const;
|
||||
|
||||
bool isPluginClient() const { return getID() == "juce_audio_plugin_client"; }
|
||||
|
|
|
|||
|
|
@ -928,9 +928,13 @@ static bool isGroupSorted (const ValueTree& state, bool keepGroupsAtStart)
|
|||
return stateCopy.isEquivalentTo (state);
|
||||
}
|
||||
|
||||
void Project::Item::sortAlphabetically (bool keepGroupsAtStart)
|
||||
void Project::Item::sortAlphabetically (bool keepGroupsAtStart, bool recursive)
|
||||
{
|
||||
sortGroup (state, keepGroupsAtStart, getUndoManager());
|
||||
|
||||
if (recursive)
|
||||
for (int i = getNumChildren(); --i >= 0;)
|
||||
getChild(i).sortAlphabetically (keepGroupsAtStart, true);
|
||||
}
|
||||
|
||||
Project::Item Project::Item::getOrCreateSubGroup (const String& name)
|
||||
|
|
@ -995,7 +999,7 @@ bool Project::Item::addFileRetainingSortOrder (const File& file, bool shouldComp
|
|||
return false;
|
||||
|
||||
if (wasSortedGroupsNotFirst || wasSortedGroupsFirst)
|
||||
sortAlphabetically (wasSortedGroupsFirst);
|
||||
sortAlphabetically (wasSortedGroupsFirst, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ public:
|
|||
void addFileUnchecked (const File& file, int insertIndex, bool shouldCompile);
|
||||
bool addRelativeFile (const RelativePath& file, int insertIndex, bool shouldCompile);
|
||||
void removeItemFromProject();
|
||||
void sortAlphabetically (bool keepGroupsAtStart);
|
||||
void sortAlphabetically (bool keepGroupsAtStart, bool recursive);
|
||||
Item findItemForFile (const File& file) const;
|
||||
bool containsChildForFile (const RelativePath& file) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -146,8 +146,8 @@ public:
|
|||
case 2: openOrCloseAllSubGroups (*this, true); break;
|
||||
case 3: setFilesToCompile (item, true); break;
|
||||
case 4: setFilesToCompile (item, false); break;
|
||||
case 5: item.sortAlphabetically (false); break;
|
||||
case 6: item.sortAlphabetically (true); break;
|
||||
case 5: item.sortAlphabetically (false, false); break;
|
||||
case 6: item.sortAlphabetically (true, false); break;
|
||||
case 7: triggerAsyncRename (item); break;
|
||||
case 8: deleteAllSelectedItems(); break;
|
||||
default: processCreateFileMenuItem (resultCode); break;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ const char* const cppFileExtensions = "cpp;cc;cxx";
|
|||
const char* const objCFileExtensions = "mm;m";
|
||||
const char* const asmFileExtensions = "s;S;asm";
|
||||
const char* const sourceOrHeaderFileExtensions = "cpp;mm;m;c;cc;cxx;swift;s;S;asm;h;hpp;hxx;hh;inl";
|
||||
const char* const browseableFileExtensions = "cpp;mm;m;c;cc;cxx;swift;s;S;asm;h;hpp;hxx;hh;inl;txt;md;rtf";
|
||||
const char* const fileTypesToCompileByDefault = "cpp;mm;c;m;cc;cxx;swift;s;S;asm;r";
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue