| name | unreal-build |
| description | Unreal Engine 5 build system, testing framework, and CI/CD patterns |
| context | fork |
Build System
Module Setup (Build.cs)
using UnrealBuildTool;
public class UnrealFrog : ModuleRules
{
public UnrealFrog(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] {
"Core", "CoreUObject", "Engine", "InputCore",
"EnhancedInput", "UMG"
});
}
}
Target Files
UnrealFrog.Target.cs — Game target (shipping build)
UnrealFrogEditor.Target.cs — Editor target (development)
Testing Framework
Automation Tests
#include "Misc/AutomationTest.h"
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
FScoreSystemTest,
"UnrealFrog.Gameplay.ScoreSystem",
EAutomationTestFlags::ApplicationContextMask | EAutomationTestFlags::ProductFilter
)
bool FScoreSystemTest::RunTest(const FString& Parameters)
{
UScoreSubsystem* Score = NewObject<UScoreSubsystem>();
Score->AddPoints(100);
TestEqual("Score should be 100", Score->GetCurrentScore(), 100);
return true;
}
Functional Tests (In-Game)
UCLASS()
class AFrogHopTest : public AFunctionalTest
{
GENERATED_BODY()
public:
virtual void StartTest() override;
virtual void Tick(float DeltaTime) override;
};
Running Tests
UnrealEditor-Cmd UnrealFrog.uproject -ExecCmds="Automation RunTests UnrealFrog" -NullRHI -NoSound
UnrealEditor-Cmd UnrealFrog.uproject -ExecCmds="Automation RunTests UnrealFrog.Gameplay"
RunUAT.bat RunUnrealTests -project=UnrealFrog.uproject -test=UnrealFrog
Asset Validation
Data Validation Plugin
Enable DataValidation plugin. Create validators:
UCLASS()
class UAssetNamingValidator : public UEditorValidatorBase
{
GENERATED_BODY()
public:
virtual EDataValidationResult IsValid(TArray<FText>& ValidationErrors) override;
};
Naming Convention Checks
| Asset Type | Prefix | Example |
|---|
| Static Mesh | SM_ | SM_Frog |
| Skeletal Mesh | SK_ | SK_FrogAnimated |
| Material | M_ | M_Road |
| Material Instance | MI_ | MI_Road_Wet |
| Texture | T_ | T_Frog_Albedo |
| Sound Wave | SW_ | SW_Hop |
| Sound Cue | SC_ | SC_HopWithVariation |
| Blueprint | BP_ | BP_FrogCharacter |
| Widget Blueprint | WBP_ | WBP_HUD |
| Level | LVL_ | LVL_MainGame |
Python Editor Scripting
import unreal
task = unreal.AssetImportTask()
task.filename = "path/to/model.fbx"
task.destination_path = "/Game/Meshes/Characters"
task.automated = True
task.replace_existing = True
unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks([task])
validator = unreal.EditorValidatorSubsystem()
validator.validate_assets_with_settings(assets, settings)