sschmid / Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
MIT License
7.03k stars 1.11k forks source link

1.14 Jenny Generation causes compilation errors when the project is opened with Visual Studio for Mac #1035

Closed AlberGanAvi closed 1 year ago

AlberGanAvi commented 1 year ago

Jenny Generation causes compilation errors when the project is opened with Visual Studio for Mac

Steps to reproduce the behavior:

  1. Open Match-One in a mac with Visual Studio for Mac
  2. Generate with dotnet Jenny/Jenny.Generator.Cli.dll gen
  3. Go to Unity and see that there are compilation errors about duplicated and missing classes

Expected behavior No compilation errors after code generation

Screenshots Captura de pantalla 2022-09-25 a las 0 10 58 Captura de pantalla 2022-09-24 a las 10 17 07

Entitas Version

Additional context I think it happens with Visual Studio for Mac and with Visual Studio Code but for sure not with Rider

Zip with the project The zip contains all the project files after opening it with Visual Studio for Mac and after Jenny Generation was executed so it has compilation errors. Also, I had to remove the Library folder because with it the zip was too big to update to GitHub issues. Match-One_IDE_VisualStudioForMac_GeneratedBroken 2.zip

sschmid commented 1 year ago

@AlberGanAvi I can confirm and reproduce. Unity generates a different csproj file depending on Rider or VS code, which I find surprising. The Roslyn code generator plugin uses standard practices and no special customization, so the VS code produced csproj seems off. I will investigate and check the differences.

sschmid commented 1 year ago

Among other things, this is missing when not using Rider. Adding those fixes the issue for me. Unfortunately, those lines will be removed when csproj is regenerated. Will investigate more

<_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package</_TargetFrameworkDirectories>
<_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package</_FullFrameworkReferenceAssemblyPaths>
<DisableHandlePackageFileConflicts>true</DisableHandlePackageFileConflicts>
sschmid commented 1 year ago

Will fix using a Jenny PreProcessor

sschmid commented 1 year ago

Fixed in Jenny.Plugins 1.1.0

Reattached new Jenny.zip to Entitas 1.14.1 https://github.com/sschmid/Entitas/releases/tag/1.14.1

You can add a new pre processor Jenny.Plugins.ReferenceAssemblyPathsPreProcessor to Jenny.properties like in Match-One https://github.com/sschmid/Match-One/commit/ad34a99ba17e8cd95b698e21384bd7292bc2e5ff