ttutisani/Xunit.Gherkin.Quick

Automatically copy all feature files to build output

salaerts opened this issue · 3 comments

The README contains this helpful line:

Important: change feature file properties to ensure it gets copied into output directory. Set the value of Copy to Output Directory to Copy Always or Copy if Newer.

Maybe it might be useful to mention that when using the newer Microsoft.NET.Sdk project files that it is very easy to do this automatically for all feature files in the project by adding a glob pattern to the project file. For example:

  <ItemGroup>
    <None Update="Features\**\*.feature">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>

This has the advantage that you don't need to worry about forgetting to set the property on new feature files.
Of course this will only work if the project file starts with <Project Sdk="Microsoft.NET.Sdk">

Great info, @salaerts

I think this info deserves its own readme file under docs/ folder and a link to it from the default readme file under "See Also". Feel free to do so with a PR, or I can do it with my next set of changes.

Thanks for the detailed info, I appreciate it!

This was addressed by #80 by @salaerts .
@salaerts feel free to close it if there is nothing else pending here.

Closing issue