trinity-rdf icon indicating copy to clipboard operation
trinity-rdf copied to clipboard

Switch automatic Ontologies.g.cs generation off

Open IgorKaplya opened this issue 3 years ago • 5 comments

The autogeneration behavior produces a lot of pitfalls during CI/CD pipelines, as follows:

##[error]Domain\OntologyResources\Focus.cs(13,1): error : R# Ambiguous reference: OymOntology.oym OymOntology.oym

Though I definitely know that my Ontologies.g.cs is consistent and OymOntology.oym class was not ambiguous when pushed to Git.

Steps to reproduce:

  1. Download and unzip free ReSharper command line tools: https://www.jetbrains.com/resharper/download/#section=commandline
  2. run command from unpacked folder (change path to solution of yours):

inspectcode "d:\trinity-rdf-examples\core-example\core-example.csproj" /o:"output.xml" --properties:Configuration=Release --no-build --verbosity=info

  • Expected: Produced output.xml shouldn't contain any CSharpErrors (otherwise code is considered faulty and not accepted as valid PR),
  • Actual: Many errors like
     <Issue TypeId="CSharpErrors" File="ObjectModel\Drug.cs" Offset="1667-1673" Line="37" Message="Ambiguous reference:&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;match" />
     <Issue TypeId="CSharpErrors" File="ObjectModel\Drug.cs" Offset="1910-1916" Line="45" Message="Ambiguous reference:&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;match" />
     <Issue TypeId="CSharpErrors" File="ObjectModel\Drug.cs" Offset="2016-2022" Line="49" Message="Ambiguous reference:&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;match" />

It is very hard to say what exactly causes this issue, I can only assume that R# builds the project and ontologies.g.cs become dirty after that (same command with --verbosity=verbose > output.log contains on a log file:

MsBuild [ProjectModel] Process 26244: Starting ontology generator in d:\work\OYM_files\trinity\trinity-rdf-examples\core-example

Is it possible to switch off auto-generation of Ontologies.g.cs?

IgorKaplya avatar Nov 04 '21 11:11 IgorKaplya