Skip to content

Building

Maud Chiva-Rampazzo edited this page Apr 28, 2020 · 2 revisions

You can build a project using the project Ribbon Bar, or the project’s context menu “Build” item, or Visual Studio’s Build command.

Note: Before being able to build a project, you must save all its parts.

Project Properties

Before building, you can customize the possible outputs, include or exclude producers depending on configuration, etc. If you open the CodeModeler project properties (using standard Visual Studio commands), you will see a “Build” tab:

Project Properties - Picture 90

This options page allows you to configure the producers / generators according to Visual Studio configuration. Here we can see that, in Release mode, we will produce instances, and use the Business Object Model producer.

Note: A CodeModeler project only supports the “.NET” platform.

Build Results

During and after the build, CodeModeler updates the two Visual Studio standard “Output” and “Error List” tool windows, for example:

Build Results - Picture 107

The Output window will show the Console output of the CodeModeler Meta Compiler. Detailed results can also be see using the project’s context menu’s “View Last Build Log” menu item. This will output the content of a [project name].build.xml file that is created aside the project file.

The Error List window will synthetize warnings and/or errors that the CodeModeler Meta Compiler has detected. Here we see a CM0078 error has been raised in the “CarRental” project.

Note: The File and Line columns in the Error List window have no meaning in a CodeModeler project context.

Target Projects

In the Visual Studio environment, producers can be configured to modify targets projects in place, if the project successfully builds.

For example, the output for the “Business Object Model” producer can not only generate C# files, but can also add these files to a target C# project. For example, in the following screenshot, using the BOM producer, we can target a C# project named “CarRental.Bom” in the same Visual Studio solution:

Target Projects - Picture 108

Each time we choose to Build the project “CarRental” CodeModeler project, CodeModeler will automatically modify the “CarRental.Bom” project to synchronize it with the model. If an entity is added to the project, new C# classes will be generated, and the files will be added to the C# project. If entities are deleted, the corresponding files will be physically deleted and removed from the project.

This is a sample result of a simple build; no manual action has been made to the C# project:

Target Projects - Picture 109

Notes:

  • .NET References are also automatically added to target C# projects, when possible.
  • .ResX files (resources) are also added, for all cultures declared in the project and for the neutral culture as well.
  • for other Visual Studio projects targeting .Net Standard, .Net Core or .Net Framework that reference the Business Object Model libray, a NuGet SoftFluent.CodeModeler.Runtime package is available on nuget.org
Clone this wiki locally