How is MyProjectClasses.h populated?

I’m trying to figure out how files are added to the otuput of MyProjectClasses.h. My understanding is that this file is generated by UnrealHeaderTool.exe (UHT) after it has inspected the various header files in my project.

I created a new project called “MyProject” based off of the “Code Top Down” template. It contains a few classes, like AMyProjectCharacter, that have the UCLASS() annotation, and #include “MyProjectCharacter.generated.h” – which is to my understanding the required steps to get UHT to parse it.

After building the “Development Editor” target, the MyProjectClasses.h file exists, but only contains a comment and a #pragma once.

Looking at the ShooterGame sample, I see that the ShooterGameClasses.h file contains a list of #includes that seem to be every UCLASS() annotated class in the project.

What am I missing?

It seems only header files in “Source/MyProject/Classes” get added to your MyProjectClasses.h

A search for “classes” in visual studio came up with some possible useful info in UEBuildModule.cs (maybe around line 1632) which is located under Engine\Source\Programs\UnrealBuildTool\Configuration.

According to some of the comments in the code I almost think that using a “classes” folder could be deprecated at some point. Hope this helps.

Classes folder is half deprecated. The long term goal is to move away from it but the code still exists and the engine is still using it. Chris is correct, that the Classes folder is searched. You can also just manually include the appropriate headers in the desired order if you don’t want to use the classes folder.