dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.76k stars 1.07k forks source link

Support custom scripts #10306

Open rogsfernandes opened 5 years ago

rogsfernandes commented 5 years ago

My project has some micro-services written with DotNet Core C# and we have some scripts that we use very often and are very long to remind, so we put them in a README.MD file and copy every time, which isn't very productive.

Example:

dotnet test --no-build /p:CollectCoverage=true /p:Exclude=\"[Crosscutting.*]*,[xunit.*]*\" /p:CoverletOutputFormat=cobertura /p:CoverletOutput='../'

And would be very nice if we could just have a JSON file in the project root folder and add some shortcuts. Just like npm-scripts (but without installing anything other than the dotnet cli).

{
tests: dotnet test --no-build /p:CollectCoverage=true /p:Exclude=\"[Crosscutting.*]*,[xunit.*]*,[*]*.Models*,[*]*.DTO*\" /
}
livarcocc commented 5 years ago

cc @KathleenDollard

KathleenDollard commented 5 years ago

Agree that this is a good backlog item.

peterblazejewicz commented 5 years ago

It looks like commands and scripts feature from defunct project.json: https://github.com/aspnet/AspNetCore/wiki/Project.json-file

rogsfernandes commented 5 years ago

It's a little bit similar. But the main idea is to be flexible, allowing to create new scripts alias. Also, I believe that the root project folder (.sln level) would be better than the project level. Or, in the best scenario, support both. I would be happy to help, just need to be sure of the path to follow.