Merge pull request #4499 from eerhardt/FixRun3Project

Fix dotnet run3 --project to pass the project to msbuild.
This commit is contained in:
Livar 2016-10-26 10:57:06 -07:00 committed by GitHub
commit 4aa1c1bfb4
14 changed files with 74 additions and 18 deletions

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-20161026-2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

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-20161026-2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="dotnet-desktop-and-portable">

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -17,7 +17,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161019-1</Version>
<Version>1.0.0-alpha-20161026-2</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-20161019-1</Version>
<Version>1.0.0-alpha-20161026-2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

View file

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

View file

@ -46,6 +46,8 @@ namespace Microsoft.DotNet.Tools.Run
{
List<string> buildArgs = new List<string>();
buildArgs.Add(Project);
buildArgs.Add("/nologo");
buildArgs.Add("/verbosity:quiet");

View file

@ -39,10 +39,9 @@ namespace Microsoft.DotNet.Tests.EndToEnd
.Should()
.Pass();
//TODO: https://github.com/dotnet/sdk/issues/187 - remove framework from below.
new Run3Command()
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput("--framework netcoreapp1.0")
.ExecuteWithCapturedOutput()
.Should()
.Pass()
.And

View file

@ -1,6 +1,7 @@
// 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 System.IO;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
@ -29,10 +30,9 @@ namespace Microsoft.DotNet.Cli.Run3.Tests
.Should()
.Pass();
//TODO: https://github.com/dotnet/sdk/issues/187 - remove framework from below.
new Run3Command()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--framework netcoreapp1.0")
.ExecuteWithCapturedOutput()
.Should()
.Pass()
.And
@ -54,10 +54,9 @@ namespace Microsoft.DotNet.Cli.Run3.Tests
.Should()
.Pass();
//TODO: https://github.com/dotnet/sdk/issues/187 - remove framework from below.
new Run3Command()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--framework netcoreapp1.0")
.ExecuteWithCapturedOutput()
.Should()
.Pass()
.And
@ -85,7 +84,7 @@ namespace Microsoft.DotNet.Cli.Run3.Tests
.Should()
.Pass()
.And
.HaveStdOutContaining("Hello World!");
.HaveStdOutContaining("Hello World!");
}
[Fact]
@ -113,5 +112,61 @@ namespace Microsoft.DotNet.Cli.Run3.Tests
.And
.HaveStdErrContaining("--framework");
}
[Fact]
public void It_runs_portable_apps_from_a_different_path_after_building()
{
var testAppName = "MSBuildTestApp";
var testInstance = TestAssetsManager
.CreateTestInstance(testAppName);
var testProjectDirectory = testInstance.TestRoot;
new Restore3Command()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should()
.Pass();
new Build3Command()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should()
.Pass();
string workingDirectory = Directory.GetParent(testProjectDirectory).FullName;
new Run3Command()
.WithWorkingDirectory(workingDirectory)
.ExecuteWithCapturedOutput($"--no-build --project {Path.Combine(testProjectDirectory, testAppName)}.csproj")
.Should()
.Pass()
.And
.HaveStdOutContaining("Hello World!");
}
[Fact]
public void It_runs_portable_apps_from_a_different_path_without_building()
{
var testAppName = "MSBuildTestApp";
var testInstance = TestAssetsManager
.CreateTestInstance(testAppName);
var testProjectDirectory = testInstance.TestRoot;
new Restore3Command()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should()
.Pass();
string workingDirectory = Directory.GetParent(testProjectDirectory).FullName;
new Run3Command()
.WithWorkingDirectory(workingDirectory)
.ExecuteWithCapturedOutput($"--project {Path.Combine(testProjectDirectory, testAppName)}.csproj")
.Should()
.Pass()
.And
.HaveStdOutContaining("Hello World!");
}
}
}