Class SerenityRecipeExporter
Builds a SerenityRecipe from the Serenity ScriptableObjects already in the project and
writes it as .serenity-recipe.json. The reverse of SerenityRecipeEngine: scan →
map → serialize. The scanned folder becomes the recipe's outputRoot, so an exported recipe
re-imports the same assets in place.
Inherited Members
Namespace: Serenity.ProjectRecipe.Infrastructure.Editor
Assembly: Serenity.UnityProjectRecipe.Infrastructure.Editor.dll
Syntax
public static class SerenityRecipeExporter
Methods
CreateExporters()
Builds the ordered list of section exporters: the built-in ones, then any exporter another assembly declares (discovered by reflection, e.g. localization). Add a built-in section handler here.
Declaration
public static List<ISerenityRecipeSectionExporter> CreateExporters()
Returns
| Type | Description |
|---|---|
| List<ISerenityRecipeSectionExporter> | The section exporters. |
DescribeSupportedContent()
The exporter info box's "supported Serenity assets (...)" clause: every section by the key it has in the recipe file, derived from CreateExporters() so the copy can never drift from the exporters that actually run.
Declaration
public static string DescribeSupportedContent()
Returns
| Type | Description |
|---|---|
| string |
Export(string, string, SerenityRecipeReport)
Scans a folder and builds a recipe describing the supported assets it contains.
Declaration
public static SerenityRecipe Export(string scanRoot, string projectName, SerenityRecipeReport report)
Parameters
| Type | Name | Description |
|---|---|---|
| string | scanRoot | An existing project folder under |
| string | projectName | The recipe's project name. |
| SerenityRecipeReport | report | The report to write into. |
Returns
| Type | Description |
|---|---|
| SerenityRecipe | The built recipe, or null when the scan root is invalid (a blocker is recorded). |
ExportFromCommandLine()
Headless entry point for CI/automation. Reads -recipeScanRoot (default Assets),
-recipeProjectName, and -recipeOutput (required) from the command line, exports, and logs
the report. Invoke with -batchmode -executeMethod
Serenity.ProjectRecipe.Infrastructure.Editor.SerenityRecipeExporter.ExportFromCommandLine.
Declaration
public static void ExportFromCommandLine()
ExportToFile(string, string, string)
Convenience entry point: scan, build, and write a recipe file.
Declaration
public static SerenityRecipeReport ExportToFile(string scanRoot, string projectName, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | scanRoot | The folder to scan. |
| string | projectName | The recipe's project name. |
| string | filePath | The destination file path. |
Returns
| Type | Description |
|---|---|
| SerenityRecipeReport | The populated report. |
ToJson(SerenityRecipe)
Serializes a recipe to pretty-printed JSON.
Declaration
public static string ToJson(SerenityRecipe recipe)
Parameters
| Type | Name | Description |
|---|---|---|
| SerenityRecipe | recipe | The recipe. |
Returns
| Type | Description |
|---|---|
| string | The JSON text. |
WriteToFile(SerenityRecipe, string, SerenityRecipeReport)
Writes a recipe to a file as JSON.
Declaration
public static bool WriteToFile(SerenityRecipe recipe, string filePath, SerenityRecipeReport report)
Parameters
| Type | Name | Description |
|---|---|---|
| SerenityRecipe | recipe | The recipe. |
| string | filePath | The destination file path. |
| SerenityRecipeReport | report | The report to write into. |
Returns
| Type | Description |
|---|---|
| bool | True when the file was written. |