Class ScriptHost
Roslyn-based script host for loading and executing build.csando files. Scripts are C# code that registers build steps for later execution.
public class ScriptHost
- Inheritance
-
ScriptHost
- Inherited Members
Constructors
ScriptHost(IBuildLogger)
Roslyn-based script host for loading and executing build.csando files. Scripts are C# code that registers build steps for later execution.
public ScriptHost(IBuildLogger logger)
Parameters
loggerIBuildLogger
Methods
LoadScriptAsync(string, string)
Loads and executes a build script, returning the configured build context. The script registers steps in the StepRegistry but doesn't execute them.
public Task<BuildContext> LoadScriptAsync(string scriptPath, string rootPath)
Parameters
Returns
- Task<BuildContext>
BuildContext with registered steps ready for execution.
SetActiveProfiles(IEnumerable<string>)
Sets the active profiles from CLI arguments. Call this before LoadScriptAsync to ensure profiles are available.
public void SetActiveProfiles(IEnumerable<string> profiles)
Parameters
profilesIEnumerable<string>Profile names from CLI (e.g., from -p push,release).
VerifyScriptAsync(string)
Verifies a build script compiles without errors, without executing it. Returns compilation diagnostics if any errors are found.
public Task<List<string>> VerifyScriptAsync(string scriptPath)
Parameters
scriptPathstringPath to the build.csando file.