Merge pull request #7095 from dotnet/merges/release/2.0.0-to-master-20170707-070029

Merge release/2.0.0 to master
This commit is contained in:
Livar 2017-07-07 11:10:48 -07:00 committed by GitHub
commit 7e1fe7eba7
10 changed files with 143 additions and 39 deletions

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<CLI_SharedFrameworkVersion>2.0.0-preview3-25502-01</CLI_SharedFrameworkVersion>
<CLI_MSBuild_Version>15.3.0-preview-000402-01</CLI_MSBuild_Version>
<CLI_Roslyn_Version>2.3.0-beta3-61816-04</CLI_Roslyn_Version>
<CLI_Roslyn_Version>2.3.0-beta4-61830-03</CLI_Roslyn_Version>
<CLI_Roslyn_Satellites_Version>2.3.0-pre-20170624-6</CLI_Roslyn_Satellites_Version>
<CLI_DiaSymNative_Version>1.6.0-beta2-25304</CLI_DiaSymNative_Version>
<CLI_FSharp_Version>4.2.0-rc-170630-0</CLI_FSharp_Version>
@ -23,8 +23,8 @@
<SharedHostVersion>$(CLI_SharedFrameworkVersion)</SharedHostVersion>
<HostFxrVersion>$(CLI_SharedFrameworkVersion)</HostFxrVersion>
<TemplateEngineVersion>1.0.0-beta2-20170629-268</TemplateEngineVersion>
<TemplateEngineTemplateVersion>1.0.0-beta2-20170703-273</TemplateEngineTemplateVersion>
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170703-273</TemplateEngineTemplate2_0Version>
<TemplateEngineTemplateVersion>1.0.0-beta2-20170706-274</TemplateEngineTemplateVersion>
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170706-274</TemplateEngineTemplate2_0Version>
<PlatformAbstractionsVersion>2.0.0-preview3-25428-01</PlatformAbstractionsVersion>
<DependencyModelVersion>2.0.0-preview3-25428-01</DependencyModelVersion>
<CliCommandLineParserVersion>0.1.1-alpha-167</CliCommandLineParserVersion>
@ -35,9 +35,9 @@
<!-- This should either be timestamped or notimestamp as appropriate -->
<AspNetCoreRuntimePackageFlavor>timestamped</AspNetCoreRuntimePackageFlavor>
<AspNetCoreRuntimeVersion>dev-249</AspNetCoreRuntimeVersion>
<AspNetCoreRuntimeVersion>dev-256</AspNetCoreRuntimeVersion>
<AspNetCoherenceLabel>preview3</AspNetCoherenceLabel>
<AspNetCoreCoherenceTimestamp>26071</AspNetCoreCoherenceTimestamp>
<AspNetCoreCoherenceTimestamp>26096</AspNetCoreCoherenceTimestamp>
</PropertyGroup>

View file

@ -5,12 +5,14 @@
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishDebian.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/Badge.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/Checksum.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/RuntimeCoherence.targets" />
<!-- PUBLISH_TO_AZURE_BLOB env variable set by CI -->
<Target Name="Publish"
Condition=" '$(PUBLISH_TO_AZURE_BLOB)' != '' "
DependsOnTargets="Init;
Package;
EvaluateRuntimeCoherence;
PublishArtifacts;
FinishBuild" />

View file

@ -2,7 +2,6 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="FinishBuild"
DependsOnTargets="CheckIfAllBuildsHavePublished;
EvaluateRuntimeCoherence;
FinalizeBuild" />
<Target Name="CheckIfAllBuildsHavePublished">
@ -14,27 +13,6 @@
<Output TaskParameter="HaveAllBuildsPublished" PropertyName="HaveAllBuildsPublished" />
</CheckIfAllBuildsHavePublished>
</Target>
<Target Name="EvaluateRuntimeCoherence"
DependsOnTargets="ReadAspNetCoreSharedRuntimeVersionFile"
BeforeTargets="FinalizeBuild">
<PropertyGroup>
<Coherent>false</Coherent>
<Coherent Condition=" '$(CLI_SharedFrameworkVersion)' == '@(AspNetCoreSharedRuntimeVersion)' ">true</Coherent>
</PropertyGroup>
</Target>
<Target Name="ReadAspNetCoreSharedRuntimeVersionFile"
DependsOnTargets="DownloadHostAndSharedFxArtifacts">
<ItemGroup>
<File Include="$(AspNetCoreSharedRuntimeVersionFile)" />
</ItemGroup>
<ReadLinesFromFile File="@(File)">
<Output
TaskParameter="Lines"
ItemName="AspNetCoreSharedRuntimeVersion"/>
</ReadLinesFromFile>
</Target>
<Target Name="FinalizeBuild"
Condition=" '$(HaveAllBuildsPublished)' == 'True' ">

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="EvaluateRuntimeCoherence"
DependsOnTargets="ReadAspNetCoreSharedRuntimeVersionFile;
CompareRuntimeVersions" />
<Target Name="ReadAspNetCoreSharedRuntimeVersionFile"
DependsOnTargets="DownloadHostAndSharedFxArtifacts">
<ItemGroup>
<File Include="$(AspNetCoreSharedRuntimeVersionFile)" />
</ItemGroup>
<ReadLinesFromFile File="@(File)">
<Output
TaskParameter="Lines"
ItemName="AspNetCoreSharedRuntimeVersion"/>
</ReadLinesFromFile>
</Target>
<Target Name="CompareRuntimeVersions">
<PropertyGroup>
<Coherent>false</Coherent>
<Coherent Condition=" '$(CLI_SharedFrameworkVersion)' == '@(AspNetCoreSharedRuntimeVersion)' ">true</Coherent>
</PropertyGroup>
</Target>
</Project>

View file

@ -16,8 +16,8 @@ param(
. "$PSScriptRoot\..\..\..\scripts\common\_common.ps1"
$RepoRoot = Convert-Path "$PSScriptRoot\..\..\.."
$InstallFileswsx = "install-files.wxs"
$InstallFilesWixobj = "install-files.wixobj"
$InstallFileswsx = "install-msbuild-extensions-files.wxs"
$InstallFilesWixobj = "install-msbuild-extensions-files.wixobj"
function RunHeat
{

View file

@ -6,7 +6,7 @@
<MajorUpgrade DowngradeErrorMessage="$(var.DowngradeErrorMessage)" Schedule="afterInstallInitialize"/>
<MediaTemplate CabinetTemplate="dnet-{0}.cab" CompressionLevel="high" />
<MediaTemplate CabinetTemplate="dnbe{0}.cab" CompressionLevel="high" EmbedCab="yes" />
<Feature Id="MainFeature" Title="Main Feature" Level="1">
<ComponentGroupRef Id="InstallFiles" />

View file

@ -2,10 +2,10 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// NOTE: Currently, only the NET46 build ships (with Visual Studio/desktop msbuild),
// but the netstandard1.3 adaptation here acts a proof-of-concept for cross-platform
// but the netstandard1.5 adaptation here acts a proof-of-concept for cross-platform
// portability of the underlying hostfxr API and gives us build and test coverage
// on non-Windows machines.
#if NETSTANDARD1_3
#if NETSTANDARD1_5
using System.Runtime.InteropServices;
using System.Text;
@ -34,4 +34,4 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
}
}
#endif // NETSTANDARD1_3
#endif // NETSTANDARD1_5

View file

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace Microsoft.DotNet.MSBuildSdkResolver
{
@ -64,6 +65,7 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
+ " the version specified in global.json."
});
}
string minimumMSBuildVersionString = GetMinimumMSBuildVersion(netcoreSdkDir);
var minimumMSBuildVersion = Version.Parse(minimumMSBuildVersionString);
if (context.MSBuildVersion < minimumMSBuildVersion)
@ -77,6 +79,18 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
+ " version currently available."
});
}
string minimumVSDefinedSDKVersion = GetMinimumVSDefinedSDKVersion();
if (IsNetCoreSDKSmallerThanTheMinimumVersion(netcoreSdkVersion, minimumVSDefinedSDKVersion))
{
return factory.IndicateFailure(
new[]
{
$"Version {netcoreSdkVersion} of the .NET Core SDK is smaller than the minimum version"
+ $" {minimumVSDefinedSDKVersion} required by Visual Studio. Check that a recent enough"
+ " .NET Core SDK is installed or increase the version specified in global.json."
});
}
}
string msbuildSdkDir = Path.Combine(msbuildSdksDir, sdkReference.Name, "Sdk");
@ -107,6 +121,22 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
return File.ReadLines(minimumVersionFilePath).First().Trim();
}
private static string GetMinimumVSDefinedSDKVersion()
{
string dotnetMSBuildSdkResolverDirectory =
Path.GetDirectoryName(typeof(DotNetMSBuildSdkResolver).GetTypeInfo().Assembly.Location);
string minimumVSDefinedSdkVersionFilePath =
Path.Combine(dotnetMSBuildSdkResolverDirectory, "minimumVSDefinedSDKVersion");
if (!File.Exists(minimumVSDefinedSdkVersionFilePath))
{
// smallest version that is required by VS 15.3.
return "1.0.4";
}
return File.ReadLines(minimumVSDefinedSdkVersionFilePath).First().Trim();
}
private bool IsNetCoreSDKSmallerThanTheMinimumVersion(string netcoreSdkVersion, string minimumVersion)
{
FXVersion netCoreSdkFXVersion;

View file

@ -3,8 +3,8 @@
<PropertyGroup>
<Version>$(SdkVersion)</Version>
<TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard1.3</TargetFrameworks>
<TargetFrameworks>netstandard1.5;net46</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard1.5</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<WarningsAsErrors>true</WarningsAsErrors>
@ -20,7 +20,7 @@
<PackageReference Include="Microsoft.NETCore.DotNetHostResolver" Version="$(CLI_SharedFrameworkVersion)" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.5'">
<PackageReference Include="NETStandard.Library" Version="1.6.0" />
</ItemGroup>

View file

@ -13,6 +13,8 @@ using Xunit;
using Xunit.Abstractions;
using System;
[assembly: CollectionBehavior(DisableTestParallelization = true)]
namespace Microsoft.DotNet.Cli.Utils.Tests
{
public class GivenAnMSBuildSdkResolver : TestBase
@ -106,11 +108,59 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
}
[Fact]
public void ItReturnsTheVersionIfItIsEqualToTheMinVersion()
public void ItReturnsNullWhenTheDefaultVSRequiredSDKVersionIsHigherThanTheSDKVersionAvailable()
{
var environment = new TestEnvironment();
var expected =
environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "1.0.1");
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
var resolver = environment.CreateResolver();
var result = (MockResult)resolver.Resolve(
new SdkReference("Some.Test.Sdk", null, "1.0.0"),
new MockContext { ProjectFilePath = environment.TestDirectory.FullName },
new MockFactory());
result.Success.Should().BeFalse();
result.Path.Should().BeNull();
result.Version.Should().BeNull();
result.Warnings.Should().BeNullOrEmpty();
result.Errors.Should().Contain($"Version 1.0.1 of the .NET Core SDK is smaller than the minimum version"
+ " 1.0.4 required by Visual Studio. Check that a recent enough"
+ " .NET Core SDK is installed or increase the version specified in global.json.");
}
[Fact]
public void ItReturnsNullWhenTheTheVSRequiredSDKVersionIsHigherThanTheSDKVersionAvailable()
{
var environment = new TestEnvironment();
var expected =
environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "1.0.1");
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
environment.CreateMinimumVSDefinedSDKVersionFile("2.0.0");
var resolver = environment.CreateResolver();
var result = (MockResult)resolver.Resolve(
new SdkReference("Some.Test.Sdk", null, "1.0.0"),
new MockContext { ProjectFilePath = environment.TestDirectory.FullName },
new MockFactory());
result.Success.Should().BeFalse();
result.Path.Should().BeNull();
result.Version.Should().BeNull();
result.Warnings.Should().BeNullOrEmpty();
result.Errors.Should().Contain($"Version 1.0.1 of the .NET Core SDK is smaller than the minimum version"
+ " 2.0.0 required by Visual Studio. Check that a recent enough"
+ " .NET Core SDK is installed or increase the version specified in global.json.");
}
[Fact]
public void ItReturnsTheVersionIfItIsEqualToTheMinVersionAndTheVSDefinedMinVersion()
{
var environment = new TestEnvironment();
var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99");
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
environment.CreateMinimumVSDefinedSDKVersionFile("99.99.99");
var resolver = environment.CreateResolver();
var result = (MockResult)resolver.Resolve(
@ -126,11 +176,12 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
}
[Fact]
public void ItReturnsTheVersionIfItIsHigherThanTheMinVersion()
public void ItReturnsTheVersionIfItIsHigherThanTheMinVersionAndTheVSDefinedMinVersion()
{
var environment = new TestEnvironment();
var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "999.99.99");
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
environment.CreateMinimumVSDefinedSDKVersionFile("999.99.98");
var resolver = environment.CreateResolver();
var result = (MockResult)resolver.Resolve(
@ -167,6 +218,8 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
identifier: identifier,
callingMethod: callingMethod);
DeleteMinimumVSDefinedSDKVersionFile();
PathEnvironmentVariable = string.Empty;
}
@ -248,6 +301,22 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
return null;
}
}
public void CreateMinimumVSDefinedSDKVersionFile(string version)
{
File.WriteAllText(GetMinimumVSDefinedSDKVersionFilePath(), version);
}
private void DeleteMinimumVSDefinedSDKVersionFile()
{
File.Delete(GetMinimumVSDefinedSDKVersionFilePath());
}
private string GetMinimumVSDefinedSDKVersionFilePath()
{
string baseDirectory = AppContext.BaseDirectory;
return Path.Combine(baseDirectory, "minimumVSDefinedSDKVersion");
}
}
private sealed class MockContext : SdkResolverContext