Files
sbox-public/engine/Tools/SboxBuild/Steps/BuildContent.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

37 lines
936 B
C#

using static Facepunch.Constants;
namespace Facepunch.Steps;
internal class BuildContent( string name ) : Step( name )
{
protected override ExitCode RunInternal()
{
try
{
string rootDir = Directory.GetCurrentDirectory();
string gameDir = Path.Combine( rootDir, "game" );
string contentBuilderPath = Path.Combine( gameDir, "bin", "win64", "contentbuilder.exe" );
// Verify content builder exists
if ( !File.Exists( contentBuilderPath ) )
{
Log.Error( $"Error: Content builder executable not found at {contentBuilderPath}" );
return ExitCode.Failure;
}
bool success = Utility.RunProcess( contentBuilderPath, "-b", gameDir );
if ( !success )
return ExitCode.Failure;
Log.Info( "Content building completed successfully!" );
return ExitCode.Success;
}
catch ( Exception ex )
{
Log.Error( $"Content building failed with error: {ex}" );
return ExitCode.Failure;
}
}
}