mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-06 05:18:26 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
37 lines
936 B
C#
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;
|
|
}
|
|
}
|
|
}
|