Merge branch 'rel/1.0.0' into enablevstest
This commit is contained in:
commit
5c5f593449
57 changed files with 500 additions and 132 deletions
|
@ -5,6 +5,7 @@
|
||||||
<TargetFrameworks>netcoreapp1.0;net451</TargetFrameworks>
|
<TargetFrameworks>netcoreapp1.0;net451</TargetFrameworks>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45+win8;dnxcore50</PackageTargetFallback>
|
<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>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="**\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<Compile Include="**\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
|
@ -13,7 +14,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="dotnet-desktop-and-portable">
|
<PackageReference Include="dotnet-desktop-and-portable">
|
||||||
|
|
|
@ -7,5 +7,18 @@
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": {}
|
"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": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="dotnet-desktop-and-portable">
|
<PackageReference Include="dotnet-desktop-and-portable">
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="ThisIsNotARealDependencyAndIfSomeoneGoesAndAddsAProjectWithThisNameIWillFindThemAndPunishThem">
|
<PackageReference Include="ThisIsNotARealDependencyAndIfSomeoneGoesAndAddsAProjectWithThisNameIWillFindThemAndPunishThem">
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NETCore.App">
|
<PackageReference Include="Microsoft.NETCore.App">
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NETCore.App">
|
<PackageReference Include="Microsoft.NETCore.App">
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<EmbeddedResource Include="**\*.resx" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<EmbeddedResource Include="**\*.resx" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
<EmbeddedResource Include="compiler\resources\**\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<EmbeddedResource Include="compiler\resources\**\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161012-3</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="ToolWithOutputName">
|
<PackageReference Include="ToolWithOutputName">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="dotnet-desktop-and-portable">
|
<PackageReference Include="dotnet-desktop-and-portable">
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NETCore.App">
|
<PackageReference Include="Microsoft.NETCore.App">
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<EmbeddedResource Include="**\*.resx" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<EmbeddedResource Include="**\*.resx" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
<EmbeddedResource Include="compiler\resources\**\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<EmbeddedResource Include="compiler\resources\**\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161012-3</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
noautobuild
|
|
@ -0,0 +1,5 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"frameworks": {
|
||||||
|
"netstandard1.3": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.AppContext": "4.1.0",
|
||||||
|
"NETStandard.Library": "1.5.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,7 +11,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="NETStandard.Library">
|
<PackageReference Include="NETStandard.Library">
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
noautobuild
|
|
@ -0,0 +1,5 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"frameworks": {
|
||||||
|
"netstandard1.3": {
|
||||||
|
"dependencies": {
|
||||||
|
"System.AppContext": "4.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="dotnet-desktop-and-portable">
|
<PackageReference Include="dotnet-desktop-and-portable">
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="NETStandard.Library">
|
<PackageReference Include="NETStandard.Library">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netstandard1.5": {
|
"netstandard1.5": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.NET.Sdk": "1.0.0-alpha-20161026-2",
|
"Microsoft.NET.Sdk": "1.0.0-alpha-20161029-1",
|
||||||
"NETStandard.Library": "1.6.0"
|
"NETStandard.Library": "1.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="NETStandard.Library">
|
<PackageReference Include="NETStandard.Library">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netstandard1.5": {
|
"netstandard1.5": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.NET.Sdk": "1.0.0-alpha-20161026-2",
|
"Microsoft.NET.Sdk": "1.0.0-alpha-20161029-1",
|
||||||
"NETStandard.Library": "1.6.0"
|
"NETStandard.Library": "1.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="NETStandard.Library">
|
<PackageReference Include="NETStandard.Library">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netstandard1.5": {
|
"netstandard1.5": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.NET.Sdk": "1.0.0-alpha-20161026-2",
|
"Microsoft.NET.Sdk": "1.0.0-alpha-20161029-1",
|
||||||
"NETStandard.Library": "1.6.0"
|
"NETStandard.Library": "1.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NETCore.App">
|
<PackageReference Include="Microsoft.NETCore.App">
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="dotnet-portable">
|
<PackageReference Include="dotnet-portable">
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
// 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;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using TestLibrary;
|
||||||
|
|
||||||
|
namespace TestApp
|
||||||
|
{
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
public static int Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("This string came from ProjectA");
|
||||||
|
Console.WriteLine($"{ProjectB.GetMessage()}");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"buildOptions": {
|
||||||
|
"emitEntryPoint": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ProjectB": "1.0.0-*",
|
||||||
|
"Microsoft.NETCore.App": "1.0.1"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp1.0": {}
|
||||||
|
},
|
||||||
|
"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": {}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
namespace TestLibrary
|
||||||
|
{
|
||||||
|
public static class ProjectB
|
||||||
|
{
|
||||||
|
public static string GetMessage()
|
||||||
|
{
|
||||||
|
return "This string came from ProjectB";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"buildOptions": {
|
||||||
|
"nowarn": [
|
||||||
|
"CS1591"
|
||||||
|
],
|
||||||
|
"xmlDoc": true,
|
||||||
|
"additionalArguments": [
|
||||||
|
"-highentropyva+"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"NETStandard.Library": "1.6.0"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netstandard1.5": {}
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,7 +14,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="NETStandard.Library">
|
<PackageReference Include="NETStandard.Library">
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="MSTest.TestFramework">
|
<PackageReference Include="MSTest.TestFramework">
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
<Version>1.0.1-beta-000933</Version>
|
<Version>1.0.1-beta-000933</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -51,8 +51,5 @@
|
||||||
<Compile Include="**\*.cs" />
|
<Compile Include="**\*.cs" />
|
||||||
<Compile Include="..\Microsoft.DotNet.Cli.Build.Framework\**\*.cs;..\shared-build-targets-utils\**\*.cs;" />
|
<Compile Include="..\Microsoft.DotNet.Cli.Build.Framework\**\*.cs;..\shared-build-targets-utils\**\*.cs;" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
|
|
||||||
<DefineConstants>$(DefineConstants);NETCOREAPP1_0</DefineConstants>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -6,5 +6,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
||||||
internal class ConstantPackageVersions
|
internal class ConstantPackageVersions
|
||||||
{
|
{
|
||||||
public const string AspNetToolsVersion = "1.0.0-rc1-final";
|
public const string AspNetToolsVersion = "1.0.0-rc1-final";
|
||||||
|
public const string TestSdkPackageVersion = "15.0.0-preview-20161024-02";
|
||||||
|
public const string XUnitPackageVersion = "2.2.0-beta3-build3402";
|
||||||
|
public const string XUnitRunnerPackageVersion = "2.2.0-beta4-build1188";
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,32 +5,67 @@ using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.ProjectJsonMigration
|
namespace Microsoft.DotNet.ProjectJsonMigration
|
||||||
{
|
{
|
||||||
|
internal class PackageDependencyInfo
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Version { get; set; }
|
||||||
|
public string PrivateAssets { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
internal class PackageConstants
|
internal class PackageConstants
|
||||||
{
|
{
|
||||||
public const string SdkPackageName = "Microsoft.NET.Sdk";
|
public const string SdkPackageName = "Microsoft.NET.Sdk";
|
||||||
public const string WebSdkPackageName = "Microsoft.NET.Sdk.Web";
|
public const string WebSdkPackageName = "Microsoft.NET.Sdk.Web";
|
||||||
public const string TestSdkPackageName = "Microsoft.NET.Test.Sdk";
|
public const string TestSdkPackageName = "Microsoft.NET.Test.Sdk";
|
||||||
public const string TestSdkPackageVersion = "15.0.0-preview-20161024-02";
|
|
||||||
public const string XUnitPackageName = "xunit";
|
public const string XUnitPackageName = "xunit";
|
||||||
public const string XUnitPackageVersion = "2.2.0-beta3-build3402";
|
|
||||||
public const string XUnitRunnerPackageName = "xunit.runner.visualstudio";
|
public const string XUnitRunnerPackageName = "xunit.runner.visualstudio";
|
||||||
public const string XUnitRunnerPackageVersion = "2.2.0-beta4-build1188";
|
public const string NetStandardPackageName = "NETStandard.Library";
|
||||||
|
public const string NetStandardPackageVersion = "1.6.0";
|
||||||
|
|
||||||
public static readonly IDictionary<string, string> AspProjectDependencyToolsPackages = new Dictionary<string, string> {
|
public static readonly IDictionary<string, PackageDependencyInfo> ProjectDependencyPackages =
|
||||||
{"Microsoft.EntityFrameworkCore.Tools", "Microsoft.EntityFrameworkCore.Tools"},
|
new Dictionary<string, PackageDependencyInfo> {
|
||||||
{"Microsoft.AspNetCore.Razor.Tools", "Microsoft.AspNetCore.Razor.Design"},
|
{"Microsoft.EntityFrameworkCore.Tools", new PackageDependencyInfo {
|
||||||
{"Microsoft.AspNetCore.Razor.Design", "Microsoft.AspNetCore.Razor.Design"},
|
Name = "Microsoft.EntityFrameworkCore.Tools",
|
||||||
{"Microsoft.VisualStudio.Web.CodeGenerators.Mvc", "Microsoft.VisualStudio.Web.CodGeneration.Design"},
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
{"Microsoft.VisualStudio.Web.CodeGeneration.Tools", ""},
|
{ "Microsoft.AspNetCore.Razor.Tools", new PackageDependencyInfo {
|
||||||
|
Name = "Microsoft.AspNetCore.Razor.Design",
|
||||||
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
|
{ "Microsoft.AspNetCore.Razor.Design", new PackageDependencyInfo {
|
||||||
|
Name = "Microsoft.AspNetCore.Razor.Design",
|
||||||
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
|
{ "Microsoft.VisualStudio.Web.CodeGenerators.Mvc", new PackageDependencyInfo {
|
||||||
|
Name = "Microsoft.VisualStudio.Web.CodeGeneration.Design",
|
||||||
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
|
{ "Microsoft.VisualStudio.Web.CodeGeneration.Tools", null},
|
||||||
|
{ TestSdkPackageName, new PackageDependencyInfo {
|
||||||
|
Name = TestSdkPackageName,
|
||||||
|
Version = ConstantPackageVersions.TestSdkPackageVersion } },
|
||||||
|
{ XUnitPackageName, new PackageDependencyInfo {
|
||||||
|
Name = XUnitPackageName,
|
||||||
|
Version = ConstantPackageVersions.XUnitPackageVersion } },
|
||||||
|
{ XUnitRunnerPackageName, new PackageDependencyInfo {
|
||||||
|
Name = XUnitRunnerPackageName,
|
||||||
|
Version = ConstantPackageVersions.XUnitRunnerPackageVersion } },
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly IDictionary<string, string> AspProjectToolsPackages = new Dictionary<string, string> {
|
public static readonly IDictionary<string, PackageDependencyInfo> ProjectToolPackages =
|
||||||
{"Microsoft.EntityFrameworkCore.Tools", "Microsoft.EntityFrameworkCore.Tools.DotNet"},
|
new Dictionary<string, PackageDependencyInfo> {
|
||||||
{"Microsoft.AspNetCore.Razor.Tools", "Microsoft.AspNetCore.Razor.Tools"},
|
{"Microsoft.EntityFrameworkCore.Tools", new PackageDependencyInfo {
|
||||||
{"Microsoft.VisualStudio.Web.CodeGeneration.Tools", "Microsoft.VisualStudio.Web.CodeGeneration.Tools"},
|
Name = "Microsoft.EntityFrameworkCore.Tools.DotNet",
|
||||||
{"Microsoft.DotNet.Watcher.Tools", "Microsoft.DotNet.Watcher.Tools"},
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
{"Microsoft.Extensions.SecretManager.Tools", "Microsoft.Extensions.SecretManager.Tools"},
|
{ "Microsoft.AspNetCore.Razor.Tools", new PackageDependencyInfo {
|
||||||
{"Microsoft.AspNetCore.Server.IISIntegration.Tools", ""}
|
Name = "Microsoft.AspNetCore.Razor.Tools",
|
||||||
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
|
{ "Microsoft.VisualStudio.Web.CodeGeneration.Tools", new PackageDependencyInfo {
|
||||||
|
Name = "Microsoft.VisualStudio.Web.CodeGeneration.Tools",
|
||||||
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
|
{ "Microsoft.DotNet.Watcher.Tools", new PackageDependencyInfo {
|
||||||
|
Name = "Microsoft.DotNet.Watcher.Tools",
|
||||||
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
|
{ "Microsoft.Extensions.SecretManager.Tools", new PackageDependencyInfo {
|
||||||
|
Name = "Microsoft.Extensions.SecretManager.Tools",
|
||||||
|
Version = ConstantPackageVersions.AspNetToolsVersion } },
|
||||||
|
{ "Microsoft.AspNetCore.Server.IISIntegration.Tools", null}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -98,7 +98,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
||||||
|
|
||||||
foreach (var projectFileDependency in
|
foreach (var projectFileDependency in
|
||||||
projectFileDependenciesForFramework.Where(p =>
|
projectFileDependenciesForFramework.Where(p =>
|
||||||
p.LibraryRange.TypeConstraint == LibraryDependencyTarget.Project))
|
p.LibraryRange.TypeConstraint == LibraryDependencyTarget.Project ||
|
||||||
|
p.LibraryRange.TypeConstraint == LibraryDependencyTarget.All))
|
||||||
{
|
{
|
||||||
var dependencyName = projectFileDependency.Name;
|
var dependencyName = projectFileDependency.Name;
|
||||||
|
|
||||||
|
|
|
@ -13,59 +13,59 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
||||||
{
|
{
|
||||||
public static ProjectType GetProjectType(this Project project)
|
public static ProjectType GetProjectType(this Project project)
|
||||||
{
|
{
|
||||||
var projectType = ProjectType.Console;
|
ProjectType projectType = ProjectType.Library;
|
||||||
if (project.IsWebProject())
|
if (project.IsTestProject)
|
||||||
{
|
|
||||||
projectType = ProjectType.Web;
|
|
||||||
}
|
|
||||||
else if (project.IsTestProject)
|
|
||||||
{
|
{
|
||||||
projectType = ProjectType.Test;
|
projectType = ProjectType.Test;
|
||||||
}
|
}
|
||||||
|
else if (project.HasEntryPoint())
|
||||||
|
{
|
||||||
|
if (project.HasDependency(ContainingName(".AspNetCore.")))
|
||||||
|
{
|
||||||
|
projectType = ProjectType.Web;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
projectType = ProjectType.Console;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return projectType;
|
return projectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsWebProject(this Project project)
|
private static bool HasEntryPoint(this Project project)
|
||||||
{
|
{
|
||||||
if(project.IsTestProject)
|
return project.GetCompilerOptions(null, "Debug").EmitEntryPoint.GetValueOrDefault();
|
||||||
{
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var isExecutable = project.GetCompilerOptions(null, "Debug").EmitEntryPoint.GetValueOrDefault();
|
private static Func<ProjectLibraryDependency, bool> ContainingName(string nameSegment)
|
||||||
if (isExecutable
|
{
|
||||||
&& project.HasAnyPackageContainingName(".AspNetCore."))
|
return x => x.Name.IndexOf(nameSegment, StringComparison.OrdinalIgnoreCase) > -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool HasDependency(this Project project, Func<ProjectLibraryDependency, bool> pred)
|
||||||
|
{
|
||||||
|
if (HasAnyDependency(project.Dependencies, pred))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var tf in project.GetTargetFrameworks())
|
||||||
|
{
|
||||||
|
if(HasAnyDependency(tf.Dependencies, pred))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool HasAnyPackageContainingName(this Project project, string nameSegment)
|
private static bool HasAnyDependency(
|
||||||
|
IEnumerable<ProjectLibraryDependency> dependencies,
|
||||||
|
Func<ProjectLibraryDependency, bool> pred)
|
||||||
{
|
{
|
||||||
var containsPackageName = HasAnyPackageContainingName(
|
return dependencies.Any(pred);
|
||||||
new ReadOnlyCollection<ProjectLibraryDependency>(project.Dependencies),
|
|
||||||
nameSegment);
|
|
||||||
foreach (var tf in project.GetTargetFrameworks())
|
|
||||||
{
|
|
||||||
if(containsPackageName)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
containsPackageName = HasAnyPackageContainingName(tf.Dependencies, nameSegment);
|
|
||||||
}
|
|
||||||
|
|
||||||
return containsPackageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool HasAnyPackageContainingName(
|
|
||||||
IReadOnlyList<ProjectLibraryDependency> dependencies,
|
|
||||||
string nameSegment)
|
|
||||||
{
|
|
||||||
return dependencies.Any(x => x.Name.IndexOf(nameSegment, StringComparison.OrdinalIgnoreCase) > -1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
||||||
internal enum ProjectType
|
internal enum ProjectType
|
||||||
{
|
{
|
||||||
Console,
|
Console,
|
||||||
Web,
|
Library,
|
||||||
Test
|
Test,
|
||||||
|
Web
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -108,7 +108,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
new PackageDependencyInfo
|
new PackageDependencyInfo
|
||||||
{
|
{
|
||||||
Name = PackageConstants.TestSdkPackageName,
|
Name = PackageConstants.TestSdkPackageName,
|
||||||
Version = PackageConstants.TestSdkPackageVersion
|
Version = ConstantPackageVersions.TestSdkPackageVersion
|
||||||
}),
|
}),
|
||||||
noFrameworkPackageReferenceItemGroup,
|
noFrameworkPackageReferenceItemGroup,
|
||||||
mergeExisting: false);
|
mergeExisting: false);
|
||||||
|
@ -120,7 +120,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
new PackageDependencyInfo
|
new PackageDependencyInfo
|
||||||
{
|
{
|
||||||
Name = PackageConstants.XUnitPackageName,
|
Name = PackageConstants.XUnitPackageName,
|
||||||
Version = PackageConstants.XUnitPackageVersion
|
Version = ConstantPackageVersions.XUnitPackageVersion
|
||||||
}),
|
}),
|
||||||
noFrameworkPackageReferenceItemGroup,
|
noFrameworkPackageReferenceItemGroup,
|
||||||
mergeExisting: false);
|
mergeExisting: false);
|
||||||
|
@ -130,12 +130,27 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
new PackageDependencyInfo
|
new PackageDependencyInfo
|
||||||
{
|
{
|
||||||
Name = PackageConstants.XUnitRunnerPackageName,
|
Name = PackageConstants.XUnitRunnerPackageName,
|
||||||
Version = PackageConstants.XUnitRunnerPackageVersion
|
Version = ConstantPackageVersions.XUnitRunnerPackageVersion
|
||||||
}),
|
}),
|
||||||
noFrameworkPackageReferenceItemGroup,
|
noFrameworkPackageReferenceItemGroup,
|
||||||
mergeExisting: false);
|
mergeExisting: false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ProjectType.Library:
|
||||||
|
if (!project.HasDependency(
|
||||||
|
(dep) => dep.Name.Trim().ToLower() == PackageConstants.NetStandardPackageName.ToLower()))
|
||||||
|
{
|
||||||
|
_transformApplicator.Execute(
|
||||||
|
PackageDependencyInfoTransform().Transform(
|
||||||
|
new PackageDependencyInfo
|
||||||
|
{
|
||||||
|
Name = PackageConstants.NetStandardPackageName,
|
||||||
|
Version = PackageConstants.NetStandardPackageVersion
|
||||||
|
}),
|
||||||
|
noFrameworkPackageReferenceItemGroup,
|
||||||
|
mergeExisting: true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -186,7 +201,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
_transformApplicator.Execute(
|
_transformApplicator.Execute(
|
||||||
ToolTransform().Transform(ToPackageDependencyInfo(
|
ToolTransform().Transform(ToPackageDependencyInfo(
|
||||||
tool,
|
tool,
|
||||||
PackageConstants.AspProjectToolsPackages)),
|
PackageConstants.ProjectToolPackages)),
|
||||||
itemGroup,
|
itemGroup,
|
||||||
mergeExisting: true);
|
mergeExisting: true);
|
||||||
}
|
}
|
||||||
|
@ -243,7 +258,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
_transformApplicator.Execute(
|
_transformApplicator.Execute(
|
||||||
transform.Transform(ToPackageDependencyInfo(
|
transform.Transform(ToPackageDependencyInfo(
|
||||||
packageDependency,
|
packageDependency,
|
||||||
PackageConstants.AspProjectDependencyToolsPackages)),
|
PackageConstants.ProjectDependencyPackages)),
|
||||||
itemGroup,
|
itemGroup,
|
||||||
mergeExisting: true);
|
mergeExisting: true);
|
||||||
}
|
}
|
||||||
|
@ -251,22 +266,23 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
|
|
||||||
private PackageDependencyInfo ToPackageDependencyInfo(
|
private PackageDependencyInfo ToPackageDependencyInfo(
|
||||||
ProjectLibraryDependency dependency,
|
ProjectLibraryDependency dependency,
|
||||||
IDictionary<string, string> toolsDictionary)
|
IDictionary<string, PackageDependencyInfo> dependencyToVersionMap)
|
||||||
{
|
{
|
||||||
var name = dependency.Name;
|
var name = dependency.Name;
|
||||||
var version = dependency.LibraryRange?.VersionRange?.OriginalString;
|
var version = dependency.LibraryRange?.VersionRange?.OriginalString;
|
||||||
|
|
||||||
if (toolsDictionary.ContainsKey(name))
|
if (dependencyToVersionMap.ContainsKey(name))
|
||||||
{
|
{
|
||||||
name = toolsDictionary[name];
|
var dependencyInfo = dependencyToVersionMap[name];
|
||||||
version = ConstantPackageVersions.AspNetToolsVersion;
|
if (dependencyInfo == null)
|
||||||
|
|
||||||
if(string.IsNullOrEmpty(name))
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
name = dependencyInfo.Name;
|
||||||
|
version = dependencyInfo.Version;
|
||||||
|
}
|
||||||
|
|
||||||
return new PackageDependencyInfo
|
return new PackageDependencyInfo
|
||||||
{
|
{
|
||||||
Name = name,
|
Name = name,
|
||||||
|
@ -391,12 +407,5 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
"PackageTargetFallback",
|
"PackageTargetFallback",
|
||||||
t => $"$(PackageTargetFallback);{string.Join(";", t.Imports)}",
|
t => $"$(PackageTargetFallback);{string.Join(";", t.Imports)}",
|
||||||
t => t.Imports.OrEmptyIfNull().Any());
|
t => t.Imports.OrEmptyIfNull().Any());
|
||||||
|
|
||||||
private class PackageDependencyInfo
|
|
||||||
{
|
|
||||||
public string Name {get; set;}
|
|
||||||
public string Version {get; set;}
|
|
||||||
public string PrivateAssets {get; set;}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,9 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.Tools.Common;
|
using Microsoft.DotNet.Tools.Common;
|
||||||
|
@ -67,6 +69,29 @@ namespace Microsoft.DotNet.TestFramework
|
||||||
return this;
|
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)
|
private void CopyFiles(IEnumerable<FileInfo> filesToCopy)
|
||||||
{
|
{
|
||||||
foreach (var file in filesToCopy)
|
foreach (var file in filesToCopy)
|
||||||
|
|
|
@ -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 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 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 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);
|
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()}");
|
msbuildArgs.Add($"/p:TargetFramework={frameworkOption.Value()}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (runtimeOption.HasValue())
|
||||||
|
{
|
||||||
|
msbuildArgs.Add($"/p:RuntimeIdentifier={runtimeOption.Value()}");
|
||||||
|
}
|
||||||
|
|
||||||
if (configurationOption.HasValue())
|
if (configurationOption.HasValue())
|
||||||
{
|
{
|
||||||
msbuildArgs.Add($"/p:Configuration={configurationOption.Value()}");
|
msbuildArgs.Add($"/p:Configuration={configurationOption.Value()}");
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<Version>1.6</Version>
|
<Version>1.6</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk.Web">
|
<PackageReference Include="Microsoft.NET.Sdk.Web">
|
||||||
<Version>1.0.0-alpha-20161019-1</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics">
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics">
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Sdk">
|
<PackageReference Include="Microsoft.NET.Sdk">
|
||||||
<Version>1.0.0-alpha-20161026-2</Version>
|
<Version>1.0.0-alpha-20161029-1</Version>
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk">
|
<PackageReference Include="Microsoft.NET.Test.Sdk">
|
||||||
|
|
|
@ -29,16 +29,24 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
[WindowsOnlyFact]
|
[WindowsOnlyFact]
|
||||||
public void It_resolves_desktop_apps_defaulting_to_Debug_Configuration()
|
public void It_resolves_desktop_apps_defaulting_to_Debug_Configuration()
|
||||||
{
|
{
|
||||||
|
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
|
||||||
var configuration = "Debug";
|
var configuration = "Debug";
|
||||||
|
|
||||||
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
|
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
|
||||||
.CreateInstance()
|
.CreateInstance()
|
||||||
.WithSourceFiles()
|
.WithSourceFiles()
|
||||||
.WithRestoreFiles();
|
.WithNuGetConfig(_repoDirectoriesProvider.TestPackages);
|
||||||
|
|
||||||
|
var restoreCommand = new RestoreCommand()
|
||||||
|
.WithWorkingDirectory(testInstance.Root)
|
||||||
|
.WithRuntime(runtime)
|
||||||
|
.ExecuteWithCapturedOutput()
|
||||||
|
.Should().Pass();
|
||||||
|
|
||||||
var buildCommand = new BuildCommand()
|
var buildCommand = new BuildCommand()
|
||||||
.WithWorkingDirectory(testInstance.Root)
|
.WithWorkingDirectory(testInstance.Root)
|
||||||
.WithConfiguration(configuration)
|
.WithConfiguration(configuration)
|
||||||
|
.WithRuntime(runtime)
|
||||||
.WithCapturedOutput()
|
.WithCapturedOutput()
|
||||||
.Execute()
|
.Execute()
|
||||||
.Should().Pass();
|
.Should().Pass();
|
||||||
|
@ -60,16 +68,24 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
[WindowsOnlyFact]
|
[WindowsOnlyFact]
|
||||||
public void It_resolves_desktop_apps_when_configuration_is_Debug()
|
public void It_resolves_desktop_apps_when_configuration_is_Debug()
|
||||||
{
|
{
|
||||||
|
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
|
||||||
var configuration = "Debug";
|
var configuration = "Debug";
|
||||||
|
|
||||||
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
|
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
|
||||||
.CreateInstance()
|
.CreateInstance()
|
||||||
.WithSourceFiles()
|
.WithSourceFiles()
|
||||||
.WithRestoreFiles();
|
.WithNuGetConfig(_repoDirectoriesProvider.TestPackages);
|
||||||
|
|
||||||
|
var restoreCommand = new RestoreCommand()
|
||||||
|
.WithWorkingDirectory(testInstance.Root)
|
||||||
|
.WithRuntime(runtime)
|
||||||
|
.ExecuteWithCapturedOutput()
|
||||||
|
.Should().Pass();
|
||||||
|
|
||||||
var buildCommand = new BuildCommand()
|
var buildCommand = new BuildCommand()
|
||||||
.WithWorkingDirectory(testInstance.Root)
|
.WithWorkingDirectory(testInstance.Root)
|
||||||
.WithConfiguration(configuration)
|
.WithConfiguration(configuration)
|
||||||
|
.WithRuntime(runtime)
|
||||||
.Execute()
|
.Execute()
|
||||||
.Should().Pass();
|
.Should().Pass();
|
||||||
|
|
||||||
|
@ -89,16 +105,24 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
[WindowsOnlyFact]
|
[WindowsOnlyFact]
|
||||||
public void It_resolves_desktop_apps_when_configuration_is_Release()
|
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")
|
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
|
||||||
.CreateInstance()
|
.CreateInstance()
|
||||||
.WithSourceFiles()
|
.WithSourceFiles()
|
||||||
.WithRestoreFiles();
|
.WithNuGetConfig(_repoDirectoriesProvider.TestPackages);
|
||||||
|
|
||||||
|
var restoreCommand = new RestoreCommand()
|
||||||
|
.WithWorkingDirectory(testInstance.Root)
|
||||||
|
.WithRuntime(runtime)
|
||||||
|
.ExecuteWithCapturedOutput()
|
||||||
|
.Should().Pass();
|
||||||
|
|
||||||
var buildCommand = new BuildCommand()
|
var buildCommand = new BuildCommand()
|
||||||
.WithWorkingDirectory(testInstance.Root)
|
.WithWorkingDirectory(testInstance.Root)
|
||||||
.WithConfiguration(configuration)
|
.WithConfiguration(configuration)
|
||||||
|
.WithRuntime(runtime)
|
||||||
.WithCapturedOutput()
|
.WithCapturedOutput()
|
||||||
.Execute()
|
.Execute()
|
||||||
.Should().Pass();
|
.Should().Pass();
|
||||||
|
@ -120,16 +144,24 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||||
[WindowsOnlyFact]
|
[WindowsOnlyFact]
|
||||||
public void It_resolves_desktop_apps_using_configuration_passed_to_create()
|
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")
|
var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx")
|
||||||
.CreateInstance()
|
.CreateInstance()
|
||||||
.WithSourceFiles()
|
.WithSourceFiles()
|
||||||
.WithRestoreFiles();
|
.WithNuGetConfig(_repoDirectoriesProvider.TestPackages);
|
||||||
|
|
||||||
|
var restoreCommand = new RestoreCommand()
|
||||||
|
.WithWorkingDirectory(testInstance.Root)
|
||||||
|
.WithRuntime(runtime)
|
||||||
|
.ExecuteWithCapturedOutput()
|
||||||
|
.Should().Pass();
|
||||||
|
|
||||||
var buildCommand = new BuildCommand()
|
var buildCommand = new BuildCommand()
|
||||||
.WithWorkingDirectory(testInstance.Root)
|
.WithWorkingDirectory(testInstance.Root)
|
||||||
.WithConfiguration(configuration)
|
.WithConfiguration(configuration)
|
||||||
|
.WithRuntime(runtime)
|
||||||
.WithCapturedOutput()
|
.WithCapturedOutput()
|
||||||
.Execute()
|
.Execute()
|
||||||
.Should().Pass();
|
.Should().Pass();
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
[InlineData("Microsoft.EntityFrameworkCore.Tools", "Microsoft.EntityFrameworkCore.Tools", ConstantPackageVersions.AspNetToolsVersion)]
|
[InlineData("Microsoft.EntityFrameworkCore.Tools", "Microsoft.EntityFrameworkCore.Tools", ConstantPackageVersions.AspNetToolsVersion)]
|
||||||
[InlineData("Microsoft.AspNetCore.Razor.Tools", "Microsoft.AspNetCore.Razor.Design", ConstantPackageVersions.AspNetToolsVersion)]
|
[InlineData("Microsoft.AspNetCore.Razor.Tools", "Microsoft.AspNetCore.Razor.Design", ConstantPackageVersions.AspNetToolsVersion)]
|
||||||
[InlineData("Microsoft.AspNetCore.Razor.Design", "Microsoft.AspNetCore.Razor.Design", ConstantPackageVersions.AspNetToolsVersion)]
|
[InlineData("Microsoft.AspNetCore.Razor.Design", "Microsoft.AspNetCore.Razor.Design", ConstantPackageVersions.AspNetToolsVersion)]
|
||||||
[InlineData("Microsoft.VisualStudio.Web.CodeGenerators.Mvc", "Microsoft.VisualStudio.Web.CodGeneration.Design", ConstantPackageVersions.AspNetToolsVersion)]
|
[InlineData("Microsoft.VisualStudio.Web.CodeGenerators.Mvc", "Microsoft.VisualStudio.Web.CodeGeneration.Design", ConstantPackageVersions.AspNetToolsVersion)]
|
||||||
public void It_migrates_project_dependencies_to_a_new_name_and_version(
|
public void It_migrates_project_dependencies_to_a_new_name_and_version(
|
||||||
string sourceToolName,
|
string sourceToolName,
|
||||||
string targetToolName,
|
string targetToolName,
|
||||||
|
@ -44,7 +44,10 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
}
|
}
|
||||||
}");
|
}");
|
||||||
|
|
||||||
var packageRef = mockProj.Items.Where(i => i.Include != "Microsoft.NET.Sdk" && i.ItemType == "PackageReference").Should().BeEmpty();
|
var packageRef = mockProj.Items.Where(i =>
|
||||||
|
i.Include != "Microsoft.NET.Sdk" &&
|
||||||
|
i.Include != "NETStandard.Library" &&
|
||||||
|
i.ItemType == "PackageReference").Should().BeEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
|
|
|
@ -273,7 +273,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
}");
|
}");
|
||||||
|
|
||||||
mockProj.Items.Should().ContainSingle(
|
mockProj.Items.Should().ContainSingle(
|
||||||
i => (i.Include == "Microsoft.NET.Test.Sdk" && i.ItemType == "PackageReference"));
|
i => (i.Include == "Microsoft.NET.Test.Sdk" &&
|
||||||
|
i.ItemType == "PackageReference" &&
|
||||||
|
i.GetMetadataWithName("Version").Value == "15.0.0-preview-20161024-02"));
|
||||||
|
|
||||||
mockProj.Items.Should().NotContain(
|
mockProj.Items.Should().NotContain(
|
||||||
i => (i.Include == "xunit" && i.ItemType == "PackageReference"));
|
i => (i.Include == "xunit" && i.ItemType == "PackageReference"));
|
||||||
|
@ -297,13 +299,82 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
}");
|
}");
|
||||||
|
|
||||||
mockProj.Items.Should().ContainSingle(
|
mockProj.Items.Should().ContainSingle(
|
||||||
i => (i.Include == "Microsoft.NET.Test.Sdk" && i.ItemType == "PackageReference"));
|
i => (i.Include == "Microsoft.NET.Test.Sdk" &&
|
||||||
|
i.ItemType == "PackageReference" &&
|
||||||
|
i.GetMetadataWithName("Version").Value == "15.0.0-preview-20161024-02"));
|
||||||
|
|
||||||
mockProj.Items.Should().ContainSingle(
|
mockProj.Items.Should().ContainSingle(
|
||||||
i => (i.Include == "xunit" && i.ItemType == "PackageReference"));
|
i => (i.Include == "xunit" &&
|
||||||
|
i.ItemType == "PackageReference" &&
|
||||||
|
i.GetMetadataWithName("Version").Value == "2.2.0-beta3-build3402"));
|
||||||
|
|
||||||
mockProj.Items.Should().ContainSingle(
|
mockProj.Items.Should().ContainSingle(
|
||||||
i => (i.Include == "xunit.runner.visualstudio" && i.ItemType == "PackageReference"));
|
i => (i.Include == "xunit.runner.visualstudio" &&
|
||||||
|
i.ItemType == "PackageReference" &&
|
||||||
|
i.GetMetadataWithName("Version").Value == "2.2.0-beta4-build1188"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void It_migrates_test_projects_to_have_test_sdk_and_xunit_packagedependencies_overwrite_existing_packagedependencies()
|
||||||
|
{
|
||||||
|
var mockProj = RunPackageDependenciesRuleOnPj(@"
|
||||||
|
{
|
||||||
|
""buildOptions"": {
|
||||||
|
""emitEntryPoint"": true
|
||||||
|
},
|
||||||
|
""dependencies"": {
|
||||||
|
""xunit"": ""2.2.0-beta3-build3330""
|
||||||
|
},
|
||||||
|
""frameworks"": {
|
||||||
|
""netcoreapp1.0"": {}
|
||||||
|
},
|
||||||
|
""testRunner"": ""xunit""
|
||||||
|
}");
|
||||||
|
|
||||||
|
mockProj.Items.Should().ContainSingle(
|
||||||
|
i => (i.Include == "Microsoft.NET.Test.Sdk" &&
|
||||||
|
i.ItemType == "PackageReference" &&
|
||||||
|
i.GetMetadataWithName("Version").Value == "15.0.0-preview-20161024-02"));
|
||||||
|
|
||||||
|
mockProj.Items.Should().ContainSingle(
|
||||||
|
i => (i.Include == "xunit" &&
|
||||||
|
i.ItemType == "PackageReference" &&
|
||||||
|
i.GetMetadataWithName("Version").Value == "2.2.0-beta3-build3402"));
|
||||||
|
|
||||||
|
mockProj.Items.Should().ContainSingle(
|
||||||
|
i => (i.Include == "xunit.runner.visualstudio" &&
|
||||||
|
i.ItemType == "PackageReference" &&
|
||||||
|
i.GetMetadataWithName("Version").Value == "2.2.0-beta4-build1188"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData(@"
|
||||||
|
{
|
||||||
|
""frameworks"": {
|
||||||
|
""netstandard1.3"": {
|
||||||
|
""dependencies"": {
|
||||||
|
""System.AppContext"": ""4.1.0"",
|
||||||
|
""NETStandard.Library"": ""1.5.0""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}")]
|
||||||
|
[InlineData(@"
|
||||||
|
{
|
||||||
|
""frameworks"": {
|
||||||
|
""netstandard1.3"": {
|
||||||
|
""dependencies"": {
|
||||||
|
""System.AppContext"": ""4.1.0""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}")]
|
||||||
|
public void It_migrates_library_and_does_not_double_netstandard_ref(string pjContent)
|
||||||
|
{
|
||||||
|
var mockProj = RunPackageDependenciesRuleOnPj(pjContent);
|
||||||
|
|
||||||
|
mockProj.Items.Should().ContainSingle(
|
||||||
|
i => (i.Include == "NETStandard.Library" && i.ItemType == "PackageReference"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EmitsPackageReferences(ProjectRootElement mockProj, params Tuple<string, string, string>[] packageSpecs)
|
private void EmitsPackageReferences(ProjectRootElement mockProj, params Tuple<string, string, string>[] packageSpecs)
|
||||||
|
|
|
@ -242,10 +242,29 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_promotes_P2P_references_up_in_the_dependency_chain()
|
public void It_promotes_P2P_references_up_in_the_dependency_chain()
|
||||||
{
|
{
|
||||||
var solutionDirectory =
|
var mockProj = MigrateProject("TestAppDependencyGraph", "ProjectA");
|
||||||
TestAssetsManager.CreateTestInstance("TestAppDependencyGraph", callingMethod: "p").Path;
|
|
||||||
|
|
||||||
var appDirectory = Path.Combine(solutionDirectory, "ProjectA");
|
var projectReferences = mockProj.Items.Where(
|
||||||
|
item => item.ItemType.Equals("ProjectReference", StringComparison.Ordinal));
|
||||||
|
projectReferences.Count().Should().Be(7);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void It_migrates_unqualified_dependencies_as_ProjectReference_when_a_matching_project_is_found()
|
||||||
|
{
|
||||||
|
var mockProj = MigrateProject("TestAppWithUnqualifiedDependencies", "ProjectA");
|
||||||
|
var projectReferenceInclude = Path.Combine("..", "ProjectB", "ProjectB.csproj");
|
||||||
|
|
||||||
|
var projectReferences = mockProj.Items.Should().ContainSingle(
|
||||||
|
item => item.ItemType == "ProjectReference" && item.Include == projectReferenceInclude);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ProjectRootElement MigrateProject(string solution, string project)
|
||||||
|
{
|
||||||
|
var solutionDirectory =
|
||||||
|
TestAssetsManager.CreateTestInstance(solution, callingMethod: "p").Path;
|
||||||
|
|
||||||
|
var appDirectory = Path.Combine(solutionDirectory, project);
|
||||||
|
|
||||||
var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10);
|
var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10);
|
||||||
var mockProj = ProjectRootElement.Create();
|
var mockProj = ProjectRootElement.Create();
|
||||||
|
@ -254,9 +273,10 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
mockProj.AddPropertyGroup());
|
mockProj.AddPropertyGroup());
|
||||||
new MigrateProjectDependenciesRule().Apply(testSettings, testInputs);
|
new MigrateProjectDependenciesRule().Apply(testSettings, testInputs);
|
||||||
|
|
||||||
var projectReferences = mockProj.Items.Where(
|
var s = mockProj.Items.Select(p => $"ItemType = {p.ItemType}, Include = {p.Include}");
|
||||||
item => item.ItemType.Equals("ProjectReference", StringComparison.Ordinal));
|
Console.WriteLine(string.Join(Environment.NewLine, s));
|
||||||
projectReferences.Count().Should().Be(7);
|
|
||||||
|
return mockProj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,21 +7,40 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
||||||
{
|
{
|
||||||
public sealed class RestoreCommand : TestCommand
|
public sealed class RestoreCommand : TestCommand
|
||||||
{
|
{
|
||||||
|
private string _runtime;
|
||||||
|
|
||||||
public RestoreCommand()
|
public RestoreCommand()
|
||||||
: base("dotnet")
|
: base("dotnet")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RestoreCommand WithRuntime(string runtime)
|
||||||
|
{
|
||||||
|
_runtime = runtime;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public override CommandResult Execute(string args = "")
|
public override CommandResult Execute(string args = "")
|
||||||
{
|
{
|
||||||
args = $"restore {args} --disable-parallel";
|
args = $"restore {GetRuntime()} {args} --disable-parallel";
|
||||||
return base.Execute(args);
|
return base.Execute(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override CommandResult ExecuteWithCapturedOutput(string args = "")
|
public override CommandResult ExecuteWithCapturedOutput(string args = "")
|
||||||
{
|
{
|
||||||
args = $"restore {args} --disable-parallel";
|
args = $"restore {GetRuntime()} {args} --disable-parallel";
|
||||||
return base.ExecuteWithCapturedOutput(args);
|
return base.ExecuteWithCapturedOutput(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetRuntime()
|
||||||
|
{
|
||||||
|
if (_runtime == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $"/p:RuntimeIdentifier={_runtime}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
||||||
_nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages");
|
_nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages");
|
||||||
_pjDotnet = pjDotnet ?? GetPjDotnetPath();
|
_pjDotnet = pjDotnet ?? GetPjDotnetPath();
|
||||||
_stage2Sdk = Directory.EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk")).First();
|
_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()
|
private string GetPjDotnetPath()
|
||||||
|
|
|
@ -371,13 +371,14 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
[InlineData("TestProjects", "PJTestAppSimple", false)]
|
[InlineData("TestProjects", "PJTestAppSimple", false)]
|
||||||
public void It_auto_add_desktop_references_during_migrate(string testGroup, string projectName, bool isDesktopApp)
|
public void It_auto_add_desktop_references_during_migrate(string testGroup, string projectName, bool isDesktopApp)
|
||||||
{
|
{
|
||||||
|
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
|
||||||
var testAssetManager = GetTestGroupTestAssetsManager(testGroup);
|
var testAssetManager = GetTestGroupTestAssetsManager(testGroup);
|
||||||
var projectDirectory = testAssetManager.CreateTestInstance(projectName).WithLockFiles().Path;
|
var projectDirectory = testAssetManager.CreateTestInstance(projectName).WithLockFiles().Path;
|
||||||
|
|
||||||
CleanBinObj(projectDirectory);
|
CleanBinObj(projectDirectory);
|
||||||
MigrateProject(new string[] { projectDirectory });
|
MigrateProject(new string[] { projectDirectory });
|
||||||
Restore(projectDirectory);
|
Restore(projectDirectory, runtime: runtime);
|
||||||
BuildMSBuild(projectDirectory, projectName);
|
BuildMSBuild(projectDirectory, projectName, runtime:runtime);
|
||||||
VerifyAutoInjectedDesktopReferences(projectDirectory, projectName, isDesktopApp);
|
VerifyAutoInjectedDesktopReferences(projectDirectory, projectName, isDesktopApp);
|
||||||
VerifyAllMSBuildOutputsRunnable(projectDirectory);
|
VerifyAllMSBuildOutputsRunnable(projectDirectory);
|
||||||
}
|
}
|
||||||
|
@ -422,6 +423,19 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
.Count().Should().Be(1);
|
.Count().Should().Be(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData("LibraryWithoutNetStandardLibRef")]
|
||||||
|
[InlineData("LibraryWithNetStandardLibRef")]
|
||||||
|
public void It_migrates_and_builds_library(string projectName)
|
||||||
|
{
|
||||||
|
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName,
|
||||||
|
callingMethod: $"{nameof(It_migrates_and_builds_library)}-projectName").Path;
|
||||||
|
|
||||||
|
MigrateProject(projectDirectory);
|
||||||
|
Restore(projectDirectory, projectName);
|
||||||
|
BuildMSBuild(projectDirectory, projectName);
|
||||||
|
}
|
||||||
|
|
||||||
private void VerifyAutoInjectedDesktopReferences(string projectDirectory, string projectName, bool shouldBePresent)
|
private void VerifyAutoInjectedDesktopReferences(string projectDirectory, string projectName, bool shouldBePresent)
|
||||||
{
|
{
|
||||||
if (projectName != null)
|
if (projectName != null)
|
||||||
|
@ -584,10 +598,11 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
.Should().Pass();
|
.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()
|
var command = new RestoreCommand()
|
||||||
.WithWorkingDirectory(projectDirectory);
|
.WithWorkingDirectory(projectDirectory)
|
||||||
|
.WithRuntime(runtime);
|
||||||
|
|
||||||
if (projectName != null)
|
if (projectName != null)
|
||||||
{
|
{
|
||||||
|
@ -601,7 +616,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)
|
if (projectName != null)
|
||||||
{
|
{
|
||||||
|
@ -612,6 +631,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
|
|
||||||
var result = new BuildCommand()
|
var result = new BuildCommand()
|
||||||
.WithWorkingDirectory(projectDirectory)
|
.WithWorkingDirectory(projectDirectory)
|
||||||
|
.WithRuntime(runtime)
|
||||||
.ExecuteWithCapturedOutput($"{projectName} /p:Configuration={configuration}");
|
.ExecuteWithCapturedOutput($"{projectName} /p:Configuration={configuration}");
|
||||||
|
|
||||||
result
|
result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue