-
Notifications
You must be signed in to change notification settings - Fork 2
ECoreNetto.Tools
ECoreNetto Tools is a commandline application used to process an Ecore model and generate a report on the contents of that model. The application is distributed as an executable via the Releases as well as a dotnet tool available from https://nuget.org.
The tool is built on System.CommandLine and uses Autofac for dependency injection, Serilog for file logging and Spectre.Console for its themed console output. The actual report generators live in the ECoreNetto.Reporting library (see Reporting).
- Download the executable from the latest release. The filename is
ECoreNetto.Tools.exe - Verify that the hash is the same as is documented on the release notes
- Open a Power-Shell console
- Execute the
Get-FileHashproviding the path the downloaded fileECoreNetto.Tools.exe
The tool targets net10.0, so the .NET 10 runtime/SDK is required.
to install:
dotnet tool install --global ECoreNetto.Tools
to uninstall:
dotnet tool uninstall --global ECoreNetto.Tools
When installed as a global tool the command name is ecoretools.
ecoretools can generate four kinds of report:
-
Inspection Report (
inspect): a text based report of the variations of types and multiplicities and a list of classes and features that lack documentation. This report is used to support template based code generation, so that the classes and enums that exercise the variations in the Ecore model can be verified during code generation. -
Excel Report (
excel-report): an Excel workbook with aModel Infosheet andEClass,EEnumandEDataTypesheets that list all classes, their features and documentation. -
HTML Report (
html-report): a single, self-contained HTML document with sections for Enumerations, Primitive Types, Data Types, Classes, Interfaces and Diagrams. Per class it renders the fully-qualified name, generalizations, specializations and containers, a properties table (attributes and references with multiplicity and{ordered}/{unique}/{id}/{readonly}/{transient}/{volatile}/{unsettable}/{derived}/{composite}/{opposite}chips), OCL constraint (rules) and operations tables, plus collapsible sections and embedded, downloadable SVG inheritance and association diagrams. See Reporting for details. -
Markdown Report (
md-report): a Markdown document with a model-information block and Data Types, Enumeration Types and Classes sections.
| command | description | output extension(s) |
|---|---|---|
| inspect | Inspects an ECore model and generates a text report | .txt |
| excel-report | Generates a tabular (Excel) report of the ECore model |
.xlsx, .xlsm, .xltx, .xltm
|
| html-report | Generates an HTML report of the ECore model | .html |
| md-report | Generates a Markdown report of the ECore model | .md |
All commands share the following options:
| option | shorthand | description | default |
|---|---|---|---|
| --input-model | -i | The path to the input .ecore file |
model.ecore |
| --input-directory | -d | The path to a directory of .ecore files; produces a single combined report for every model in it |
(none) |
| --include-referenced-models | -r | Produce a single combined report that also includes every cross-referenced .ecore model reachable from the input model |
false |
| --output-report | -o | The path (including filename) of the report file; the extension must match the report type | per report (e.g. html-report.html) |
| --auto-open-report | -a | Open the generated report with its default application | false |
| --no-logo | Suppress the logo | false | |
| --log-level | Sets the logging level (Trace, Debug, Information, Warning, Error, Critical) | Information | |
| --help | -? | Shows help information |
By default a report documents a single input .ecore file. Cross-file references are still demand-loaded and resolved, but only the entry file's classifiers appear in the report.
windows executable:
ECoreNetto.Tools.exe -?
ECoreNetto.Tools.exe inspect --input-model <path-to-model.ecore> --output-report <path-to-report.txt>
ECoreNetto.Tools.exe excel-report --input-model <path-to-model.ecore> --output-report <path-to-report.xlsx>
ECoreNetto.Tools.exe html-report --input-model <path-to-model.ecore> --output-report <path-to-report.html>
ECoreNetto.Tools.exe md-report --input-model <path-to-model.ecore> --output-report <path-to-report.md>
dotnet tool:
ecoretools -?
ecoretools inspect --input-model <path-to-model.ecore> --output-report <path-to-report.txt>
ecoretools excel-report --input-model <path-to-model.ecore> --output-report <path-to-report.xlsx>
ecoretools html-report --input-model <path-to-model.ecore> --output-report <path-to-report.html>
ecoretools md-report --input-model <path-to-model.ecore> --output-report <path-to-report.md>
A metamodel is often split across several .ecore files (for example the Eclipse Capella metamodel, which spans 21 cross-referencing files). ECoreNetto Tools can produce one report that documents a whole multi-file metamodel. This works for every report type.
There are two ways to select the models:
-
Entry model + everything reachable — pass a single entry file with
-r/--include-referenced-models. The report contains the entry model plus every model that is reachable from it through cross-references.ecoretools html-report -i <entry-model.ecore> -r --output-report combined.html -
A whole directory — pass a directory with
-d/--input-directory. Every.ecorefile in the directory is loaded into oneResourceSetand aggregated into a single report. This reliably covers every file in the folder.ecoretools html-report -d <path-to-ecore-directory> --output-report combined.html ecoretools md-report -d <path-to-ecore-directory> --output-report combined.md ecoretools excel-report -d <path-to-ecore-directory> --output-report combined.xlsx ecoretools inspect -d <path-to-ecore-directory> --output-report combined.txt
When -d is supplied it takes precedence and -i is not required. Cross-file references remain resolved in the combined report, and (for HTML) anchors stay unique across files so the intra-document links work.
Open the file and inspect the contents. When --auto-open-report is used the linked application opens the file. In the case of the Excel report make sure the file is not already open in the application.
copyright @ Starion Group S.A.