Add item templates for Directory.Build.props and Directory.Build.targets
I'm finding myself creating Directory.Build.props and Directory.Build.targets files more and more often these days and having item templates for those in the CLI would be helpful.
Directory.Build.props
| Property | Value |
|---|---|
| Name | Directory.Build.props file |
| Short Name (idea 1) | props |
| Short Name (idea 2) | directorybuildprops |
| Language | (blank) |
| Tags | Build |
Content:
<Project>
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
<PropertyGroup>
</PropertyGroup>
</Project>
Directory.Build.targets
| Property | Value |
|---|---|
| Name | Directory.Build.targets file |
| Short Name (idea 1) | targets |
| Short Name (idea 2) | directorybuildtargets |
| Language | (blank) |
| Tags | Build |
Content:
<Project>
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
<Target Name="CustomAfterBuildTarget" AfterTargets="Build">
</Target>
</Project>
@timheuer @dsplaisted @baronfel
Great suggestion. IMO, props and targets are perhaps too generic names for these templates. On the other hand, directorybuildtargets is sort of long. Maybe directorytargets and directoryprops would work.
Or maybe there could be just one template that creates both the .props and .targets files. Maybe that could be called directorybuild.
What do you think of buildprops and buildtargets? In contrast to something like slnprops/slntargets (for Directory.Solution.props/targets files).
What do you think of buildprops and buildtargets? In contrast to something like slnprops/slntargets (for Directory.Solution.props/targets files).
That also works for me.
Yep, dotnet new buildprops works well for me too 👍
@baronfel assigning to you, as you are working on it. Please let me know otherwise
The buildprops and buildtargets templates should ship with 7.0.200 - thank you for the suggestion!