DarkRift icon indicating copy to clipboard operation
DarkRift copied to clipboard

Switch from MSBuild to Cake

Open JamJar00 opened this issue 2 years ago • 2 comments

Wanted to create this and leave it here to spark some conversation.

Problem

  • MSBuild is incredibly hard to understand
  • MSBuild Commuinty Tasks, which DR uses extensively, is dead and buried
  • Using MSBuild Community Tasks, forces anyone building DR to use .NET Framework which means people on OSX/Linux cannot build DR
    • This makes it a pain to CI as we have to conditionally disable bits of the build process that use it to make it build
  • There's a lot of different parts to building DR: MSBuild, bash/python release script & Unity editor script

Cake

Cake is a build tool written in C#. It's very easy to read and write for people who know C#, very easy to install (dotnet tool restore and you're done) and is completely cross platform (no .NET Framework).

I was able to dev this MR in WSL with only .NET 6 installed and able to build to even the .NET Framework versions (to my surprise) so I'm pretty happy this will open DR dev up to more people!

It does require that users have a basic understanding of using the terminal if they want to do a full build of DR. Currently when a user builds in VS MSBuild will create the ./Build folder but with Cake they'd only get the individual project builds until they run dotnet cake.

This MR replaces all the MSBuild tasks with Cake. Having played with it for an afternoon I'm really happy with how easy it is to use and how much it improves the build process over MSBuild Community Tasks. Personally, I'm keen to adopt this.

Further down the line I can see some opportunity to expand what we do with Cake to make it really easy to dev for DR. For example, creating Unity packages, doing releases (I tried this and there's a lot going on!) and doing the copy from ./Build into DarkRift.Unity so that everything's neatly managed by a single tool and one set of commands.

I'm expecting a lot of discussion 😛

JamJar00 avatar Aug 07 '22 19:08 JamJar00

Not a fan of Msbuild myself and understand the problem, but I will need to sit down and look into Cake, whenever there's time for that. So this PR will be left hanging for some time more.

4real avatar Oct 12 '22 11:10 4real

Note that Unity plans on having MSBuild support in the near future (source, details).

frarees avatar Dec 22 '22 11:12 frarees