Code Generation Utility
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 initdev command for local development and how it can be executed from a CI/CD pipeline.
Running initdev
The code generation utility is integrated into the initdev process. When you
run Initialize-PowershellForDevelopment.ps1 followed by initdev (as outlined in
the Getting Started
Guide), the codegen
utility is downloaded from Azure Artifacts into the tools folder under
the Ed-Fi-ODS-Implementation repository and is executed after the
Invoke-NewDevelopmentAppSettings
task.
<trimmed output...>
2024-10-28 20:11:28,067 [.NET TP Worker] INFO TemplateProcessor - Processing started for assembly: ODS Database Specific in folder: D:\ed-fi\Ed-Fi-ODS\Application\EdFi.Ods.Standard\Standard\5.2.0\Artifacts
2024-10-28 20:11:28,477 [.NET TP Worker] INFO TemplateProcessor - Processing complete for assembly: ODS Database Specific in 00:00:00.4101082.
2024-10-28 20:11:28,478 [.NET TP Worker] INFO Program - Finished code generation in 00:00:07.8224338.
Invoke-CodeGen done in 8s.
Invoke-RebuildSolution NoRestore is False
------------------------------
Invoke-RebuildSolution
------------------------------
<trimmed output...>
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.
<trimmed output...>
Duration Task
-------- ----
00:01.92 Invoke-NewDevelopmentAppSettings
00:02.69 Install-Plugins
00:01.57 Install-CodeGenUtility
00:08.19 Invoke-CodeGen
00:29.14 Invoke-RebuildSolution
00:01.48 Install-DbDeploy
00:15.78 Reset-TestAdminDatabase
00:26.09 Reset-TestSecurityDatabase
00:20.62 Reset-TestPopulatedTemplateDatabase
00:14.31 Reset-AdminDatabase
00:25.81 Reset-SecurityDatabase
00:00.78 Remove-SandboxDatabases
00:19.23 Reset-MinimalTemplateDatabase
00:20.55 Reset-PopulatedTemplateDatabase
- -
03:11.35 Initialize-DevelopmentEnvironment
Manual Execution
The code generation utility can be run from the command line.