Pre/Post build step in UBT

This feature already exists. You can add shell commands to the end of builds by adding something like this to your .uproject file:

"PostBuildSteps":
{
    "Win64": [
        "copy $(ProjectDir)\Binaries\$(TargetPlatform)\$(TargetName).exe D:\SomeDir"
    ]
}

There’s a PreBuildSteps section too. Check out WriteCustomBuildStepScripts in UEBuildTarget.cs in UBT to see all the available variables.

3 Likes