Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build tools to match .NET 6 Preview 3 SDK. #2134

Merged
merged 4 commits into from May 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 37 additions & 17 deletions build.cake
Expand Up @@ -235,18 +235,38 @@ Task("CreateMSBuildFolder")
"Microsoft.Build.Utilities.v12.0",
};

// These dependencies are not included in the Microsoft.NET.Sdk package
// but are necessary for some build tasks.
var msBuildDependencies = new []
{
"Microsoft.Deployment.DotNet.Releases",
"Microsoft.NET.StringTools",
"System.Threading.Tasks.Dataflow",
"System.Resources.Extensions"
};

// These dependencies are all copied from the Microsoft.NET.Sdk package since
// we are trying to model a particular SDK's build tools.
var msBuildSdkDependencies = new []
{
"Microsoft.Bcl.AsyncInterfaces",
"Newtonsoft.Json",
"NuGet.Common",
"NuGet.Configuration",
"NuGet.DependencyResolver.Core",
"NuGet.Frameworks",
"NuGet.LibraryModel",
"NuGet.Packaging",
"NuGet.ProjectModel",
"NuGet.Protocol",
"NuGet.Versioning",
"System.Buffers",
"System.Collections.Immutable",
"System.Memory",
"System.Numerics.Vectors",
"System.Resources.Extensions",
"System.Runtime.CompilerServices.Unsafe",
"System.Text.Encodings.Web",
"System.Text.Json",
"System.Threading.Tasks.Dataflow",
"System.Threading.Tasks.Extensions",
};

Expand Down Expand Up @@ -362,6 +382,20 @@ Task("CreateMSBuildFolder")
}
}

Information("Copying MSBuild SDK dependencies...");

var sdkToolsSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.NET.Sdk", "tools", "net472");
foreach (var dependency in msBuildSdkDependencies)
{
var dependencyFileName = dependency + ".dll";
var dependencySourcePath = CombinePaths(sdkToolsSourceFolder, dependencyFileName);
var dependencyTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, dependencyFileName);
if (FileHelper.Exists(dependencySourcePath))
{
FileHelper.Copy(dependencySourcePath, dependencyTargetPath);
}
}

// Copy MSBuild SDK Resolver and DotNetHostResolver
Information("Copying MSBuild SDK resolver...");
var msbuildSdkResolverSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.DotNet.MSBuildSdkResolver", "lib", "net472");
Expand Down Expand Up @@ -425,16 +459,7 @@ Task("CreateMSBuildFolder")
var nugetPackages = new []
{
"NuGet.Commands",
"NuGet.Common",
"NuGet.Configuration",
"NuGet.Credentials",
"NuGet.DependencyResolver.Core",
"NuGet.Frameworks",
"NuGet.LibraryModel",
"NuGet.Packaging",
"NuGet.ProjectModel",
"NuGet.Protocol",
"NuGet.Versioning"
"NuGet.Credentials"
};

foreach (var nugetPackage in nugetPackages)
Expand All @@ -446,11 +471,6 @@ Task("CreateMSBuildFolder")
destination: CombinePaths(msbuildCurrentBinTargetFolder, binaryName));
}

// Copy additional dependency of Microsoft.Build.NuGetSdkResolver
FileHelper.Copy(
source: CombinePaths(env.Folders.Tools, "Newtonsoft.Json", "lib", "net45", "Newtonsoft.Json.dll"),
destination: CombinePaths(msbuildCurrentBinTargetFolder, "Newtonsoft.Json.dll"));

// Copy content of Microsoft.Net.Compilers.Toolset
Information("Copying Microsoft.Net.Compilers.Toolset...");
var compilersSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Net.Compilers.Toolset", "tasks", "net472");
Expand Down
104 changes: 66 additions & 38 deletions tools/packages.config
@@ -1,45 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<!-- These packages are used for building and testing OmniSharp -->
<package id="Cake" version="1.0.0-rc0001" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.1" />
<package id="Microsoft.Build" version="16.9.0" />
<package id="Microsoft.Build.Framework" version="16.9.0" />
<package id="Microsoft.Build.Runtime" version="16.9.0" />
<package id="Microsoft.Build.Tasks.Core" version="16.9.0" />
<package id="Microsoft.Build.Utilities.Core" version="16.9.0" />
<package id="Microsoft.Net.Compilers.Toolset" version="3.9.0-6.21124.20" />
<package id="Microsoft.DotNet.MSBuildSdkResolver" version="6.0.100-preview.1.21109.12" />
<package id="Microsoft.Build.NuGetSdkResolver" version="5.9.0-rc.7121" />
<package id="Newtonsoft.Json" version="12.0.2" />
<package id="NuGet.Build.Tasks" version="5.9.0-rc.7121" />
<package id="NuGet.Commands" version="5.9.0-rc.7121" />
<package id="NuGet.Common" version="5.9.0-rc.7121" />
<package id="NuGet.Configuration" version="5.9.0-rc.7121" />
<package id="NuGet.Credentials" version="5.9.0-rc.7121" />
<package id="NuGet.DependencyResolver.Core" version="5.9.0-rc.7121" />
<package id="NuGet.Frameworks" version="5.9.0-rc.7121" />
<package id="NuGet.LibraryModel" version="5.9.0-rc.7121" />
<package id="NuGet.Packaging" version="5.9.0-rc.7121" />
<package id="NuGet.ProjectModel" version="5.9.0-rc.7121" />
<package id="NuGet.Protocol" version="5.9.0-rc.7121" />
<package id="NuGet.Versioning" version="5.9.0-rc.7121" />
<package id="runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.1.21102.12" />
<package id="runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.1.21102.12" />
<package id="runtime.win-x64.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.1.21102.12" />
<package id="runtime.win-x86.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.1.21102.12" />
<package id="runtime.win-arm64.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.1.21102.12" />
<package id="xunit.runner.console" version="2.4.0" />

<!-- These packages are included in OmniSharp's minimal MSBuild tools -->

<!--
The version for these packages can be found in the dotnet/installer eng/Versions.props file in
the branch that corresponds with the SDK Toolset being modeled.
ex. https://github.com/dotnet/installer/blob/release/6.0.1xx-preview3/eng/Versions.props
-->

<!-- These packages should match the "MicrosoftNETSdkPackageVersion" property-->
<package id="Microsoft.NET.Sdk" version="6.0.100-preview.3.21207.11" />
<package id="Microsoft.DotNet.MSBuildSdkResolver" version="6.0.100-preview.3.21207.11" />

<!-- These packages should match the "MicrosoftNETCoreDotNetHostResolverPackageVersion" property -->
<package id="runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.3.21201.4" />
<package id="runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.3.21201.4" />
<package id="runtime.win-x64.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.3.21201.4" />
<package id="runtime.win-x86.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.3.21201.4" />
<package id="runtime.win-arm64.Microsoft.NETCore.DotNetHostResolver" version="6.0.0-preview.3.21201.4" />

<!--
The version for these packages can be found in the dotnet/sdk eng/Versions.props file in
the branch that corresponds with the "Microsoft.NET.Sdk package" being referenced.
ex. https://github.com/dotnet/sdk/blob/release/6.0.1xx-preview3/eng/Versions.props
-->

<!-- These packages should match the "MicrosoftBuildPackageVersion" property -->
<package id="Microsoft.Build" version="16.10.0-preview-21181-07" />
<package id="Microsoft.Build.Framework" version="16.10.0-preview-21181-07" />
<package id="Microsoft.Build.Runtime" version="16.10.0-preview-21181-07" />
<package id="Microsoft.Build.Tasks.Core" version="16.10.0-preview-21181-07" />
<package id="Microsoft.Build.Utilities.Core" version="16.10.0-preview-21181-07" />
<!-- This package should match as well except the Major & Minor version are set to 1.0 -->
<package id="Microsoft.NET.StringTools" version="1.0.0-preview-21181-07" />

<!-- This package should match the "MicrosoftNetCompilersToolsetPackageVersion" property-->
<package id="Microsoft.Net.Compilers.Toolset" version="3.10.0-3.21201.20" />

<!-- These packages should match the "NuGetBuildTasksPackageVersion" property -->
<package id="Microsoft.Build.NuGetSdkResolver" version="5.10.0-preview.2.7190" />
<package id="NuGet.Build.Tasks" version="5.10.0-preview.2.7190" />
<package id="NuGet.Commands" version="5.10.0-preview.2.7190" />
<package id="NuGet.Credentials" version="5.10.0-preview.2.7190" />

<!-- This package should match the "DeploymentReleasesVersion" property-->
<package id="Microsoft.Deployment.DotNet.Releases" version="1.0.0-preview1.1.21112.1" />

<!--
The version for these packages can be found in the Roslyn release branch that corresponds with the
"Microsoft.NET.Compilers.Toolset" being referenced.
ex. https://github.com/dotnet/roslyn/blob/release/dev16.10-vs-deps/eng/Versions.props
-->

<!-- This package should match the "SystemThreadingTasksDataflowVersion" property-->
<package id="System.Threading.Tasks.Dataflow" version="5.0.0" />

<!-- This package should match the "SystemMemoryVersion" property-->
<package id="System.Memory" version="4.5.4" />

<!-- This package should match the "SystemResourcesExtensionsVersion" property-->
<package id="System.Resources.Extensions" version="4.7.1" />

<!-- These packages should match "SQLitePCLRawbundle_greenVersion" property -->
<package id="SQLitePCLRaw.bundle_green" version="2.0.4" />
<package id="SQLitePCLRaw.core" version="2.0.4" />
<package id="SQLitePCLRaw.provider.e_sqlite3" version="2.0.4" />
<package id="System.Buffers" version="4.5.1" />
<package id="System.Collections.Immutable" version="5.0.0" />
<package id="System.Memory" version="4.5.4" />
<package id="System.Numerics.Vectors" version="4.5.0" />
<package id="System.Resources.Extensions" version="4.7.1" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" />
<package id="System.Text.Encodings.Web" version="4.7.1" />
<package id="System.Text.Json" version="4.7.2" />
<package id="System.Threading.Tasks.Dataflow" version="5.0.0" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" />
<package id="xunit.runner.console" version="2.4.0" />

</packages>