Avoiding Projucer saving crash / Improving Projucer saving time


#1

Hi,
i’ve been using the Projucer for quite a time now, and something happend in the recent version (later JUCE 4.x and JUCE 5) :
When saving a project with different exporters (i’ve got VS 2015, XCode and Linux), the Projucer is taking an awful lot of time to save, and if i click away like the desktop, or check my mails, the app freezes and crashes (“The Projucer stopped working…”).

I’ve recompiled in debug mode the jucer and what seems to causes this is that from windows, there is a problem with modules path in other platform starting with “/” (my modules on osx and linux are defined like that).
I’m not sure it’s the only reason, but i tested to avoir saving an osx project from windows and vice-versa, and also have a check for module path before trying to access the getFileName() which causes a jassertfalse, and slows everything down.

Now, the projucer takes half a second to save on Windows ! i know it’s not really proper, especially for those who want to use travis etc. but it’s a start to improve the jucer quality on windows, because it’s a bit painful when working on the file structure, each saving crashing the jucer…

The lines i changed are those :

juce_ProjectSaver.h, line 636:

 void writeProjects (const OwnedArray<LibraryModule>& modules)
    {
        ThreadPool threadPool;

        // keep a copy of the basic generated files group, as each exporter may modify it.
        const ValueTree originalGeneratedGroup (generatedFilesGroup.state.createCopy());

        try
        {
            for (Project::ExporterIterator exporter (project); exporter.next();)
                {
//i added these lines
    #if JUCE_WINDOWS
    				if (exporter->isOSX()) continue;
   #elif JUCE_MAC
    				if (exporter->isWindows()) continue;**
    #endif

            if (exporter->getTargetFolder().createDirectory())
            {
                exporter->copyMainGroupFromProject();
                exporter->settings = exporter->settings.createCopy();

And in juce_Project.cpp, line 1207 :

bool Project::Item::addRelativeFile (const RelativePath& file, int insertIndex, bool shouldCompile)
{
//i added the lines
#if JUCE_WINDOWS
	DBG(file.toWindowsStyle());
	if (file.toWindowsStyle().startsWithChar('\\')) return false;
#endif

    Item item (project, ValueTree (Ids::FILE), belongsToModule);
    item.initialiseMissingProperties();
    item.getNameValue() = file.getFileName();

And for the info, i’m on windows 10 x64


#2

I took a look at ways to reduce the Projucer’s save times today and identified a few fixes. I’ll hopefully push something to the develop branch soon-ish addressing this


#3

I’ve pushed a couple of fixes to the develop branch that should make project saving considerably faster