ttutisani / Xunit.Gherkin.Quick

BDD in .NET Core - using Xunit and Gherkin (compatible with both .NET Core and .NET)
MIT License
205 stars 29 forks source link

Automatically copy all feature files to build output #79

Closed salaerts closed 5 years ago

salaerts commented 5 years ago

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">

ttutisani commented 5 years ago

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!

ttutisani commented 5 years ago

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

salaerts commented 5 years ago

Closing issue