Would it be possible to leverage CAKE for the DotnetNew
VictorioBerra opened this issue · 1 comments
VictorioBerra commented
Instead of using our own ProjectExtensions why not use CAKE's library? https://github.com/cake-build/cake/tree/develop/src/Cake.Common/Tools/DotNetCore
This has all the DotnetBuild, DotnetRun, DotnetPublish.
I have not done any serious looking into this, but it seems like we could NuGet CAKE and utilize it here and cutdown on the code we maintain. Also, CAKEs stuff is tested and everything tool.
RehanSaeed commented
This is how it works:
- Run
dotnet new --install
to install the templates. - Run
dotnet new
to create a project in a temporary folder. - Run
dotnet restore
,dotnet build
. - For some tests, I run
dotnet run
with custom port numbers etc. so that there are no port collisions. I then createHttpClient
instances preconfigured with these ports and pass them to the unit test code which runs assetions. Finally we kill the process.
Cake just provides a few very light wrappers around Process.Start
similar to what I do but I do but I let you run code before and after in a test. Also I let you run tests during the test project actually being run. Not much code there to maintain aswell