dotmake-build / command-line

Declarative syntax for System.CommandLine via attributes for easy, fast, strongly-typed (no reflection) usage. Includes a source generator which automagically converts your classes to CLI commands and properties to CLI options or CLI arguments.
https://dotmake.build
MIT License
74 stars 6 forks source link

1.8.1 and 1.8.2 versions gives generated file conflict build warning #13

Closed MichaelLogutov closed 6 months ago

MichaelLogutov commented 6 months ago

After upgrading to 1.8.1 and 1.8.2 version I've encounter following build warning (as error due to treat warnings as error setting):

1>(CliServiceCollectionExtensions).g.cs(51,40): Error CS0436 : The type 'CliServiceProviderExtensions' in 'DotMake.CommandLine.SourceGeneration\DotMake.CommandLine.SourceGeneration.CliCommandGenerator\(CliServiceProviderExtensions).g.cs' conflicts with the imported type 'CliServiceProviderExtensions' in 'BugReport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'DotMake.CommandLine.SourceGeneration\DotMake.CommandLine.SourceGeneration.CliCommandGenerator\(CliServiceProviderExtensions).g.cs'.

Here's a repo: BugReport.zip

calacayir commented 6 months ago

Thanks for the bug report. This is now fixed with v1.8.3:

MichaelLogutov commented 6 months ago

Thanks, but adding InternalsVisibleTo (as we usually do with tests sattelite projects) still gets the same error.

Here's updated repo with DI extension usage (as in real project): BugReport.zip

calacayir commented 6 months ago

Ok v1.8.4 should now fix it completely:

MichaelLogutov commented 6 months ago

Yes, now everything works fine. Thanks. And thank you for such neatly done project - a pleasure to use.