Maintaining customized juce modules

I need to make some modifications to .h and .cpp files in juce modules that are used in my project.

What is a good way to check the modified files in to version control along with the rest of my source files?

My first instinct was to use the “Create Local Copy” option in the Projucer’s module settings dialog, but I think that will cause my changes to be overwritten the next time I upgrade the JUCE version.

I tried copying the module directories (the ones I want to modify) into my Source directory, and adding them via the Projucer’s “Add a module from a specified folder” option, but I found that this can lead to subtle issues with the build process for the XCode projects that were generated with the Projucer (pertaining to the auto-generated JuceHeaders.h, I can discuss the details if needed).

Has anyone found a workflow for customizing standard juce modules that they are happy with?

You could fork juce and use that. Though, if I were you I would seriously question whether you should be making changes to those or choosing another method (e.g. subclassing).

Hmm, I need to make changes to private class members. I also need to access nested classes that are declared in .cpp files (not in header files). So subclassing won’t work.

I’m using the tracktion_engine module, meaning that I have to use the version of juce that is used by tracktion. If I fork JUCE, than I also have to fork tracktion_engine (or lock the version). In any case, maintaining a JUCE fork is overkill for my purposes. I only need to fork two modules.

I iterate through the Juce directory looking for the file to change and use fromFirstOccurrenceOf, fromLastOccurenceOf or even replace to edit the latest Juce update. This way I will notice major changes as I can return an error, when the text to replace is not found. Manual changes became too hard to track.