dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.24k stars 1.35k forks source link

Distribute MSBuild as stand alone nuget package #2756

Open yahorsi opened 6 years ago

yahorsi commented 6 years ago

In order to make builds reproducible it would be good to store all tools used during build in the source control system. E.g. MSBuild. That will make builds independent from what is installed on the build agents. That will simplify upgrading msbuild as well. Just install new package and commit - you're done for all agents. Ideally compiler should also be distributed as stand alone nuget packages.

kkm000 commented 6 years ago

Please have a look at https://www.nuget.org/packages/Microsoft.Build.Runtime/ -- is not this package what you want?

jaredpar commented 6 years ago

I've been working on creating simple xcopy MSBuild bits based off the available NuGet packages. The project is over here:

https://github.com/jaredpar/xcopy-msbuild

The output is a NuGet package which is essentially a runnable MSBuild instance. It's sufficiently complete to compile projects like dotnet/roslyn.

yahorsi commented 6 years ago

@kkm000 It seems it is what I'm looking for. Just interesting, if there is already Microsoft.Build.Runtime package why @jaredpar have created it's own? How is it different with Microsoft.Build.Runtime?

PS: How is that possible to tell msbuld (and ideally VS as well) to use compilers sfrom come custom folder? Where we could have e.g. Microsoft.Net.Compilers extracted

quasarea commented 6 years ago

@kkm000 Can't even run it - calling C:\PROJECTS\Microsoft.Build.Runtime\contentFiles\any\net46\MSBuild.exe returns:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine) at Microsoft.Build.CommandLine.MSBuildApp.Main()