Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Code Generation tool is an external tool used for generating the required classes , and ORM mappings that are necessary to build the solution. Code generation is required when working on the solution , for to create the core objects, profiles and extensions. This article describes how code generation is built into the initdev  command command for local development and how it can be executed from a CICD pipeline

Anchor
Required Dependency
Required Dependency
Required Dependency

The code generation tool requires Microsoft's open source framework .NET Core version 2.2.4.

Anchor
Running initdev
Running initdev
Running initdev

The code generation utility is integrated into the initdev process. When you run Initialize-PowershellForDevelopment.ps followed by initdev  as outlined (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.

Image Modified

Image Modified

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.

Image Modified

Anchor
Manual Execution
Manual Execution
Manual Execution

The code generation utility can be run from the command line.

Installation

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.

Image Modified

Execution

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.

Image Modified

Include Page
_Platform Developers' Guide - Sidebar
_Platform Developers' Guide - Sidebar