Merge rel/1.0.0 into master

This commit is contained in:
Eric Erhardt 2017-01-23 09:57:56 -06:00
commit 1950ef5e17
365 changed files with 5210 additions and 3522 deletions

View file

@ -0,0 +1,17 @@
## Getting help on migration issues
You're using the new .NET Core tools that are MSBuild-based. You took your project.json project and ran `dotnet migrate` or migrated from Visual Studio 2017...and you maybe ran into problems.
The best way to get help is to [file an issue](https://github.com/dotnet/cli/issues/new) on this repo and we will investigate and provide help and/or fixes as part of new CLI builds. Please make sure to read the instructions below and to **add the [MIGRATION] prefix to the issue title**.
### Filing an migration issue
CLI is a very high-traffic repository in terms of issues. In order to be able to respond fast to migration issues, we need the issue to be formatted in a certain way:
* Add `[MIGRATION]:` prefix to the title of the issue.
* Make sure that we can see your project.json
* If you have a GH repo or this is an OSS project, share the URL to the repo.
* Otherwise attach or paste the project.json contents into the issue.
* Add all of the errors that any operation like `dotnet restore`, `dotnet build` or others reported. This will help us speedily triage where the potential problem will be.
* Add output of `dotnet --info` to the issue so we know what build you are running.
* Mention @blackdwarf and @livarcocc in the issue body.
From there on, we will start investigating the issue and respond.

View file

@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>dotnet-throwingtool</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>
</PropertyGroup>
<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
</BuiltProjectOutputGroupOutput>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.3</Version>
</PackageReference>
</ItemGroup>
</Project>

View file

@ -0,0 +1,12 @@
using System;
namespace AppThrowing
{
class MyException : Exception
{
static void Main(string[] args)
{
throw new MyException();
}
}
}

View file

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-throwingtool">
<Version>1.0.0</Version>
</DotNetCliToolReference>
</ItemGroup>
</Project>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../pkgs" />
</packageSources>
</configuration>

View file

@ -0,0 +1,8 @@
using System;
class Program
{
static void Main(string[] args)
{
}
}

View file

@ -0,0 +1,16 @@
// 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 TestApp
{
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine(TestLibrary.Helper.GetMessage());
return 0;
}
}
}

View file

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestLibrary", "..\TestLibrary\TestLibrary.csproj", "{DC0B35D0-8A36-4B52-8A11-B86739F055D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU
{DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.23107" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.23107</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>0138cb8f-4aa9-4029-a21e-c07c30f425ba</ProjectGuid>
<RootNamespace>TestAppWithContents</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -0,0 +1,30 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"TestLibrary": {
"target": "project",
"version": "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": {}
}
}

View file

@ -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 Helper
{
public static string GetMessage()
{
return "This string came from the test library!";
}
}
}

View file

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<AssemblyName>TestLibrary</AssemblyName>
<PackageId>TestLibrary</PackageId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NETStandard.Library" Version="1.6.0" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.23107" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.23107</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>dc0b35d0-8a36-4b52-8a11-b86739f055d2</ProjectGuid>
<RootNamespace>TestAppWithContents</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -0,0 +1,9 @@
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.5": {}
}
}

View file

@ -0,0 +1,12 @@
using System;
namespace App.Tests
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

View file

@ -0,0 +1,15 @@
{
"frameworks": {
"netcoreapp1.0": {
"imports": [
"portable-net451+win8"
],
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
}
}
}
}

View file

@ -0,0 +1,16 @@
// 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 TestApp
{
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine("Hello world");
return 0;
}
}
}

View file

@ -0,0 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}"
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.23107" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.23107</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>0138cb8f-4aa9-4029-a21e-c07c30f425ba</ProjectGuid>
<RootNamespace>TestAppWithContents</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -0,0 +1,26 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"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": {}
}
}

View file

@ -0,0 +1,16 @@
// 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 TestApp
{
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine("Hello world");
return 0;
}
}
}

View file

@ -0,0 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 Custom
VisualStudioVersion = 15.9.12345.4
MinimumVisualStudioVersion = 10.9.1234.5
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}"
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.23107" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.23107</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>0138cb8f-4aa9-4029-a21e-c07c30f425ba</ProjectGuid>
<RootNamespace>TestAppWithContents</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -0,0 +1,26 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"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": {}
}
}

View file

@ -0,0 +1,16 @@
// 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 TestApp
{
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine("Hello world");
return 0;
}
}
}

View file

@ -0,0 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 16
VisualStudioVersion = 14.0.unknown.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}"
EndProject
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.23107" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.23107</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>0138cb8f-4aa9-4029-a21e-c07c30f425ba</ProjectGuid>
<RootNamespace>TestAppWithContents</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -0,0 +1,26 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"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": {}
}
}

View file

@ -0,0 +1,12 @@
using System;
namespace App.Tests
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World from Test asset!");
}
}
}

View file

@ -0,0 +1,15 @@
{
"frameworks": {
"netcoreapp1.0": {
"imports": [
"portable-net451+win8"
],
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
}
}
}
}

View file

@ -0,0 +1,6 @@
{
"projects": [
"src",
"test"
]
}

View file

@ -0,0 +1,31 @@
{
"frameworks": {
"net40": {
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0",
"System.Xml": "4.0.0.0"
},
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.SqlServer.Types": "11.0.2"
}
},
"net45": {
"buildOptions": {
"define": [ "ASYNC" ]
},
"frameworkAssemblies": {
"System.Configuration": "4.0.0.0",
"System.Data": "4.0.0.0",
"System.Data.Linq": "4.0.0.0",
"System.Xml": "4.0.0.0"
},
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.SqlServer.Types": "11.0.2"
}
}
}
}

View file

@ -0,0 +1,12 @@
using System;
namespace App.Tests
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

View file

@ -0,0 +1,19 @@
{
"frameworks": {
"netcoreapp1.0": {
"imports": [
"portable-net451+win8",
"dnxcore50"
],
"buildOptions": {
"define": [ "ASYNC", "COREFX", "XUNIT2", "SQLITE" ]
},
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
}
}
}
}

View file

@ -5,12 +5,6 @@
<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>
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-portable">
<Version>1.0.0</Version>

View file

@ -0,0 +1,12 @@
using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
}

View file

@ -0,0 +1,20 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NetCore.App": {
"version": "1.0.3",
"type": "platform"
}
}
},
"net20": {},
"net35": {},
"net40": {},
"net461": {}
}
}

View file

@ -0,0 +1,12 @@
using System;
namespace Library
{
public class TestLib
{
public static void Test()
{
Console.WriteLine("Hello World!");
}
}
}

View file

@ -0,0 +1,16 @@
{
"version": "1.0.0-*",
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6"
}
},
"netstandard1.3": {
"dependencies": {
"NETStandard.Library": "1.3"
}
},
"net451": {}
}
}

View file

@ -0,0 +1,4 @@
{
"projects": [ "src", "src with spaces", "src without projects" ]
}

View file

@ -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;
namespace TestApp
{
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine("This string came from ProjectJ");
string helperStr = TestLibrary.ProjectI.GetMessage();
Console.WriteLine(helperStr);
return 0;
}
}
}

View file

@ -0,0 +1,20 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"ProjectI": {
"target": "project",
"version": "1.0.0-*"
},
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
},
"frameworks": {
"netcoreapp1.0": {}
}
}

View file

@ -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;
namespace TestApp
{
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine("This string came from ProjectH");
string helperStr = TestLibrary.ProjectI.GetMessage();
Console.WriteLine(helperStr);
return 0;
}
}
}

View file

@ -0,0 +1,20 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"ProjectI": {
"target": "project",
"version": "1.0.0-*"
},
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
},
"frameworks": {
"netcoreapp1.0": {}
}
}

View file

@ -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 ProjectI
{
public static string GetMessage()
{
return "This string came from ProjectI";
}
}
}

View file

@ -0,0 +1,18 @@
{
"version": "1.0.0-*",
"buildOptions": {
"nowarn": [
"CS1591"
],
"xmlDoc": true,
"additionalArguments": [
"-highentropyva+"
]
},
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.5": {}
}
}

View file

@ -0,0 +1,39 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26006.2
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "src\App\App.csproj", "{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{72BFCA87-B033-4721-8712-4D12166B4A39}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.ActiveCfg = Debug|x64
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.Build.0 = Debug|x64
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.ActiveCfg = Debug|x86
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.Build.0 = Debug|x86
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.Build.0 = Release|Any CPU
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.ActiveCfg = Release|x64
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.Build.0 = Release|x64
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.ActiveCfg = Release|x86
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A} = {72BFCA87-B033-4721-8712-4D12166B4A39}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\src\Lib\Lib.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.3" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,10 @@
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello from the main app");
Console.WriteLine(Lib.Library.GetMessage());
}
}

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NETStandard.Library" Version="1.6" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,12 @@
using System;
namespace Lib
{
public class Library
{
public static string GetMessage()
{
return "Message from Lib";
}
}
}

View file

@ -1,9 +1,6 @@
<Project ToolsVersion="15.0" DefaultTargets="CopyTemplateToOutput">
<!-- workaround for https://github.com/Microsoft/msbuild/issues/885 -->
<!-- renaming the property because the original property is a global property and therefore
cannot be redefined at runtime. -->
<Import Project="Microsoft.DotNet.Cli.tasks" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
<Target Name="CopyTemplateToOutput"
DependsOnTargets="PrepareBundledTemplateProps;

View file

@ -270,8 +270,6 @@
<ItemGroup>
<TemplatesToBundle Include="build/Microsoft.DotNet.Cli.BundledTemplates.proj">
<Properties>
CLIBuildDll=$(CLIBuildDll);
NuGetPackagesDir=$(NuGetPackagesDir);
TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates;
TemplatePackageName=%(BundledTemplate.Identity);
TemplatePackageVersion=%(BundledTemplate.Version);

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CLI_MSBuild_Version>15.1.0-preview-000503-01</CLI_MSBuild_Version>
<CLI_MSBuild_Version>15.1.0-preview-000523-01</CLI_MSBuild_Version>
<CLI_Roslyn_Version>2.0.0-rc3-61212-03</CLI_Roslyn_Version>
<CLI_NETSDK_Version>1.0.0-alpha-20170117-4</CLI_NETSDK_Version>
<!-- non-official NuGet build taken from https://github.com/nuget/nuget.client/tree/release-4.0.0-rc3-netstandard2.0 to contain "2.0" TFMs -->
<CLI_NuGet_Version>4.0.0-rc3-2193</CLI_NuGet_Version>
<CLI_NETSDK_Version>1.0.0-alpha-20170105-5</CLI_NETSDK_Version>
<CLI_WEBSDK_Version>1.0.0-alpha-20170106-1-203</CLI_WEBSDK_Version>
<CLI_WEBSDK_Version>1.0.0-alpha-20170120-3-249</CLI_WEBSDK_Version>
<CLI_TestPlatform_Version>15.0.0-preview-20170106-08</CLI_TestPlatform_Version>
<TemplateEngineVersion>1.0.0-beta1-20170106-79</TemplateEngineVersion>
<TemplateEngineVersion>1.0.0-beta1-20170108-83</TemplateEngineVersion>
</PropertyGroup>
</Project>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SdkBrandName>Microsoft .NET Core 1.0.3 - SDK Preview 5</SdkBrandName>
<SdkBrandName>Microsoft .NET Core 1.0.3 - SDK RC 4</SdkBrandName>
<SharedFrameworkBrandName>Microsoft .NET Core 1.0.3 - Runtime</SharedFrameworkBrandName>
<SharedHostBrandName>Microsoft .NET Core 1.0.1 - Host</SharedHostBrandName>
<HostFxrBrandName>Microsoft .NET Core 1.0.1 - Host FX Resolver</HostFxrBrandName>

View file

@ -28,8 +28,10 @@
<PropertyGroup>
<Product>Sdk</Product>
<ArtifactContainerName>$(ARTIFACT_STORAGE_CONTAINER)</ArtifactContainerName>
<ArtifactContainerName Condition="'$(ArtifactContainerName)' == ''">dotnet</ArtifactContainerName>
<ArtifactCloudDropAccessToken>$(ARTIFACT_STORAGE_KEY)</ArtifactCloudDropAccessToken>
<ArtifactCloudDropAccountName>$(ARTIFACT_STORAGE_ACCOUNT)</ArtifactCloudDropAccountName>
<ArtifactCloudDropAccountName Condition="'$(ArtifactCloudDropAccountName)' == ''">dotnetcli</ArtifactCloudDropAccountName>
<DotnetBlobRootUrl>https://$(ArtifactCloudDropAccountName).blob.core.windows.net/$(ArtifactContainerName)</DotnetBlobRootUrl>
<ChecksumContainerName>$(CHECKSUM_STORAGE_CONTAINER)</ChecksumContainerName>
<ChecksumCloudDropAccessToken>$(CHECKSUM_STORAGE_KEY)</ChecksumCloudDropAccessToken>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" DefaultTargets="Test">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<PathSeparator>/</PathSeparator>
@ -7,14 +7,11 @@
</PropertyGroup>
<Import Project="test/TestPackageProjects.targets" />
<Import Project="test/TestAssetProjects.targets" />
<Import Project="test/TestProjects.targets" />
<Target Name="Test"
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' "
DependsOnTargets="PrepareTests;
BuildTestAssets;
BuildTests;">
DependsOnTargets="BuildTests;">
<PropertyGroup>
<PathListSeparator>:</PathListSeparator>
@ -36,14 +33,13 @@
<ItemGroup>
<ProjectsToTest Include="build/test/RunTest.proj">
<Properties>
CLIBuildDll=$(CLIBuildDll);
CLIBuildDll=$(CLIBuildDll);
Configuration=$(Configuration);
EnvironmentVariables=$(RunTestEnvironmentVariables);
TestProject=%(TestProjects.ProjectPath);
TestProjectName=%(TestProjects.OutputName);
TestProject=%(TestProjects.Identity);
TestResultXmlDir=$(TestResultXmlDir);
ToolPath=$(Stage0Directory);
WorkingDirectory=%(TestProjects.ProjectDir)
WorkingDirectory=$([System.IO.Directory]::GetParent(%(TestProjects.Identity)))
</Properties>
</ProjectsToTest>
</ItemGroup>
@ -59,7 +55,8 @@
</Target>
<Target Name="PrepareTests"
DependsOnTargets="Init">
DependsOnTargets="Init;
SetupTestProjectData">
<PropertyGroup>
<TestPackageBuildVersionSuffix>$(CommitCount)</TestPackageBuildVersionSuffix>
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
@ -74,139 +71,21 @@
<MakeDir Directories="$(TestPackagesDir)" Condition="!Exists('$(TestPackagesDir)')"/>
</Target>
<Target Name="BuildTests"
DependsOnTargets="RestoreTests;
SetupTestProjectData;"
Inputs="%(TestProjects.BuildInputs)"
Outputs="%(TestProjects.BuildOutput)">
<DotNetBuild Configuration="$(Configuration)"
Framework="%(TestProjects.Framework)"
ToolPath="$(Stage0Directory)"
ProjectPath="%(TestProjects.ProjectPath)" />
</Target>
<Target Name="RestoreTests"
DependsOnTargets="CreateTestAssetPackageNuPkgs;
CleanTestProjectsBinObj;
SetupRestoreTestsInputs;"
Inputs="@(RestoreTestsInputs)"
Outputs="@(RestoreTestsInputs->'%(RelativeDir)/obj/project.assets.json');@(RestoreTestsInputs->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.props');@(RestoreTestsInputs->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.targets')">
<CallTarget Targets="CleanTestProjectsLockFiles"/>
DependsOnTargets="PrepareTests;
CreateTestAssetPackageNuPkgs;">
<DotNetRestore ToolPath="$(Stage0Directory)"
ProjectPath="&quot;%(RestoreTestsInputs.FullPath)&quot;" />
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;" />
</Target>
<Target Name="CleanTestProjectsBinObj"
DependsOnTargets="SetupRestoreTestsInputs;">
<ItemGroup>
<FilesToDelete Include="$(TestDirectory)**/bin/**/project.assets.json;$(TestDirectory)**/bin/**/*.csproj.nuget.g.props;$(TestDirectory)**/bin/**/*.csproj.nuget.g.targets" />
<FilesToDelete Include="$(TestDirectory)**/obj/**/project.assets.json;$(TestDirectory)**/obj/**/*.csproj.nuget.g.props;$(TestDirectory)**/obj/**/*.csproj.nuget.g.targets" />
</ItemGroup>
<Delete Files="@(FilesToDelete)" />
<ItemGroup>
<FilesToDelete Remove="*" />
</ItemGroup>
</Target>
<Target Name="SetupRestoreTestsInputs"
DependsOnTargets="PrepareTests;" >
<ItemGroup>
<RestoreTestsInputs Include="$(TestDirectory)/**/*.csproj"
Exclude="$(TestDirectory)/**/bin/**/*.csproj" />
</ItemGroup>
</Target>
<Target Name="BuildTestAssets"
DependsOnTargets="BuildTestAssetProjects;
BuildDesktopTestAssetProjects;">
</Target>
<Target Name="BuildTestAssetProjects"
DependsOnTargets="RestoreTestAssetProjects;
SetupTestAssetProjectData;"
Inputs="%(TestAssetProjects.BuildInputs)"
Outputs="%(TestAssetProjects.BuildOutput)">
<DotNetBuildPj Framework="netcoreapp1.0"
ProjectPath="$(RepoRoot)%(TestAssetProjects.ProjectPath)"
ToolPath="$(Stage0PjDirectory)" />
</Target>
<Target Name="RestoreTestAssetProjects"
DependsOnTargets="CreateTestAssetPackageNuPkgs;
SetupRestoreTestAssetProjectsInputs;"
Inputs="@(RestoreTestAssetProjectsInputs)"
Outputs="@(RestoreTestAssetProjectsInputs->'%(RelativeDir)/project.lock.json')">
<DotNetRestorePj FallbackSource="$(TestPackagesDir)"
ToolPath="$(Stage0PjDirectory)"
WorkingDirectory="$(RepoRoot)TestAssets/TestProjects/" />
</Target>
<Target Name="SetupRestoreTestAssetProjectsInputs" >
<ItemGroup>
<RestoreTestAssetProjectsInputs Include="$(RepoRoot)/TestAssets/TestProjects/**/project.json" />
</ItemGroup>
</Target>
<Target Name="CleanTestAssetProjectsLockFiles" >
<ItemGroup>
<TestAssetProjectsLockFiles Include="$(RepoRoot)/TestAssets/TestProjects/**/project.lock.json" />
</ItemGroup>
<Delete Files="@(TestAssetProjectsLockFiles)" />
</Target>
<Target Name="CleanTestProjectsLockFiles" >
<ItemGroup>
<TestProjectsLockFiles Include="$(RepoRoot)/test/**/project.assets.json;$(RepoRoot)/test/**/*.csproj.nuget.g.props;$(RepoRoot)/test/**/*.csproj.nuget.g.targets" />
</ItemGroup>
<Delete Files="@(TestProjectsLockFiles)" />
</Target>
<Target Name="BuildDesktopTestAssetProjects"
Condition=" '$(IsDesktopAvailable)' == 'True' "
DependsOnTargets="RestoreDesktopTestAssetProjects">
<ItemGroup>
<NoAutoBuildDesktopTestAssets Include="$(RepoRoot)TestAssets\DesktopTestProjects\**\.noautobuild" />
<NoAutoBuildDesktopTestAssetProjects Include="%(NoAutoBuildDesktopTestAssets.RelativeDir)project.json" />
<BuildableDesktopTestAssetProjects Include="$(RepoRoot)TestAssets\DesktopTestProjects\**\project.json"
Exclude="@(NoAutoBuildDesktopTestAssetProjects)" />
</ItemGroup>
<Message Text="Skipping projects with .noautobuild files:" />
<Message Text="%(NoAutoBuildDesktopTestAssetProjects.FullPath)" />
<DotNetBuild Condition="'@(BuildableDesktopTestAssetProjects)' != ''"
Configuration="$(Configuration)"
Framework="net46"
ProjectPath="%(BuildableDesktopTestAssetProjects.FullPath)"
ToolPath="$(Stage0PjDirectory)" />
</Target>
<Target Name="RestoreDesktopTestAssetProjects"
Condition=" '$(IsDesktopAvailable)' == 'True' "
DependsOnTargets="CreateTestAssetPackageNuPkgs;
SetupRestoreDesktopTestAssetProjectsInputs;"
Inputs="@(RestoreDesktopTestAssetProjectsInputs)"
Outputs="@(RestoreDesktopTestAssetProjectsInputs->'%(RelativeDir)/project.lock.json')">
<DotNetRestorePj FallbackSource="$(TestPackagesDir)"
ToolPath="$(Stage0PjDirectory)"
WorkingDirectory="$(RepoRoot)TestAssets\DesktopTestProjects\" />
</Target>
<Target Name="SetupRestoreDesktopTestAssetProjectsInputs">
<ItemGroup>
<RestoreDesktopTestAssetProjectsInputs Include="$(RepoRoot)TestAssets\DesktopTestProjects\**\project.json" />
</ItemGroup>
<Target Name="BuildTests"
DependsOnTargets="RestoreTests;">
<DotNetBuild ToolPath="$(Stage0Directory)"
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;" />
</Target>
<Target Name="CreateTestAssetPackageNuPkgs"
DependsOnTargets="PrepareTests;
SetupTestPackageProjectData;"
DependsOnTargets="SetupTestPackageProjectData;"
Inputs="%(TestPackageProject.PackInputs)"
Outputs="%(TestPackageProject.PackOutputs)">

View file

@ -14,7 +14,7 @@
DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs;
SetupAzureBlobInformation;
GenerateNuGetPackagesArchive"
Condition=" '$(UploadNuGetPackagesArchiveToAzure)' == 'true' And '$(PUBLISH_TO_AZURE_BLOB)' != '' ">
Condition=" '$(UploadNuGetPackagesArchiveToAzure)' == 'true' And '$(PUBLISH_LZMA_TO_AZURE_BLOB)' != '' ">
<ItemGroup>
<NuGetPackagesArchiveToUpload Include="$(IntermediateArchive)" />
</ItemGroup>

View file

@ -101,6 +101,9 @@
<Exec Command="sudo dpkg -i $(SdkInstallerFile)" />
<!-- Run E2E -->
<DotNetRestore ProjectPath="$(EndToEndTestProject)"
ToolPath="$(Stage0Directory)" />
<DotNetTest ProjectPath="$(EndToEndTestProject)"
EnvironmentVariables="@(TestSdkDebTaskEnvironmentVariables)"
ToolPath="$(Stage0Directory)" />

View file

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTarget="RunTest" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- workaround for https://github.com/Microsoft/msbuild/issues/885 -->
<!-- renaming the property because the original property is a global property and therefore
cannot be redefined at runtime. -->
<PropertyGroup>
<CLIBuildDllPath>$([MSBuild]::Unescape($(CLIBuildDll)))</CLIBuildDllPath>
</PropertyGroup>
<UsingTask TaskName="DotNetTest" AssemblyFile="$(CLIBuildDllPath)" />
<!-- workaround for https://github.com/Microsoft/msbuild/issues/885 -->
<!-- renaming the property because the original property is a global property and therefore
cannot be redefined at runtime. -->
<PropertyGroup>
<CLIBuildDllPath>$([MSBuild]::Unescape($(CLIBuildDll)))</CLIBuildDllPath>
</PropertyGroup>
<UsingTask TaskName="DotNetTest" AssemblyFile="$(CLIBuildDllPath)" />
<Target Name="RunTest">
<DotNetTest EnvironmentVariables="$(EnvironmentVariables)"
ToolPath="$(ToolPath)"

View file

@ -1,32 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SetupTestProjectData"
DependsOnTargets="AssociateTestInputFilesWithProject">
</Target>
<Target Name="AssociateTestInputFilesWithProject"
DependsOnTargets="IdentifyTestInputFilesForProject;"
Outputs="%(TestProjects.ProjectPath)">
<PropertyGroup>
<CurrentProject>%(TestProjects.ProjectPath)</CurrentProject>
</PropertyGroup>
<ItemGroup>
<TestProjects Condition=" '%(ProjectPath)' == '$(CurrentProject)' ">
<BuildInputs>@(TestProjectInputs)</BuildInputs>
</TestProjects>
</ItemGroup>
</Target>
<Target Name="IdentifyTestInputFilesForProject"
DependsOnTargets="SetupBuildTestProjectInputs;"
Outputs="%(TestProjects.ProjectPath)">
<ItemGroup>
<TestProjectInputs Include="%(TestProjects.BuildInputIncludeFilter)"
Exclude="%(TestProjects.BuildInputExcludeFilter)">
<ProjectPath>%(TestProjects.ProjectPath)</ProjectPath>
</TestProjectInputs>
</ItemGroup>
DependsOnTargets="SetupBuildTestProjectInputs">
</Target>
<Target Name="SetupBuildTestProjectInputs">
@ -37,53 +12,21 @@
-->
<PreTestProjectsToExclude Include="test$(PathSeparator)binding-redirects.Tests$(PathSeparator)binding-redirects.Tests.csproj;" />
<PreTestProjectsToExclude Condition=" 'https://github.com/dotnet/cli/issues/3216' != 'fixed' "
Include="test$(PathSeparator)Kestrel.Tests$(PathSeparator)Kestrel.Tests.csproj" />
<PreTestProjectsToExclude Condition=" 'Non-test projects in test directory' != 'consider moving elsewhere' "
Include="test$(PathSeparator)ArgumentsReflector$(PathSeparator)ArgumentsReflector.csproj;
test$(PathSeparator)Microsoft.DotNet.Tools.Tests.Utilities$(PathSeparator)Microsoft.DotNet.Tools.Tests.Utilities.csproj;
test$(PathSeparator)TestingAbstractions$(PathSeparator)TestAppWithFullPdbs$(PathSeparator)TestAppWithFullPdbs.csproj;
test$(PathSeparator)TestingAbstractions$(PathSeparator)TestAppWithPortablePdbs$(PathSeparator)TestAppWithPortablePdbs.csproj;
test$(PathSeparator)Msbuild.Tests.Utilities$(PathSeparator)Msbuild.Tests.Utilities.csproj" />
test$(PathSeparator)Msbuild.Tests.Utilities$(PathSeparator)Msbuild.Tests.Utilities.csproj;
test$(PathSeparator)Performance$(PathSeparator)Performance.csproj" />
<PreTestProjectsToExclude Condition=" 'Executed after primary test phase.' != ' Consider moving.' "
Include="test$(PathSeparator)Installer$(PathSeparator)Microsoft.DotNet.Cli.Msi.Tests$(PathSeparator)Microsoft.DotNet.Cli.Msi.Tests.csproj;" />
<PreTestProjectsToExclude Include="test$(PathSeparator)**$(PathSeparator)bin$(PathSeparator)**$(PathSeparator)*.csproj" />
<!-- The current ResolveNuGetAssets target does not work on case-sensitive file systems. We need https://github.com/dotnet/sdk/pull/10 -->
<PreTestProjectsToExclude Condition="'$(OSName)' != 'win' and '$(OSName)' != 'osx'"
Include="test$(PathSeparator)dotnet-build3.Tests$(PathSeparator)dotnet-build3.Tests.csproj" />
<TestProjectsToExclude Include="%(PreTestProjectsToExclude.Fullpath)" />
<PreTestProjects Include="test$(PathSeparator)**$(PathSeparator)*.csproj;" />
<PreTestProjects Include="test$(PathSeparator)*$(PathSeparator)*.csproj;" />
<TestProjects Include="%(PreTestProjects.Fullpath)"
Exclude="@(TestProjectsToExclude)" />
<TestProjects>
<BuildInputIncludeFilter>%(RelativeDir)**/*.*</BuildInputIncludeFilter>
<BuildInputExcludeFilter>%(RelativeDir)bin/**/*.*;%(RelativeDir)obj/**/*.*</BuildInputExcludeFilter>
<ProjectDir>$([System.IO.Directory]::GetParent(%(Identity)))</ProjectDir>
<ProjectPath>%(Identity)</ProjectPath>
<Framework>netcoreapp1.0</Framework>
</TestProjects>
<TestProjects>
<OutputName>$([System.IO.Path]::GetFileName(%(ProjectDir)))</OutputName>
</TestProjects>
<TestProjects>
<BuildOutput>$(RepoRoot)%(TestProjects.RelativeDir)bin/$(Configuration)/%(TestProjects.Framework)/%(TestProjects.OutputName).dll</BuildOutput>
</TestProjects>
<TestProjects Condition=" '%(RelativeDir)' == 'test\Installer\Microsoft.DotNet.Cli.Msi.Tests\' ">
<Framework>net46</Framework>
</TestProjects>
</ItemGroup>
<Message Text="%(TestProjects.Identity) %(TestProjects.RelativeDir) %(TestProjects.Framework)" />
</Target>
</Project>
</Project>

View file

@ -10,7 +10,7 @@
</Component>
<Component Id="SetupRegistry_x86_RC2_Compat_Key" Directory="TARGETDIR" Win64="no">
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sdk">
<RegistryValue Action="write" Name="1.0.0-preview2" Type="integer" Value="1" KeyPath="yes"/>
<RegistryValue Action="write" Name="2.0.0-alpha" Type="integer" Value="1" KeyPath="yes"/>
</RegistryKey>
</Component>
</ComponentGroup>

View file

@ -132,5 +132,6 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \
-e CHECKSUM_STORAGE_KEY \
-e CHECKSUM_STORAGE_ACCOUNT \
-e CHECKSUM_STORAGE_CONTAINER \
-e CLIBUILD_SKIP_TESTS \
$DOTNET_BUILD_CONTAINER_TAG \
$BUILD_COMMAND "$@"

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">Neplatný formát na řádku {0}: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">V oddíle projektu chybí {0}, když analýza řádku začíná na pozici {1}.</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">V sadě vlastností chybí {0}.</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">Ungültiges Format in Zeile {0}: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">Im Projektabschnitt fehlt "{0}" beim Analysieren des Zeilenbeginns in Position {1}</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">Im Eigenschaftensatz fehlt "{0}"</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">Formato no válido en línea {0}: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">Falta la sección del proyecto "{0}" al analizar la línea que inicia en la posición {1}</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">A la propiedad establecida le falta "{0}"</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">Format non valide dans la ligne {0} : {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">'{0}' est manquant dans la section de projet lors de l'analyse de la ligne à partir de la position {1}</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">'{0}' est manquant dans le jeu de propriétés</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">Formato non valido a riga {0}: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">Nella sezione del progetto manca '{0}' quando si analizza la riga a partire dalla posizione {1}</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">Nel set di proprietà manca '{0}'</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">行 {0} の形式が無効です: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">位置 {1} から始まる行の解析中にプロジェクト セクションが見つかりません '{0}'</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">プロパティ セットが見つかりません '{0}'</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">{0} 줄에 잘못된 형식: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">{1} 위치에서 시작하는 줄을 구문 분석할 때 프로젝트 섹션에 '{0}'이(가) 없습니다.</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">속성 설정에 '{0}'이(가) 없습니다.</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">Nieprawidłowy format w wierszu {0}: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">W sekcji projektu brakuje elementu „{0}” podczas analizowania wiersza, począwszy od pozycji {1}</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">W zestawie właściwości brakuje elementu „{0}”</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">Formato inválido na linha {0}: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">A seção do projeto está sem o '{0}' ao analisar a linha na posição {1}</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">O conjunto de propriedade está sem '{0}'</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">Формат в строке {0} недопустим: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">В разделе проекта отсутствует "{0}" при анализе строки с начальной позицией {1}</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">В наборе свойств отсутствует "{0}"</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">{0}. satırda geçersiz biçim: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">{1}. konumdan başlayan satır ayrıştırılırken proje bölümünde '{0}' eksik</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">Özellik kümesinde '{0}' eksik</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">行 {0} 存在无效格式: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">分析从位置 {1} 开始的行时,项目节缺少“{0}”</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">属性集缺少“{0}”</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -40,18 +40,18 @@
</trans-unit>
<trans-unit id="ErrorMessageFormatString">
<source>Invalid format in line {0}: {1}</source>
<target state="new">Invalid format in line {0}: {1}</target>
<note></note>
<target state="translated">第 {0} 行的格式不正確: {1}</target>
<note />
</trans-unit>
<trans-unit id="ProjectParsingErrorFormatString">
<source>Project section is missing '{0}' when parsing the line starting at position {1}</source>
<target state="new">Project section is missing '{0}' when parsing the line starting at position {1}</target>
<note></note>
<target state="translated">從位置 {1} 開始剖析程式行時,專案區段缺少 '{0}'</target>
<note />
</trans-unit>
<trans-unit id="InvalidPropertySetFormatString">
<source>Property set is missing '{0}'</source>
<target state="new">Property set is missing '{0}'</target>
<note></note>
<target state="translated">屬性集缺少 '{0}'</target>
<note />
</trans-unit>
</body>
</file>

View file

@ -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 Microsoft.DotNet.Cli.Utils.ExceptionExtensions
{
internal static class ExceptionExtensions
{
public static void ReportAsWarning(this Exception e)
{
Reporter.Verbose.WriteLine($"Warning: Ignoring exception: {e.ToString().Yellow()}");
}
}
}

View file

@ -88,6 +88,20 @@ namespace Microsoft.DotNet.Tools.Common
}
}
public static bool TryDeleteDirectory(string directoryPath)
{
try
{
Directory.Delete(directoryPath, true);
return true;
}
catch
{
return false;
}
}
/// <summary>
/// Returns childItem relative to directory, with Path.DirectorySeparatorChar as separator
/// </summary>

View file

@ -6,3 +6,4 @@ using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.DotNet.Cli.Utils.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Tests.Utilities, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.DotNet.ProjectJsonMigration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]

View file

@ -19,17 +19,17 @@ Configuring...
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.</source>
<target state="translated">.NET Corea Hoş Geldiniz!
---------------------
.NET Core hakkında daha fazla bilgiyi https://aka.ms/dotnet-docs adresinde bulabilirsiniz. Kullanılabilir komutları görmek için dotnet --help kullanın veya https://aka.ms/dotnet-cli-docs adresine gidin.
.NET Core hakkında daha fazla bilgi edinmek için bkz. https://aka.ms/dotnet-docs. Kullanılabilen komutları görüntülemek için dotnet --help komutunu kullanın veya https://aka.ms/dotnet-cli-docs adresine gidin.
Telemetri
--------------
.NET Core araçları, deneyiminizi iyileştirmek için kullanım verileri toplar. Veriler anonimdir ve komut satırı bağımsız değişkenlerini içermez. Veriler Microsoft tarafından toplanır ve topluluk ile paylaşılır.
Sık kullandığınız kabuk aracılığıyla DOTNET_CLI_TELEMETRY_OPTOUT ortam değişkenini 1 değerine ayarlayarak telemetriyi geri çevirebilirsiniz.
.NET Core araç telemetrisi hakkında daha faza bilgiyi https://aka.ms/dotnet-cli-telemetry adresinde bulabilirsiniz.
.NET Core araçları, deneyiminizi geliştirmek için kullanım verilerini toplar. Veriler anonimdir ve komut satırı bağımsız değişkenlerini içermez. Veriler Microsoft tarafından toplanır ve toplulukla paylaşılır.
İstediğiniz kabuk içinde DOTNET_CLI_TELEMETRY_OPTOUT ortam değişkenini 1 olarak ayarlayarak telemetriyi geri çevirebilirsiniz.
.NET Core araçlarında telemetri hakkında daha fazla bilgi edinmek için bkz. https://aka.ms/dotnet-cli-telemetry.
Yapılandırılıyor...
-------------------
Yerel paket önbelleğinizi başlangıçta doldurmak, geri yükleme hızını artırmak ve çevrimdışı erişimi etkinleştirmek için bir komut çalıştırılıyor. Bu komutun tamamlanması yaklaşık bir dakika sürer ve bu işlem yalnızca bir kez gerçekleştirilir.</target>
Geri yükleme hızını artırmak ve çevrimdışı erişimi etkinleştirmek için yerel paket önbelleğinizi başlangıçta doldurmak amacıyla bir komut çalıştırılıyor. Bu komutun tamamlanması yaklaşık bir dakika sürer ve yalnızca bir kez çalışır.</target>
<note />
</trans-unit>
<trans-unit id="FailedToPrimeCacheError">

View file

@ -36,15 +36,9 @@ namespace Microsoft.Extensions.EnvironmentAbstractions
public void CreateEmptyFile(string path)
{
try
using (File.Create(path))
{
var emptyFile = File.Create(path);
if (emptyFile != null)
{
emptyFile.Dispose();
}
}
catch { }
}
}
}

View file

@ -6,9 +6,12 @@ namespace Microsoft.DotNet.ProjectJsonMigration
internal class ConstantPackageVersions
{
public const string AspNetToolsVersion = "1.0.0-msbuild3-final";
public const string AspNet110ToolsVersion = "1.1.0-msbuild3-final";
public const string AspNetLTSPackagesVersion = "1.0.2";
public const string EntityFrameworkLTSPackagesVersion = "1.0.2";
public const string TestSdkPackageVersion = "15.0.0-preview-20170106-08";
public const string XUnitPackageVersion = "2.2.0-beta4-build3444";
public const string XUnitRunnerPackageVersion = "2.2.0-beta4-build1194";
public const string XUnitPackageVersion = "2.2.0-beta5-build3474";
public const string XUnitRunnerPackageVersion = "2.2.0-beta5-build1225";
public const string MstestTestAdapterVersion = "1.1.8-rc";
public const string MstestTestFrameworkVersion = "1.0.8-rc";
public const string BundleMinifierToolVersion = "2.2.301";

View file

@ -0,0 +1,55 @@
// 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.Collections.Generic;
using System.IO;
namespace Microsoft.DotNet.ProjectJsonMigration
{
internal class DotnetSupportedPackageVersionsCsvProvider : IDotnetSupportedPackageVersionsProvider
{
public void AddDotnetSupportedPackageVersions(
IDictionary<PackageDependencyInfo, PackageDependencyInfo> projectDependenciesPackages)
{
var dotnetSupportedPackageVersionsPath =
Path.Combine(AppContext.BaseDirectory, "dotnet-supported-package-versions.csv");
using (var reader = new StreamReader(File.OpenRead(dotnetSupportedPackageVersionsPath)))
{
SkipHeader(reader);
while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(',');
var packageName = values[0];
var ltsVersion = values[1];
if (HasVersion(ltsVersion))
{
projectDependenciesPackages.Add(
new PackageDependencyInfo
{
Name = packageName,
Version = $"[,{ltsVersion})"
},
new PackageDependencyInfo
{
Name = packageName,
Version = ltsVersion
});
}
}
}
}
private void SkipHeader(StreamReader reader)
{
reader.ReadLine();
}
private bool HasVersion(string version)
{
return !string.IsNullOrEmpty(version);
}
}
}

View file

@ -0,0 +1,13 @@
// 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.Collections.Generic;
namespace Microsoft.DotNet.ProjectJsonMigration
{
internal interface IDotnetSupportedPackageVersionsProvider
{
void AddDotnetSupportedPackageVersions(
IDictionary<PackageDependencyInfo, PackageDependencyInfo> projectDependenciesPackages);
}
}

View file

@ -9,14 +9,9 @@ namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
internal class ProjectFilesCollection
{
public static readonly string[] DefaultCompileBuiltInPatterns = new[] { @"**/*.cs" };
public static readonly string[] SdkInjectedDefaultCompileBuiltInPatterns = new[] { @"**/*.cs" };
public static readonly string[] DefaultPreprocessPatterns = new[] { @"compiler/preprocess/**/*.cs" };
public static readonly string[] DefaultSharedPatterns = new[] { @"compiler/shared/**/*.cs" };
public static readonly string[] DefaultResourcesBuiltInPatterns = new[] { @"compiler/resources/**/*", "**/*.resx" };
public static readonly string[] DefaultPublishExcludePatterns = new string[0];
public static readonly string[] DefaultContentsBuiltInPatterns = new string[0];
public static readonly string[] DefaultBuiltInExcludePatterns = new[] { "bin/**", "obj/**", "**/*.xproj", "packages/**" };
public static readonly string PackIncludePropertyName = "packInclude";
@ -53,11 +48,11 @@ namespace Microsoft.DotNet.Internal.ProjectModel.Files
var excludeBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "excludeBuiltIn", DefaultBuiltInExcludePatterns);
var excludePatterns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "exclude")
.Concat(excludeBuiltIns);
var contentBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "contentBuiltIn", DefaultContentsBuiltInPatterns);
var compileBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "compileBuiltIn", DefaultCompileBuiltInPatterns);
var resourceBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "resourceBuiltIn", DefaultResourcesBuiltInPatterns);
var contentBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "contentBuiltIn");
var compileBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "compileBuiltIn", SdkInjectedDefaultCompileBuiltInPatterns);
var resourceBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "resourceBuiltIn");
_publishExcludePatterns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "publishExclude", DefaultPublishExcludePatterns);
_publishExcludePatterns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "publishExclude");
_sharedPatternsGroup = PatternGroup.Build(_rawProject, _projectDirectory, _projectFilePath, "shared", fallbackIncluding: DefaultSharedPatterns, additionalExcluding: excludePatterns);

View file

@ -664,20 +664,20 @@ namespace Microsoft.DotNet.Internal.ProjectModel
project,
rawOptions,
"compile",
defaultBuiltInInclude: ProjectFilesCollection.DefaultCompileBuiltInPatterns,
defaultBuiltInInclude: ProjectFilesCollection.SdkInjectedDefaultCompileBuiltInPatterns,
defaultBuiltInExclude: ProjectFilesCollection.DefaultBuiltInExcludePatterns),
EmbedInclude = GetIncludeContext(
project,
rawOptions,
"embed",
defaultBuiltInInclude: ProjectFilesCollection.DefaultResourcesBuiltInPatterns,
defaultBuiltInInclude: null,
defaultBuiltInExclude: ProjectFilesCollection.DefaultBuiltInExcludePatterns),
CopyToOutputInclude = GetIncludeContext(
project,
rawOptions,
"copyToOutput",
defaultBuiltInInclude: null,
defaultBuiltInExclude: ProjectFilesCollection.DefaultPublishExcludePatterns)
defaultBuiltInExclude: null)
};
}
@ -794,7 +794,7 @@ namespace Microsoft.DotNet.Internal.ProjectModel
"publishOptions",
rawProject,
defaultBuiltInInclude: null,
defaultBuiltInExclude: ProjectFilesCollection.DefaultPublishExcludePatterns);
defaultBuiltInExclude: null);
}
return null;

View file

@ -11,6 +11,9 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="sdkdefaults.json" />
<Content Include="dotnet-supported-package-versions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.DotNet.Cli.Sln.Internal\Microsoft.DotNet.Cli.Sln.Internal.csproj" />

View file

@ -5,86 +5,217 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.DotNet.Internal.ProjectModel.Utilities;
namespace Microsoft.DotNet.ProjectJsonMigration
{
internal class MigrationBackupPlan
{
private const string TempCsprojExtention = ".migration_in_place_backup";
private readonly FileInfo globalJson;
private readonly Dictionary<DirectoryInfo, IEnumerable<FileInfo>> mapOfProjectBackupDirectoryToFilesToMove;
public DirectoryInfo RootBackupDirectory { get; }
public DirectoryInfo[] ProjectBackupDirectories { get; }
public IEnumerable<FileInfo> FilesToMove(DirectoryInfo projectBackupDirectory)
=> mapOfProjectBackupDirectoryToFilesToMove[projectBackupDirectory];
public MigrationBackupPlan(
DirectoryInfo projectDirectory,
IEnumerable<DirectoryInfo> projectDirectories,
DirectoryInfo workspaceDirectory,
Func<DirectoryInfo, IEnumerable<FileInfo>> getFiles = null)
{
if (projectDirectory == null)
if (projectDirectories == null)
{
throw new ArgumentNullException(nameof(projectDirectory));
throw new ArgumentNullException(nameof(projectDirectories));
}
if (!projectDirectories.Any())
{
throw new ArgumentException("No project directories provided.", nameof(projectDirectories));
}
if (workspaceDirectory == null)
{
throw new ArgumentNullException(nameof(workspaceDirectory));
}
globalJson = new FileInfo(Path.Combine(
workspaceDirectory.FullName,
"global.json"));
MigrationTrace.Instance.WriteLine("Computing migration backup plan...");
projectDirectory = new DirectoryInfo(projectDirectory.FullName.EnsureTrailingSlash());
projectDirectories = projectDirectories.Select(pd => new DirectoryInfo(pd.FullName.EnsureTrailingSlash()));
workspaceDirectory = new DirectoryInfo(workspaceDirectory.FullName.EnsureTrailingSlash());
MigrationTrace.Instance.WriteLine($" Workspace: {workspaceDirectory.FullName}");
foreach (var projectDirectory in projectDirectories)
{
MigrationTrace.Instance.WriteLine($" Project: {projectDirectory.FullName}");
}
var rootDirectory = FindCommonRootPath(projectDirectories.ToArray()) ?? workspaceDirectory;
rootDirectory = new DirectoryInfo(rootDirectory.FullName.EnsureTrailingSlash());
MigrationTrace.Instance.WriteLine($" Root: {rootDirectory.FullName}");
globalJson = new FileInfo(
Path.Combine(
workspaceDirectory.FullName,
"global.json"));
RootBackupDirectory = new DirectoryInfo(
Path.Combine(
workspaceDirectory.Parent.FullName,
"backup")
GetUniqueDirectoryPath(
Path.Combine(
rootDirectory.FullName,
"backup"))
.EnsureTrailingSlash());
ProjectBackupDirectory = new DirectoryInfo(
Path.Combine(
RootBackupDirectory.FullName,
projectDirectory.Name)
.EnsureTrailingSlash());
MigrationTrace.Instance.WriteLine($" Root Backup: {RootBackupDirectory.FullName}");
var relativeDirectory = PathUtility.GetRelativePath(
workspaceDirectory.FullName,
projectDirectory.FullName);
var projectBackupDirectories = new List<DirectoryInfo>();
mapOfProjectBackupDirectoryToFilesToMove = new Dictionary<DirectoryInfo, IEnumerable<FileInfo>>();
getFiles = getFiles ?? (dir => dir.EnumerateFiles());
getFiles = getFiles ??
(dir => dir.EnumerateFiles());
foreach (var projectDirectory in projectDirectories)
{
var projectBackupDirectory = ComputeProjectBackupDirectoryPath(rootDirectory, projectDirectory, RootBackupDirectory);
var filesToMove = getFiles(projectDirectory).Where(NeedsBackup);
FilesToMove = getFiles(projectDirectory)
.Where(f => f.Name == "project.json"
|| f.Extension == ".xproj"
|| f.FullName.EndsWith(".xproj.user")
|| f.FullName.EndsWith(".lock.json"));
projectBackupDirectories.Add(projectBackupDirectory);
mapOfProjectBackupDirectoryToFilesToMove.Add(projectBackupDirectory, filesToMove);
}
ProjectBackupDirectories = projectBackupDirectories.ToArray();
}
public DirectoryInfo ProjectBackupDirectory { get; }
public DirectoryInfo RootBackupDirectory { get; }
public IEnumerable<FileInfo> FilesToMove { get; }
public void PerformBackup()
{
if (globalJson.Exists)
{
PathUtility.EnsureDirectoryExists(RootBackupDirectory.FullName);
globalJson.MoveTo(Path.Combine(
ProjectBackupDirectory.Parent.FullName,
globalJson.Name));
}
PathUtility.EnsureDirectoryExists(ProjectBackupDirectory.FullName);
foreach (var file in FilesToMove)
{
file.MoveTo(
globalJson.MoveTo(
Path.Combine(
ProjectBackupDirectory.FullName, file.Name));
RootBackupDirectory.FullName,
globalJson.Name));
}
foreach (var kvp in mapOfProjectBackupDirectoryToFilesToMove)
{
var projectBackupDirectory = kvp.Key;
var filesToMove = kvp.Value;
PathUtility.EnsureDirectoryExists(projectBackupDirectory.FullName);
foreach (var file in filesToMove)
{
var fileName = file.Name.EndsWith(TempCsprojExtention)
? Path.GetFileNameWithoutExtension(file.Name)
: file.Name;
file.MoveTo(
Path.Combine(
projectBackupDirectory.FullName,
fileName));
}
}
}
private static DirectoryInfo ComputeProjectBackupDirectoryPath(
DirectoryInfo rootDirectory, DirectoryInfo projectDirectory, DirectoryInfo rootBackupDirectory)
{
if (PathUtility.IsChildOfDirectory(rootDirectory.FullName, projectDirectory.FullName))
{
var relativePath = PathUtility.GetRelativePath(
rootDirectory.FullName,
projectDirectory.FullName);
return new DirectoryInfo(
Path.Combine(
rootBackupDirectory.FullName,
relativePath)
.EnsureTrailingSlash());
}
// Ensure that we use a unique name to avoid collisions as a fallback.
return new DirectoryInfo(
GetUniqueDirectoryPath(
Path.Combine(
rootBackupDirectory.FullName,
projectDirectory.Name)
.EnsureTrailingSlash()));
}
private static bool NeedsBackup(FileInfo file)
=> file.Name == "project.json"
|| file.Extension == ".xproj"
|| file.FullName.EndsWith(".xproj.user")
|| file.FullName.EndsWith(".lock.json")
|| file.FullName.EndsWith(TempCsprojExtention);
private static string GetUniqueDirectoryPath(string directoryPath)
{
var candidatePath = directoryPath;
var suffix = 1;
while (Directory.Exists(candidatePath))
{
candidatePath = $"{directoryPath}_{suffix++}";
}
return candidatePath;
}
private static DirectoryInfo FindCommonRootPath(DirectoryInfo[] paths)
{
var pathSplits = new string[paths.Length][];
var shortestLength = int.MaxValue;
for (int i = 0; i < paths.Length; i++)
{
pathSplits[i] = paths[i].FullName.Split(new[] { Path.DirectorySeparatorChar });
shortestLength = Math.Min(shortestLength, pathSplits[i].Length);
}
var builder = new StringBuilder();
var splitIndex = 0;
while (splitIndex < shortestLength)
{
var split = pathSplits[0][splitIndex];
var done = false;
for (int i = 1; i < pathSplits.Length; i++)
{
if (pathSplits[i][splitIndex] != split)
{
done = true;
break;
}
}
if (done)
{
break;
}
builder.Append(split);
builder.Append(Path.DirectorySeparatorChar);
splitIndex++;
}
return new DirectoryInfo(builder.ToString().EnsureTrailingSlash());
}
public static void RenameCsprojFromMigrationOutputNameToTempName(string outputProject)
{
var backupFileName = $"{outputProject}{TempCsprojExtention}";
if (File.Exists(backupFileName))
{
File.Delete(backupFileName);
}
File.Move(outputProject, backupFileName);
}
}
}

View file

@ -1,80 +0,0 @@
// 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.Collections.Generic;
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
{
public const string SdkPackageName = "Microsoft.NET.Sdk";
public const string WebSdkPackageName = "Microsoft.NET.Sdk.Web";
public const string TestSdkPackageName = "Microsoft.NET.Test.Sdk";
public const string XUnitPackageName = "xunit";
public const string XUnitRunnerPackageName = "xunit.runner.visualstudio";
public const string MstestTestAdapterName = "MSTest.TestAdapter";
public const string MstestTestFrameworkName = "MSTest.TestFramework";
public const string NetStandardPackageName = "NETStandard.Library";
public const string NetStandardPackageVersion = "1.6.0";
public const string DotnetTestXunit = "dotnet-test-xunit";
public const string DotnetTestMSTest = "dotnet-test-mstest";
public static readonly IDictionary<string, PackageDependencyInfo> ProjectDependencyPackages =
new Dictionary<string, PackageDependencyInfo> {
{"Microsoft.EntityFrameworkCore.Tools", new PackageDependencyInfo {
Name = "Microsoft.EntityFrameworkCore.Tools",
Version = ConstantPackageVersions.AspNetToolsVersion } },
{ "Microsoft.AspNetCore.Razor.Tools", null },
{ "Microsoft.AspNetCore.Razor.Design", null },
{ "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 } },
{ MstestTestAdapterName, new PackageDependencyInfo {
Name = MstestTestAdapterName,
Version = ConstantPackageVersions.MstestTestAdapterVersion } },
{ MstestTestFrameworkName, new PackageDependencyInfo {
Name = MstestTestFrameworkName,
Version = ConstantPackageVersions.MstestTestFrameworkVersion } },
{ DotnetTestXunit, null },
{ DotnetTestMSTest, null },
};
public static readonly IDictionary<string, PackageDependencyInfo> ProjectToolPackages =
new Dictionary<string, PackageDependencyInfo> {
{"Microsoft.EntityFrameworkCore.Tools", new PackageDependencyInfo {
Name = "Microsoft.EntityFrameworkCore.Tools.DotNet",
Version = ConstantPackageVersions.AspNetToolsVersion } },
{ "Microsoft.AspNetCore.Razor.Tools", null },
{ "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},
{ "BundlerMinifier.Core", new PackageDependencyInfo {
Name = "BundlerMinifier.Core",
Version = ConstantPackageVersions.BundleMinifierToolVersion } }
};
}
}

View file

@ -14,8 +14,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration
{
public static string GetProjectName(this ProjectContext projectContext)
{
// _ here is just an arbitrary configuration value so we can obtain the output name
return Path.GetFileNameWithoutExtension(projectContext.GetOutputPaths("_").CompilationFiles.Assembly);
var projectDirectory = projectContext.ProjectDirectory;
return Path.GetFileName(projectDirectory);
}
public static bool HasRuntimes(this IEnumerable<ProjectContext> projectContexts)
@ -38,9 +39,31 @@ namespace Microsoft.DotNet.ProjectJsonMigration
return projectContexts.Any(p => p.IsFullFramework());
}
public static bool HasExeOutput(this IEnumerable<ProjectContext> projectContexts)
{
return projectContexts.Any(p => p.IsExe());
}
public static bool HasLibraryOutput(this IEnumerable<ProjectContext> projectContexts)
{
return projectContexts.Any(p => p.IsLibrary());
}
public static bool IsFullFramework(this ProjectContext projectContext)
{
return !projectContext.TargetFramework.IsPackageBased;
}
public static bool IsExe(this ProjectContext projectContext)
{
var compilerOptions = projectContext.ProjectFile.GetCompilerOptions(null, null);
return (compilerOptions.EmitEntryPoint != null && compilerOptions.EmitEntryPoint.Value);
}
public static bool IsLibrary(this ProjectContext projectContext)
{
var compilerOptions = projectContext.ProjectFile.GetCompilerOptions(null, null);
return (compilerOptions.EmitEntryPoint == null || !compilerOptions.EmitEntryPoint.Value);
}
}
}

View file

@ -316,24 +316,25 @@ namespace Microsoft.DotNet.ProjectJsonMigration
foreach (var projectDirectory in
Enumerable.Repeat(directory, 1).Union(directory.GetDirectories()))
{
// Create the path to the project.json file.
var projectFilePath = Path.Combine(projectDirectory.FullName, "project.json");
// We INTENTIONALLY do not do an exists check here because it requires disk I/O
// Instead, we'll do an exists check when we try to resolve
// Check if we've already added this, just in case it was pre-loaded into the cache
var project = new ProjectDependency(
projectDirectory.Name,
projectFilePath);
projects.Add(project);
AddIfProjectExists(projects, projectDirectory);
}
}
return projects;
}
private static void AddIfProjectExists(List<ProjectDependency> projects, DirectoryInfo projectDirectory)
{
var projectJSONFilePath = Path.Combine(projectDirectory.FullName, "project.json");
var csProjFilePath = Path.Combine(projectDirectory.FullName, $"{projectDirectory.Name}.csproj");
if (File.Exists(projectJSONFilePath) || File.Exists(csProjFilePath))
{
var project = new ProjectDependency(projectDirectory.Name, projectJSONFilePath);
projects.Add(project);
}
}
internal static List<string> GetGlobalPaths(string rootPath)
{
var paths = new List<string>();

View file

@ -3,12 +3,13 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Construction;
using Microsoft.DotNet.Internal.ProjectModel;
using Microsoft.DotNet.Internal.ProjectModel.Graph;
using Microsoft.DotNet.Cli;
using System.Linq;
using System.IO;
using Microsoft.DotNet.Cli.Utils.ExceptionExtensions;
using Microsoft.DotNet.Cli.Sln.Internal;
using Microsoft.DotNet.ProjectJsonMigration.Rules;
using Microsoft.DotNet.Tools.Common;
@ -19,6 +20,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration
{
private readonly IMigrationRule _ruleSet;
private readonly ProjectDependencyFinder _projectDependencyFinder = new ProjectDependencyFinder();
private HashSet<string> _migratedProjects = new HashSet<string>();
public ProjectMigrator() : this(new DefaultMigrationRuleSet()) { }
@ -37,12 +39,20 @@ namespace Microsoft.DotNet.ProjectJsonMigration
// Try to read the project dependencies, ignore an unresolved exception for now
MigrationRuleInputs rootInputs = ComputeMigrationRuleInputs(rootSettings);
IEnumerable<ProjectDependency> projectDependencies = null;
var projectMigrationReports = new List<ProjectMigrationReport>();
try
{
// Verify up front so we can prefer these errors over an unresolved project dependency
VerifyInputs(rootInputs, rootSettings);
projectMigrationReports.Add(MigrateProject(rootSettings));
if (skipProjectReferences)
{
return new MigrationReport(projectMigrationReports);
}
projectDependencies = ResolveTransitiveClosureProjectDependencies(
rootSettings.ProjectDirectory,
rootSettings.ProjectXProjFilePath,
@ -61,21 +71,12 @@ namespace Microsoft.DotNet.ProjectJsonMigration
});
}
var projectMigrationReports = new List<ProjectMigrationReport>();
projectMigrationReports.Add(MigrateProject(rootSettings));
if (skipProjectReferences)
{
return new MigrationReport(projectMigrationReports);
}
foreach(var project in projectDependencies)
{
var projectDir = Path.GetDirectoryName(project.ProjectFilePath);
var settings = new MigrationSettings(projectDir,
projectDir,
rootSettings.MSBuildProjectTemplatePath);
MigrateProject(settings);
projectMigrationReports.Add(MigrateProject(settings));
}
@ -87,14 +88,22 @@ namespace Microsoft.DotNet.ProjectJsonMigration
try
{
File.Delete(Path.Combine(rootsettings.ProjectDirectory, "project.json"));
} catch {}
}
catch (Exception e)
{
e.ReportAsWarning();
}
foreach (var projectDependency in projectDependencies)
{
try
{
File.Delete(projectDependency.ProjectFilePath);
} catch { }
}
catch (Exception e)
{
e.ReportAsWarning();
}
}
}
@ -132,13 +141,28 @@ namespace Microsoft.DotNet.ProjectJsonMigration
{
var migrationRuleInputs = ComputeMigrationRuleInputs(migrationSettings);
var projectName = migrationRuleInputs.DefaultProjectContext.GetProjectName();
var outputProject = Path.Combine(migrationSettings.OutputDirectory, projectName + ".csproj");
try
{
if (IsMigrated(migrationSettings, migrationRuleInputs))
if (File.Exists(outputProject))
{
MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.SkipMigrationAlreadyMigrated, nameof(ProjectMigrator), migrationSettings.ProjectDirectory));
return new ProjectMigrationReport(migrationSettings.ProjectDirectory, projectName, skipped: true);
if (_migratedProjects.Contains(outputProject))
{
MigrationTrace.Instance.WriteLine(String.Format(
LocalizableStrings.SkipMigrationAlreadyMigrated,
nameof(ProjectMigrator),
migrationSettings.ProjectDirectory));
return new ProjectMigrationReport(
migrationSettings.ProjectDirectory,
projectName,
skipped: true);
}
else
{
MigrationBackupPlan.RenameCsprojFromMigrationOutputNameToTempName(outputProject);
}
}
VerifyInputs(migrationRuleInputs, migrationSettings);
@ -176,7 +200,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration
}
}
var outputProject = Path.Combine(migrationSettings.OutputDirectory, projectName + ".csproj");
_migratedProjects.Add(outputProject);
return new ProjectMigrationReport(
migrationSettings.ProjectDirectory,
projectName,
@ -277,14 +302,5 @@ namespace Microsoft.DotNet.ProjectJsonMigration
File.Copy(sourceFilePath, destinationFilePath);
}
}
public bool IsMigrated(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
{
var outputName = migrationRuleInputs.DefaultProjectContext.GetProjectName();
var outputProject = Path.Combine(migrationSettings.OutputDirectory, outputName + ".csproj");
return File.Exists(outputProject);
}
}
}

Some files were not shown because too many files have changed in this diff Show more