AutoDto icon indicating copy to clipboard operation
AutoDto copied to clipboard

Source generator doesn't trigger with 2nd+ build, if timespan between commands small.

Open RondoK opened this issue 2 years ago • 0 comments

Description

I have been trying use the library, but even AutoDto.Example fails to apply changes when build executed 2nd+ time. Feels like this specific source generator is not executed but other source generators work fine.

My use case is tightly connected to including generated code into solution via <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> and <CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath> , but I am sure that without these additions the library has same problem.

Steps to reproduce

Build the AutoDto.Example more than once

Optionally: in .editorconfig set auto_dto.logger.log_level = Info Optionally: between builds clean the solution Optionally: between builds add a new property to any BI model Optionally: Add emit generated files. Add to the Auto.DtoExample.DtoModule.csproj <PropertyGroup> <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> <CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath> </PropertyGroup> and delete generated files in the Generated folder between builds Optionally: Change path to the logging file(set another value in auto_dto.logger.folder_path) between builds Optionally: Change auto_dto.debounce.enabled to any value

Expected Result

In output log can see 2nd+ generation info

If property was added between build: property was added to Dto models If EmitCompilerGeneratedFiles turned on: new files were generated If changed path to log file: new log file generated

Actual Result No 2nd+ run info in the log file (based on timestamps)

If EmitCompilerGeneratedFiles turned on: no new files If changed path to log file: no new file

Additional Info

  1. I can get all expected results if I just wait for 15-20+ mins.
  2. I have tried add Enum Generator and it provides all expected results with each build. Thus I assume it is not my environment it is the library.
  3. I have tried with VS2022, rider, and dotnet build (both Auto.DtoExample.DtoModule.csproj and Auto.DtoExample.sln)
  4. Log file can not be deleted for a long time after build have been finished because "it is open in .NET Host"

OS: Win 10

RondoK avatar Dec 31 '23 22:12 RondoK