nhibernate / nhibernate-core

NHibernate Object Relational Mapper
https://nhibernate.info
GNU Lesser General Public License v2.1
2.11k stars 921 forks source link

Add workaround for Rider to see the Antlr3 generated files at design time #3518

Closed hazzik closed 2 months ago

hazzik commented 2 months ago

Re-implemented Antlr's DesignTimeGrammarCompilationWorkaround task to be explicitly run by Rider in design time

I've submitted patch to Antlr, but doubt that it'll be accepted.

fredericDelaporte commented 2 months ago

Can no more compile under VS:

Build started at 07:00...
1>------ Build started: Project: NHibernate, Configuration: Debug Any CPU ------
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(61,11): error MSB4057: The target "DesignTimeGrammarCompilation" does not exist in the project.
1>Done building project "NHibernate.csproj" -- FAILED.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(61,11): error MSB4057: The target "DesignTimeGrammarCompilation" does not exist in the project.
1>Done building project "NHibernate.csproj" -- FAILED.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(61,11): error MSB4057: The target "DesignTimeGrammarCompilation" does not exist in the project.
1>Done building project "NHibernate.csproj" -- FAILED.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(61,11): error MSB4057: The target "DesignTimeGrammarCompilation" does not exist in the project.
1>Done building project "NHibernate.csproj" -- FAILED.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(61,11): error MSB4057: The target "DesignTimeGrammarCompilation" does not exist in the project.
1>Done building project "NHibernate.csproj" -- FAILED.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(61,11): error MSB4057: The target "DesignTimeGrammarCompilation" does not exist in the project.
1>Done building project "NHibernate.csproj" -- FAILED.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(61,11): error MSB4057: The target "DesignTimeGrammarCompilation" does not exist in the project.
1>Done building project "NHibernate.csproj" -- FAILED.
2>------ Build started: Project: NHibernate.DomainModel, Configuration: Debug Any CPU ------
3>------ Build started: Project: NHibernate.Test, Configuration: Debug Any CPU ------
4>------ Build started: Project: NHibernate.Test.VisualBasic, Configuration: Debug Any CPU ------
5>------ Build started: Project: NHibernate.TestDatabaseSetup, Configuration: Debug Any CPU ------
========== Build: 0 succeeded, 5 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 07:00 and took 35,886 seconds ==========

(After bin/obj and .vs purge, VS reload. Does compile again if switched back to master.)

hazzik commented 2 months ago

@fredericDelaporte what if you add <RestorePackages>true</RestorePackages>?

hazzik commented 2 months ago

@fredericDelaporte it seems now it works reliable in both VS and Rider. Could you please check?