logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SerenityRecipeEngine

    Orchestrates a recipe run: resolves the output root, builds the shared context, runs cross-section and per-section validation, and (unless blocked or validate-only) drives each section importer. The importer registry is built here, so adding a new section means adding one importer to CreateImporters().

    Inheritance
    object
    SerenityRecipeEngine
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.ProjectRecipe.Infrastructure.Editor
    Assembly: Serenity.UnityProjectRecipe.Infrastructure.Editor.dll
    Syntax
    public static class SerenityRecipeEngine

    Methods

    CreateImporters()

    Discovers every ISerenityRecipeSectionImporter across the loaded assemblies and returns them sorted by Order (typed sections, then the generic assets section, then the deferred reporter last). Reflection-based so a new section handler in any assembly is picked up without this engine referencing it — e.g. the localization importer ships in the localization assembly, keeping this core free of the Unity Localization dependency.

    Declaration
    public static List<ISerenityRecipeSectionImporter> CreateImporters()
    Returns
    Type Description
    List<ISerenityRecipeSectionImporter>

    The section importers, in execution order.

    ImportFromCommandLine()

    Headless entry point for batch runs (the import counterpart to ExportFromCommandLine()). Reads its arguments from the command line, runs the recipe, optionally writes a machine-readable report, and exits with a non-zero code when there are blockers or errors so an agent or CI step can branch on the result.

    Declaration
    public static void ImportFromCommandLine()
    Remarks

    Invoke with: -executeMethod Serenity.ProjectRecipe.Infrastructure.Editor.SerenityRecipeEngine.ImportFromCommandLine and the flags -recipeFile <path> (required), -recipeMode Validate|DryRun|Import (optional, default Import), -recipeOutputRoot <path> (optional override), and -recipeResult <path> (optional; writes ToJson() there).

    Run(SerenityRecipe, string, RecipeRunMode, SerenityRecipeReport)

    Runs a recipe end-to-end and returns the report. Parsing/loading is the caller's responsibility (see SerenityRecipeLoader); this method takes an already-parsed recipe.

    Declaration
    public static SerenityRecipeReport Run(SerenityRecipe recipe, string outputRootOverride, RecipeRunMode mode, SerenityRecipeReport report = null)
    Parameters
    Type Name Description
    SerenityRecipe recipe

    The parsed recipe.

    string outputRootOverride

    Optional output root that overrides the recipe's; null/empty uses the recipe value.

    RecipeRunMode mode

    How far the run should go.

    SerenityRecipeReport report

    An existing report to append to (e.g. one that already holds loader messages), or null to create one.

    Returns
    Type Description
    SerenityRecipeReport

    The populated report.

    RunFile(string, string, RecipeRunMode)

    Convenience entry point that loads a recipe file and runs it.

    Declaration
    public static SerenityRecipeReport RunFile(string filePath, string outputRootOverride, RecipeRunMode mode)
    Parameters
    Type Name Description
    string filePath

    Path to the recipe JSON file.

    string outputRootOverride

    Optional output root override.

    RecipeRunMode mode

    How far the run should go.

    Returns
    Type Description
    SerenityRecipeReport

    The populated report.

    In this article
    © 2026 Serenity. All Rights Reserved