Jucer in build scripts

What’s a reliable test to see if the .jucer file has been changed and should be resaved before building a project? I thought I’d be able to compare the JucerHeader.h timestamp with the .jucer file timestamp but that’s so working reliably…possible a resave doesn’t always update the timestamp on AppConfig or JuceHeader…

thoughts?

Not sure if you’ve tried this already but the way we do it in the Projucer is to get the .jucer file modification time using the File::getLastModificationTime() method whenever the Projucer window gains focus and compare this with the last stored modification time, prompting the user to save or re-load from disk if the two times differ. Take a look at the hasProjectBeenModified() method in the Project.h/.cpp files of the Projucer.

Ed

The trick is for an external script to detect if it needs to call the jucer --resave or not.

So I need to compare something outputted by the jucer with the jucer file date.

I think that’s a different problem. But it looks like the only thing reliably updated by the jucer are the IDE project files … which may have variable names and paths so it’s a bit of a pain!

Ah sorry, I assumed you wanted to do the check from inside an application. The Projucer will only replace the AppConfig and JuceHeader files if they have changed so the timestamp won’t always be updated when you save the .jucer file. Not sure what else you could check, other than the IDE project files.

Ed

Could you touch the date on those files when its saved in future? The resaving of the project files pretty much guarantees a full rebuild whenever resave happens … (which is something i’m trying to avoid by not resaving if i don’t have to!)

1 Like