JucePlugin_ARADocumentArchiveID flag update in the projucer

I don’t know if that important or not (I don’t use ARA), but I noticed that changing the “project version number” and resaving/reexporting does not update the flag JucePlugin_ARADocumentArchiveID in JuceLibraryCode/JucePluginDefines.h.

say JucePlugin_ARADocumentArchiveID is com.MyCompany.MyPlugin.aradocumentarchive.1.0.0
If you set the version to 2.0.0 and resave/export, the flag isn’t updated.

You have to close and re-open the projucer project after saving and before re-exporting for the new version number to be taken into account and JucePlugin_ARADocumentArchiveID to be changed to com.MyCompany.MyPlugin.aradocumentarchive.2.0.0

I got tired of this annoyance so patched Projucer in my fork. It’s a simple fix.

In jucer_project.h, add:

   void updateVersionDependencies();

In jucer_project.cpp, add:

void Project::updateVersionDependencies()
{
    pluginARAArchiveIDValue.setDefault(getDefaultARADocumentArchiveID());
}

and insert in Project::valueTreePropertyChanged() where the other UpdateXXXDependencies() are around line 1100:

        else if (property == Ids::version)
        {
            updateVersionDependencies();
        }

I don’t think the Projucer is doing the right thing at the moment, but I’m also not sure about the proposed solution. The docs for the document archive ID say:

This ID must be globally unique and is shared only amongst document controllers that create the same archives and produce the same render results based upon the same input data. This means that the ID must be updated if the archive format changes in any way that is no longer downwards compatible.

I think it’s pretty reasonable for the version to remain constant until the user explicitly updates it, especially since the user will probably need to update the list of compatible IDs when the main archive ID changes.

We’ve made some changes on the juce9 branch to address these points.

This commit implements the suggestion to immediately update the default archive ID when the version number is changed:

This subsequent commit saves the archive ID to the jucer file, so that any future archive ID updates must be made explicitly by the user:

This final commit is a quality-of-life change to immediately show/hide the ARA-related properties when ARA is enabled/disabled:

Thank you for integrating a fix. I don’t use ARA, but based on the docs you quote I find it odd that the default ARA ID references the project version at all, instead of being a user-defined field with a basic default as is the case with the Bundle Identifier or Plugin AU Export Prefix. Presumably there is some reason it was done that way initially?