Merge pull request #4542 from livarcocc/update_latest_sdk

Updating the SDK to the latest.
This commit is contained in:
Livar 2016-11-01 13:45:42 -07:00 committed by GitHub
commit ad7c462956
36 changed files with 148 additions and 46 deletions

View file

@ -5,6 +5,7 @@
<TargetFrameworks>netcoreapp1.0;net451</TargetFrameworks>
<OutputType>Exe</OutputType>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45+win8;dnxcore50</PackageTargetFallback>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
@ -13,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="dotnet-desktop-and-portable">

View file

@ -7,5 +7,18 @@
"dependencies": {},
"frameworks": {
"net451": {}
},
"runtimes": {
"win7-x64": {},
"win7-x86": {},
"osx.10.10-x64": {},
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"ubuntu.16.04-x64": {},
"centos.7-x64": {},
"rhel.7.2-x64": {},
"debian.8-x64": {},
"fedora.23-x64": {},
"opensuse.13.2-x64": {}
}
}

View file

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="dotnet-desktop-and-portable">

View file

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="ThisIsNotARealDependencyAndIfSomeoneGoesAndAddsAProjectWithThisNameIWillFindThemAndPunishThem">

View file

@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.App">

View file

@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.App">

View file

@ -21,7 +21,7 @@
<EmbeddedResource Include="**\*.resx" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<EmbeddedResource Include="compiler\resources\**\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161012-3</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

View file

@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="ToolWithOutputName">

View file

@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="dotnet-desktop-and-portable">

View file

@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.App">

View file

@ -14,7 +14,7 @@
<EmbeddedResource Include="**\*.resx" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<EmbeddedResource Include="compiler\resources\**\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161012-3</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

View file

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="NETStandard.Library">

View file

@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

View file

@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="dotnet-desktop-and-portable">

View file

@ -16,7 +16,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

View file

@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="NETStandard.Library">

View file

@ -3,7 +3,7 @@
"frameworks": {
"netstandard1.5": {
"dependencies": {
"Microsoft.NET.Sdk": "1.0.0-alpha-20161026-2",
"Microsoft.NET.Sdk": "1.0.0-alpha-20161029-1",
"NETStandard.Library": "1.6.0"
}
}

View file

@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="NETStandard.Library">

View file

@ -3,7 +3,7 @@
"frameworks": {
"netstandard1.5": {
"dependencies": {
"Microsoft.NET.Sdk": "1.0.0-alpha-20161026-2",
"Microsoft.NET.Sdk": "1.0.0-alpha-20161029-1",
"NETStandard.Library": "1.6.0"
}
}

View file

@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="NETStandard.Library">

View file

@ -3,7 +3,7 @@
"frameworks": {
"netstandard1.5": {
"dependencies": {
"Microsoft.NET.Sdk": "1.0.0-alpha-20161026-2",
"Microsoft.NET.Sdk": "1.0.0-alpha-20161029-1",
"NETStandard.Library": "1.6.0"
}
}

View file

@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.App">

View file

@ -15,7 +15,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="dotnet-portable">

View file

@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="NETStandard.Library">

View file

@ -16,7 +16,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">

View file

@ -43,7 +43,7 @@
<Version>1.0.1-beta-000933</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
@ -51,8 +51,5 @@
<Compile Include="**\*.cs" />
<Compile Include="..\Microsoft.DotNet.Cli.Build.Framework\**\*.cs;..\shared-build-targets-utils\**\*.cs;" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<DefineConstants>$(DefineConstants);NETCOREAPP1_0</DefineConstants>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -5,7 +5,9 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Common;
@ -67,6 +69,29 @@ namespace Microsoft.DotNet.TestFramework
return this;
}
public TestAssetInstance WithNuGetConfig(string nugetCache)
{
var thisAssembly = typeof(TestAssetInstance).GetTypeInfo().Assembly;
var newNuGetConfig = Root.GetFile("Nuget.config");
var content = @"<?xml version=""1.0"" encoding=""utf-8""?>
<configuration>
<packageSources>
<add key=""test-packages"" value=""$fullpath$"" />
</packageSources>
</configuration>";
content = content.Replace("$fullpath$", nugetCache);
using (var newNuGetConfigStream =
new FileStream(newNuGetConfig.FullName, FileMode.Create, FileAccess.Write))
{
var contentBytes = new UTF8Encoding(true).GetBytes(content);
newNuGetConfigStream.Write(contentBytes, 0, contentBytes.Length);
}
return this;
}
private void CopyFiles(IEnumerable<FileInfo> filesToCopy)
{
foreach (var file in filesToCopy)

View file

@ -28,6 +28,9 @@ namespace Microsoft.DotNet.Tools.Build
CommandOption outputOption = app.Option("-o|--output <OUTPUT_DIR>", "Directory in which to place outputs", CommandOptionType.SingleValue);
CommandOption frameworkOption = app.Option("-f|--framework <FRAMEWORK>", "Compile a specific framework", CommandOptionType.SingleValue);
CommandOption runtimeOption = app.Option(
"-r|--runtime <RUNTIME_IDENTIFIER>", "Target runtime to build for. The default is to build a portable application.",
CommandOptionType.SingleValue);
CommandOption configurationOption = app.Option("-c|--configuration <CONFIGURATION>", "Configuration under which to build", CommandOptionType.SingleValue);
CommandOption versionSuffixOption = app.Option("--version-suffix <VERSION_SUFFIX>", "Defines the value for the $(VersionSuffix) property in the project", CommandOptionType.SingleValue);
@ -62,6 +65,11 @@ namespace Microsoft.DotNet.Tools.Build
msbuildArgs.Add($"/p:TargetFramework={frameworkOption.Value()}");
}
if (runtimeOption.HasValue())
{
msbuildArgs.Add($"/p:RuntimeIdentifier={runtimeOption.Value()}");
}
if (configurationOption.HasValue())
{
msbuildArgs.Add($"/p:Configuration={configurationOption.Value()}");

View file

@ -16,7 +16,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

View file

@ -15,7 +15,7 @@
<Version>1.6</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

View file

@ -17,7 +17,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk.Web">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161029-1</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics">
<Version>1.0.0</Version>

View file

@ -16,7 +16,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161026-2</Version>
<Version>1.0.0-alpha-20161029-1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk">

View file

@ -29,16 +29,24 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
[WindowsOnlyFact]
public void It_resolves_desktop_apps_defaulting_to_Debug_Configuration()
{
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
var configuration = "Debug";
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
.CreateInstance()
.WithSourceFiles()
.WithRestoreFiles();
.WithNuGetConfig(_repoDirectoriesProvider.TestPackages);
var restoreCommand = new RestoreCommand()
.WithWorkingDirectory(testInstance.Root)
.WithRuntime(runtime)
.ExecuteWithCapturedOutput()
.Should().Pass();
var buildCommand = new BuildCommand()
.WithWorkingDirectory(testInstance.Root)
.WithConfiguration(configuration)
.WithRuntime(runtime)
.WithCapturedOutput()
.Execute()
.Should().Pass();
@ -60,16 +68,24 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
[WindowsOnlyFact]
public void It_resolves_desktop_apps_when_configuration_is_Debug()
{
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
var configuration = "Debug";
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
.CreateInstance()
.WithSourceFiles()
.WithRestoreFiles();
.WithNuGetConfig(_repoDirectoriesProvider.TestPackages);
var restoreCommand = new RestoreCommand()
.WithWorkingDirectory(testInstance.Root)
.WithRuntime(runtime)
.ExecuteWithCapturedOutput()
.Should().Pass();
var buildCommand = new BuildCommand()
.WithWorkingDirectory(testInstance.Root)
.WithConfiguration(configuration)
.WithRuntime(runtime)
.Execute()
.Should().Pass();
@ -89,16 +105,24 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
[WindowsOnlyFact]
public void It_resolves_desktop_apps_when_configuration_is_Release()
{
var configuration = "Release";
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
var configuration = "Debug";
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
.CreateInstance()
.WithSourceFiles()
.WithRestoreFiles();
.WithNuGetConfig(_repoDirectoriesProvider.TestPackages);
var restoreCommand = new RestoreCommand()
.WithWorkingDirectory(testInstance.Root)
.WithRuntime(runtime)
.ExecuteWithCapturedOutput()
.Should().Pass();
var buildCommand = new BuildCommand()
.WithWorkingDirectory(testInstance.Root)
.WithConfiguration(configuration)
.WithRuntime(runtime)
.WithCapturedOutput()
.Execute()
.Should().Pass();
@ -120,16 +144,24 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
[WindowsOnlyFact]
public void It_resolves_desktop_apps_using_configuration_passed_to_create()
{
var configuration = "Release";
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
var configuration = "Debug";
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
.CreateInstance()
.WithSourceFiles()
.WithRestoreFiles();
.WithNuGetConfig(_repoDirectoriesProvider.TestPackages);
var restoreCommand = new RestoreCommand()
.WithWorkingDirectory(testInstance.Root)
.WithRuntime(runtime)
.ExecuteWithCapturedOutput()
.Should().Pass();
var buildCommand = new BuildCommand()
.WithWorkingDirectory(testInstance.Root)
.WithConfiguration(configuration)
.WithRuntime(runtime)
.WithCapturedOutput()
.Execute()
.Should().Pass();

View file

@ -7,21 +7,40 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
{
public sealed class RestoreCommand : TestCommand
{
private string _runtime;
public RestoreCommand()
: base("dotnet")
{
}
public RestoreCommand WithRuntime(string runtime)
{
_runtime = runtime;
return this;
}
public override CommandResult Execute(string args = "")
{
args = $"restore {args} --disable-parallel";
args = $"restore {GetRuntime()} {args} --disable-parallel";
return base.Execute(args);
}
public override CommandResult ExecuteWithCapturedOutput(string args = "")
{
args = $"restore {args} --disable-parallel";
args = $"restore {GetRuntime()} {args} --disable-parallel";
return base.ExecuteWithCapturedOutput(args);
}
private string GetRuntime()
{
if (_runtime == null)
{
return null;
}
return $"/p:RuntimeIdentifier={_runtime}";
}
}
}

View file

@ -68,7 +68,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
_nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages");
_pjDotnet = pjDotnet ?? GetPjDotnetPath();
_stage2Sdk = Directory.EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk")).First();
_testPackages = Path.Combine(_artifacts, "tests", "packages");
_testPackages = Path.Combine(RepoRoot, "artifacts", "testpackages", "packages");
}
private string GetPjDotnetPath()

View file

@ -371,13 +371,14 @@ namespace Microsoft.DotNet.Migration.Tests
[InlineData("TestProjects", "PJTestAppSimple", false)]
public void It_auto_add_desktop_references_during_migrate(string testGroup, string projectName, bool isDesktopApp)
{
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
var testAssetManager = GetTestGroupTestAssetsManager(testGroup);
var projectDirectory = testAssetManager.CreateTestInstance(projectName).WithLockFiles().Path;
CleanBinObj(projectDirectory);
MigrateProject(new string[] { projectDirectory });
Restore(projectDirectory);
BuildMSBuild(projectDirectory, projectName);
Restore(projectDirectory, runtime: runtime);
BuildMSBuild(projectDirectory, projectName, runtime:runtime);
VerifyAutoInjectedDesktopReferences(projectDirectory, projectName, isDesktopApp);
VerifyAllMSBuildOutputsRunnable(projectDirectory);
}
@ -584,10 +585,11 @@ namespace Microsoft.DotNet.Migration.Tests
.Should().Pass();
}
private void Restore(string projectDirectory, string projectName=null)
private void Restore(string projectDirectory, string projectName=null, string runtime=null)
{
var command = new RestoreCommand()
.WithWorkingDirectory(projectDirectory);
.WithWorkingDirectory(projectDirectory)
.WithRuntime(runtime);
if (projectName != null)
{
@ -601,7 +603,11 @@ namespace Microsoft.DotNet.Migration.Tests
}
}
private string BuildMSBuild(string projectDirectory, string projectName, string configuration="Debug")
private string BuildMSBuild(
string projectDirectory,
string projectName,
string configuration="Debug",
string runtime=null)
{
if (projectName != null)
{
@ -612,6 +618,7 @@ namespace Microsoft.DotNet.Migration.Tests
var result = new BuildCommand()
.WithWorkingDirectory(projectDirectory)
.WithRuntime(runtime)
.ExecuteWithCapturedOutput($"{projectName} /p:Configuration={configuration}");
result