The structure of the project looks so that for each entity a separate folder is allocated, which stores the mapper interface, but the generation occurs in the directory above. I need to make the mapper class be generated in the same directory as the interface regardless of the directory name.
My settings:
<ItemGroup>
<Generated Include="**/*.g.cs" />
<!--to clean up generated files dotnet msbuild -t:CleanGenerated-->
</ItemGroup>
<Target Name="CleanGenerated" BeforeTargets="build">
<Delete Files="@(Generated)" />
</Target>
<Target Name="Mapster" AfterTargets="AfterBuild">
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet tool restore" />
<!--<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster model -a "$(TargetDir)$(ProjectName).dll"" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster extension -a "$(TargetDir)$(ProjectName).dll"" />-->
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster mapper -a "$(TargetDir)$(ProjectName).dll"" />
</Target>
Changing the values of the property Generated Include="**/*.g.cs" did not bring any results as well as the use of different options for Mapster.Tool (tried -n -b and -o)