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

Updated build tool version for NET 5 RC2 #1971

Merged
merged 6 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 38 additions & 81 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -267,56 +267,19 @@ Task("CreateMSBuildFolder")
"Workflow.targets",
};

string sdkResolverTFM;

if (Platform.Current.IsWindows)
{
Information("Copying MSBuild runtime...");

var msbuildSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Build.Runtime", "contentFiles", "any", "net472");
DirectoryHelper.Copy(msbuildSourceFolder, msbuildCurrentBinTargetFolder, copySubDirectories: false);

var msbuild15SourceFolder = CombinePaths(msbuildSourceFolder, "Current");
DirectoryHelper.Copy(msbuild15SourceFolder, msbuildCurrentTargetFolder);

Information("Copying MSBuild libraries...");

foreach (var library in msbuildLibraries)
{
var libraryFileName = library + ".dll";
var librarySourcePath = CombinePaths(env.Folders.Tools, library, "lib", "net472", libraryFileName);
var libraryTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, libraryFileName);
if (FileHelper.Exists(librarySourcePath))
{
FileHelper.Copy(librarySourcePath, libraryTargetPath);
}
}

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

foreach (var dependency in msBuildDependencies)
{
var dependencyFileName = dependency + ".dll";
var dependencySourcePath = CombinePaths(env.Folders.Tools, dependency, "lib", "netstandard2.0", dependencyFileName);
var dependencyTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, dependencyFileName);
if (FileHelper.Exists(dependencySourcePath))
{
FileHelper.Copy(dependencySourcePath, dependencyTargetPath);
}
}

sdkResolverTFM = "net472";
}
else
if (!Platform.Current.IsWindows)
{
Information("Copying Mono MSBuild runtime...");
// Copy Mono MSBuild files before overwriting with the latest MSBuild from NuGet since Mono requires
// some extra targets and ref assemblies not present in the NuGet packages.

var monoBasePath = Platform.Current.IsMacOS
? "/Library/Frameworks/Mono.framework/Versions/Current/lib/mono"
: "/usr/lib/mono";
var monoMSBuildPath = $"{monoBasePath}/msbuild/Current/bin";
var monoXBuildPath = $"{monoBasePath}/xbuild/Current";

Information("Copying Mono MSBuild runtime...");

var commonTargetsSourcePath = CombinePaths(monoXBuildPath, "Microsoft.Common.props");
var commonTargetsTargetPath = CombinePaths(msbuildCurrentTargetFolder, "Microsoft.Common.props");
FileHelper.Copy(commonTargetsSourcePath, commonTargetsTargetPath);
Expand All @@ -331,71 +294,65 @@ Task("CreateMSBuildFolder")
}
}

Information("Copying MSBuild runtime...");

var msbuildSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Build.Runtime", "contentFiles", "any", "net472");
DirectoryHelper.Copy(msbuildSourceFolder, msbuildCurrentBinTargetFolder, copySubDirectories: false);

var msbuild15SourceFolder = CombinePaths(msbuildSourceFolder, "Current");
DirectoryHelper.Copy(msbuild15SourceFolder, msbuildCurrentTargetFolder);

Information("Copying MSBuild libraries...");

foreach (var library in msbuildLibraries)
{
var libraryFileName = library + ".dll";
var librarySourcePath = CombinePaths(env.Folders.Tools, library, "lib", "net472", libraryFileName);
var libraryTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, libraryFileName);
if (FileHelper.Exists(librarySourcePath))
{
FileHelper.Copy(librarySourcePath, libraryTargetPath);
}
}

Information("Copying MSBuild Ref Libraries...");
Information("Copying Mono MSBuild Ref Libraries...");

foreach (var refLibrary in msbuildRefLibraries)
{
var refLibraryFileName = refLibrary + ".dll";

// copy MSBuild from current Mono
// copy MSBuild Ref Libraries from current Mono
var refLibrarySourcePath = CombinePaths(monoMSBuildPath, refLibraryFileName);
var refLibraryTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, refLibraryFileName);
if (FileHelper.Exists(refLibrarySourcePath))
{
FileHelper.Copy(refLibrarySourcePath, refLibraryTargetPath);
}
}
}

Information("Copying MSBuild runtime...");

var msbuildSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Build.Runtime", "contentFiles", "any", "net472");
DirectoryHelper.Copy(msbuildSourceFolder, msbuildCurrentBinTargetFolder, copySubDirectories: false);

Information("Copying MSBuild dependencies...");
var msbuild15SourceFolder = CombinePaths(msbuildSourceFolder, "Current");
DirectoryHelper.Copy(msbuild15SourceFolder, msbuildCurrentTargetFolder);

foreach (var dependency in msBuildDependencies)
Information("Copying MSBuild libraries...");

foreach (var library in msbuildLibraries)
{
var libraryFileName = library + ".dll";
var librarySourcePath = CombinePaths(env.Folders.Tools, library, "lib", "net472", libraryFileName);
var libraryTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, libraryFileName);
if (FileHelper.Exists(librarySourcePath))
{
var dependencyFileName = dependency + ".dll";
var dependencySourcePath = CombinePaths(env.Folders.Tools, dependency, "lib", "netstandard2.0", dependencyFileName);
var dependencyTargetPath = CombinePaths(msbuildCurrentBinTargetFolder, dependencyFileName);
if (FileHelper.Exists(dependencySourcePath))
{
FileHelper.Copy(dependencySourcePath, dependencyTargetPath);
}
FileHelper.Copy(librarySourcePath, libraryTargetPath);
}
}

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

sdkResolverTFM = "netstandard2.0";
foreach (var dependency in msBuildDependencies)
{
var dependencyFileName = dependency + ".dll";
var dependencySourcePath = CombinePaths(env.Folders.Tools, dependency, "lib", "netstandard2.0", 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", sdkResolverTFM);
var msbuildSdkResolverSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.DotNet.MSBuildSdkResolver", "lib", "net472");
var msbuildSdkResolverTargetFolder = CombinePaths(msbuildCurrentBinTargetFolder, "SdkResolvers", "Microsoft.DotNet.MSBuildSdkResolver");
DirectoryHelper.ForceCreate(msbuildSdkResolverTargetFolder);
FileHelper.Copy(
source: CombinePaths(msbuildSdkResolverSourceFolder, "Microsoft.DotNet.MSBuildSdkResolver.dll"),
destination: CombinePaths(msbuildSdkResolverTargetFolder, "Microsoft.DotNet.MSBuildSdkResolver.dll"));

FileHelper.Copy(
source: CombinePaths(msbuildSdkResolverSourceFolder, "Microsoft.DotNet.SdkResolver.dll"),
destination: CombinePaths(msbuildSdkResolverTargetFolder, "Microsoft.DotNet.SdkResolver.dll"));

if (Platform.Current.IsWindows)
{
CopyDotNetHostResolver(env, "win", "x86", "hostfxr.dll", msbuildSdkResolverTargetFolder, copyToArchSpecificFolder: true);
Expand All @@ -412,7 +369,7 @@ Task("CreateMSBuildFolder")
}

Information("Copying NuGet SDK resolver...");
var nugetSdkResolverSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Build.NuGetSdkResolver", "lib", sdkResolverTFM);
var nugetSdkResolverSourceFolder = CombinePaths(env.Folders.Tools, "Microsoft.Build.NuGetSdkResolver", "lib", "net472");
var nugetSdkResolverTargetFolder = CombinePaths(msbuildCurrentBinTargetFolder, "SdkResolvers", "Microsoft.Build.NuGetSdkResolver");
DirectoryHelper.ForceCreate(nugetSdkResolverTargetFolder);
FileHelper.Copy(
Expand Down
50 changes: 25 additions & 25 deletions tools/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
<packages>
<package id="Cake" version="0.37.0" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.1" />
<package id="Microsoft.Build" version="16.8.0-preview-20429-01" />
<package id="Microsoft.Build.Framework" version="16.8.0-preview-20429-01" />
<package id="Microsoft.Build.Runtime" version="16.8.0-preview-20429-01" />
<package id="Microsoft.Build.Tasks.Core" version="16.8.0-preview-20429-01" />
<package id="Microsoft.Build.Utilities.Core" version="16.8.0-preview-20429-01" />
<package id="Microsoft.Net.Compilers.Toolset" version="3.8.0-3.20451.2" />
<package id="Microsoft.DotNet.MSBuildSdkResolver" version="5.0.100-rc.1.20431.8" />
<package id="Microsoft.Build.NuGetSdkResolver" version="5.8.0-preview.3.6783" />
<package id="Microsoft.Build" version="16.8.0-preview-20475-05" />
<package id="Microsoft.Build.Framework" version="16.8.0-preview-20475-05" />
<package id="Microsoft.Build.Runtime" version="16.8.0-preview-20475-05" />
<package id="Microsoft.Build.Tasks.Core" version="16.8.0-preview-20475-05" />
<package id="Microsoft.Build.Utilities.Core" version="16.8.0-preview-20475-05" />
<package id="Microsoft.Net.Compilers.Toolset" version="3.8.0-4.20480.4" />
<package id="Microsoft.DotNet.MSBuildSdkResolver" version="5.0.100-rc.2.20480.5" />
<package id="Microsoft.Build.NuGetSdkResolver" version="5.8.0-rc.6860" />
<package id="Newtonsoft.Json" version="12.0.2" />
<package id="NuGet.Build.Tasks" version="5.8.0-preview.3.6783" />
<package id="NuGet.Commands" version="5.8.0-preview.3.6783" />
<package id="NuGet.Common" version="5.8.0-preview.3.6783" />
<package id="NuGet.Configuration" version="5.8.0-preview.3.6783" />
<package id="NuGet.Credentials" version="5.8.0-preview.3.6783" />
<package id="NuGet.DependencyResolver.Core" version="5.8.0-preview.3.6783" />
<package id="NuGet.Frameworks" version="5.8.0-preview.3.6783" />
<package id="NuGet.LibraryModel" version="5.8.0-preview.3.6783" />
<package id="NuGet.Packaging" version="5.8.0-preview.3.6783" />
<package id="NuGet.ProjectModel" version="5.8.0-preview.3.6783" />
<package id="NuGet.Protocol" version="5.8.0-preview.3.6783" />
<package id="NuGet.Versioning" version="5.8.0-preview.3.6783" />
<package id="runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.1.20431.14" />
<package id="runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.1.20431.14" />
<package id="runtime.win-x64.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.1.20431.14" />
<package id="runtime.win-x86.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.1.20431.14" />
<package id="runtime.win-arm64.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.1.20431.14" />
<package id="NuGet.Build.Tasks" version="5.8.0-rc.6860" />
<package id="NuGet.Commands" version="5.8.0-rc.6860" />
<package id="NuGet.Common" version="5.8.0-rc.6860" />
<package id="NuGet.Configuration" version="5.8.0-rc.6860" />
<package id="NuGet.Credentials" version="5.8.0-rc.6860" />
<package id="NuGet.DependencyResolver.Core" version="5.8.0-rc.6860" />
<package id="NuGet.Frameworks" version="5.8.0-rc.6860" />
<package id="NuGet.LibraryModel" version="5.8.0-rc.6860" />
<package id="NuGet.Packaging" version="5.8.0-rc.6860" />
<package id="NuGet.ProjectModel" version="5.8.0-rc.6860" />
<package id="NuGet.Protocol" version="5.8.0-rc.6860" />
<package id="NuGet.Versioning" version="5.8.0-rc.6860" />
<package id="runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.2.20475.5" />
<package id="runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.2.20475.5" />
<package id="runtime.win-x64.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.2.20475.5" />
<package id="runtime.win-x86.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.2.20475.5" />
<package id="runtime.win-arm64.Microsoft.NETCore.DotNetHostResolver" version="5.0.0-rc.2.20475.5" />
<package id="SQLitePCLRaw.bundle_green" version="1.1.2" />
<package id="SQLitePCLRaw.core" version="1.1.2" />
<package id="SQLitePCLRaw.provider.e_sqlite3.net45" version="1.1.2" />
Expand Down