I am refactoring parts of my CI/CD and I discovered that I cannot call the compiler right after the Projucer, as it hasn’t finished writing the project files. I can also see that the Projucer (still) writes to standard output after my compiler call.
Previously I did this with separate triggers with apparently enough time between the Projucer and the compiler calls.
Is there an option or a trick to make the Projucer save these files before returning control to the calling script, or to make that script wait until the Projucer has completed?
I use portable Powershell 7.2 for scripting.
[Edit] I can make it work by running
Start-Sleep -Seconds 3
after invoking the Projucer, but I think there should be a more reliable solution.
This seems an odd issue. In my experience the resave command from the command line is synchronous. But I’m still on Juce 6 for various reasons. Still, in the latest juce_CommandLine.cpp on line 114 there’s:
if (justSaveResources)
onCompletion (project->saveResourcesOnly());
else
project->saveProject (Async::no, nullptr, onCompletion);
indicating at least the intention to save synchronous from the command line. Which makes a lot of sense. Asynchronous saving from the command-line feels like a bug of sorts.
I also dived into the source first and it really saves asynchronously (master 7.0.5 here).
I agree this is not what you expect from a simple command line use case.
[Edit]
Yes, it does call this code, but then also the async version See below
Just an assumption, Is a secondary projucer running in the background? (And the command-line projucer delegates it to the GUI app, via anotherInstanceStarted()?
Just an assumption, Is a secondary projucer running in the background? (And the command-line projucer delegates it to the GUI app, via anotherInstanceStarted()?
No, as you can see up in my lines, I explicitly added a Stop-Process to avoid that option.
I think there may be a bug here, as the Sync save option - mentioned by @pflugshaupt - is executed first and then the Async save is called.
Tagging @reuk to notify someone from the Juce team.