diff --git a/Directory.Build.props b/Directory.Build.props index b05a362ef..b65a72410 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,8 +16,7 @@ netcoreapp3.0 $(ArtifactsDir)symbols\$(Configuration)\Shipping - - NU5125;NU5105 + NU5125;NU5105;NU1701 diff --git a/eng/Versions.props b/eng/Versions.props index 7a778a624..df57a1f12 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -45,6 +45,7 @@ 3.0.100-preview8.19362.4 + $(MicrosoftNETSdkPackageVersion) 3.0.0-preview8-27912-07 @@ -70,6 +71,10 @@ 15.8.0 1.0.0-beta2-18618-05 + + + 2.0.1-servicing-26011-01 + $(RestoreSources); diff --git a/resources/MSBuildImports/Current/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets b/resources/MSBuildImports/Current/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets new file mode 100644 index 000000000..ca098ba55 --- /dev/null +++ b/resources/MSBuildImports/Current/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets @@ -0,0 +1,84 @@ + + + + $(MSBuildExtensionsPath)\Microsoft.TestPlatform.Build.dll + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + + <_TargetFramework Include="$(TargetFrameworks)" /> + + + + + + + + + + + + + + + + + + + + + + VSTest + + + diff --git a/resources/MSBuildImports/Current/Microsoft.Common.targets/ImportAfter/Microsoft.TestPlatform.ImportAfter.targets b/resources/MSBuildImports/Current/Microsoft.Common.targets/ImportAfter/Microsoft.TestPlatform.ImportAfter.targets new file mode 100644 index 000000000..bfe52d7e9 --- /dev/null +++ b/resources/MSBuildImports/Current/Microsoft.Common.targets/ImportAfter/Microsoft.TestPlatform.ImportAfter.targets @@ -0,0 +1,20 @@ + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildExtensionsPath)\Microsoft.TestPlatform.targets + + + diff --git a/resources/MSBuildImports/Current/SolutionFile/ImportAfter/Microsoft.NuGet.ImportAfter.targets b/resources/MSBuildImports/Current/SolutionFile/ImportAfter/Microsoft.NuGet.ImportAfter.targets new file mode 100644 index 000000000..004c32971 --- /dev/null +++ b/resources/MSBuildImports/Current/SolutionFile/ImportAfter/Microsoft.NuGet.ImportAfter.targets @@ -0,0 +1,18 @@ + + + + + $(MSBuildExtensionsPath)\NuGet.targets + + + diff --git a/src/core-sdk-tasks/GenerateMSBuildExtensionsSWR.cs b/src/core-sdk-tasks/GenerateMSBuildExtensionsSWR.cs new file mode 100644 index 000000000..8e9049aa2 --- /dev/null +++ b/src/core-sdk-tasks/GenerateMSBuildExtensionsSWR.cs @@ -0,0 +1,83 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System; +using System.IO; +using System.Linq; +using System.Text; + +namespace Microsoft.DotNet.Cli.Build +{ + public class GenerateMSBuildExtensionsSWR : Task + { + [Required] + public string MSBuildExtensionsLayoutDirectory { get; set; } + + [Required] + public string OutputFile { get; set; } + + public override bool Execute() + { + StringBuilder sb = new StringBuilder(SWR_HEADER); + + AddFolder(sb, + @"MSBuildSdkResolver", + @"MSBuild\15.0\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver"); + + AddFolder(sb, + @"msbuildExtensions", + @"MSBuild"); + + AddFolder(sb, + @"msbuildExtensions-ver", + @"MSBuild\15.0"); + + File.WriteAllText(OutputFile, sb.ToString()); + + return true; + } + + private void AddFolder(StringBuilder sb, string relativeSourcePath, string swrInstallDir) + { + string sourceFolder = Path.Combine(MSBuildExtensionsLayoutDirectory, relativeSourcePath); + var files = Directory.GetFiles(sourceFolder) + .Where(f => !Path.GetExtension(f).Equals(".pdb", StringComparison.OrdinalIgnoreCase)) + .ToList(); + if (files.Any()) + { + sb.Append(@"folder ""InstallDir:\"); + sb.Append(swrInstallDir); + sb.AppendLine(@"\"""); + + foreach (var file in files) + { + sb.Append(@" file source=""!(bindpath.sources)\Redist\Common\NetCoreSDK\MSBuildExtensions\"); + sb.Append(Path.Combine(relativeSourcePath, Path.GetFileName(file))); + sb.AppendLine("\""); + } + + sb.AppendLine(); + } + + foreach (var subfolder in Directory.GetDirectories(sourceFolder)) + { + string subfolderName = Path.GetFileName(subfolder); + string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName); + string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName); + + AddFolder(sb, newRelativeSourcePath, newSwrInstallDir); + } + } + + readonly string SWR_HEADER = @"use vs + +package name=Microsoft.Net.Core.SDK.MSBuildExtensions + version=$(Version) + vs.package.branch=$(VsSingletonPackageBranch) + vs.package.internalRevision=$(PackageInternalRevision) + +"; + } +} diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index e48bbd806..e9f84e078 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -30,6 +30,7 @@ + diff --git a/src/redist/targets/BuildCoreSdkTasks.targets b/src/redist/targets/BuildCoreSdkTasks.targets index ce846644b..fb6aa70bb 100644 --- a/src/redist/targets/BuildCoreSdkTasks.targets +++ b/src/redist/targets/BuildCoreSdkTasks.targets @@ -37,5 +37,6 @@ + diff --git a/src/redist/targets/GenerateMSBuildExtensions.targets b/src/redist/targets/GenerateMSBuildExtensions.targets new file mode 100644 index 000000000..2936166f7 --- /dev/null +++ b/src/redist/targets/GenerateMSBuildExtensions.targets @@ -0,0 +1,49 @@ + + + $(BaseOutputPath)$(Configuration)\MSBuildExtensionsLayout\ + + Microsoft.NET.Build.Extensions + $(NuGetPackageRoot)$(MSBuildExtensionsPackageName.ToLower())/$(MicrosoftNETBuildExtensionsPackageVersion.ToLower()) + + NETStandard.Library.NETFramework + $(NuGetPackageRoot)$(NETStandardLibraryNETFrameworkPackageName.ToLower())/$(CLI_NETStandardLibraryNETFrameworkVersion.ToLower()) + + + + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildExtensionsLayoutDirectory)/%(VSMSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension) + + + + + + \ No newline at end of file diff --git a/src/redist/targets/GenerateMSIs.targets b/src/redist/targets/GenerateMSIs.targets index dffddf82c..45bd54f9b 100644 --- a/src/redist/targets/GenerateMSIs.targets +++ b/src/redist/targets/GenerateMSIs.targets @@ -28,9 +28,9 @@ $(MSBuildThisFileDirectory)packaging/windows/clisdk/VS.Tools.Net.Core.SDK.Resolver.nuspec $(ArtifactsNonShippingPackagesDir)VS.Tools.Net.Core.SDK.Resolver.nupkg - + $(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr @@ -208,24 +208,21 @@ - - - + OutputFile="$(SdkMSBuildExtensionsSwrFile)"/>