The Code Generation tool is an external tool used for generating required classes and ORM mappings that are necessary to build the solution. Code generation is required when working on the solution to create the core objects, profiles and extensions. This article describes how code generation is built into the initdevcommand for local development and how it can be executed from a CICD pipeline.
The code generation utility is integrated into the initdevprocess. When you run Initialize-PowershellForDevelopment.ps followed by initdev (as outlined in the Getting Started Guide), the codegen utility is downloaded from MyGet into the tools folder under the Ed-Fi-ODS-Implementation repository and is executed after the Reset-EmptyTemplateDatabase task.
A successful initdev execution will display the tasks executed and their duration as shown, and you can see that code generation utility is downloaded and installed during the process.
The code generation utility can be run from the command line.
To Install the code generation tool manually, run Initialize-PowershellForDevelopment.ps script from a PowerShell prompt as outlined in the Getting Started Guide, followed by the Install-CodeGen-Utiltity command. This will pull the current version of the tool, and install it into the tools folder under the Ed-Fi-ODS-Implementation repository.
To run code generation independently from the build process, the tool can be executed by calling the PowerShell command Run-CodeGen. This will execute the generation process for all required classes.
Developers' Guide Contents
Find out more about how to develop platforms based on the Ed-Fi ODS / API v3.2: