diff --git a/README.md b/README.md index 0293c8b5d..20d404943 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The current official release of the csproj-enabled CLI tools is **CLI Preview 4* There are a couple of things to keep in mind: * Preview 4 CLI bits are still **in development** so some rough edges are to be expected. -* Preview 4 bits **do not support** project.json so you will have to either keep Preview 2 tools around or migrate your project. You can find more information on this using the [project.json to csproj instructions](https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/ProjectJsonToCSProj.md). +* Preview 4 bits **do not support** project.json so you will have to either keep Preview 2 tools around or migrate your project or add a global.json file to your project to target preview2. You can find more information on this using the [project.json to csproj instructions](https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/ProjectJsonToCSProj.md). * Preview 4 refers to the **CLI tools only** and does not cover Visual Studio, VS Code or Visual Studio for Mac. * We welcome any and all issues that relate to MSBuild-based tools, so feel free to try them out and leave comments and file any bugs/problems. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompilationOptions/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompilationOptions/Program.cs new file mode 100644 index 000000000..51233cffa --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompilationOptions/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompilationOptions/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompilationOptions/project.json new file mode 100644 index 000000000..9f677856d --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompilationOptions/project.json @@ -0,0 +1,20 @@ +{ + "version": "1.0.0-*", + "compilerName": "csc", + "compilationOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/HelperBuiltIn1.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/HelperBuiltIn1.cs new file mode 100644 index 000000000..042fc53d1 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/HelperBuiltIn1.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class HelperBuiltIn1 + { + public static string GetMessage() + { + return "Hello from HelperBuiltIn1 class!"; + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/HelperBuiltIn2.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/HelperBuiltIn2.cs new file mode 100644 index 000000000..5ba00add3 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/HelperBuiltIn2.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class HelperBuiltIn2 + { + public static string GetMessage() + { + return "Hello from HelperBuiltIn2 class!"; + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/IncludeThis.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/IncludeThis.cs new file mode 100644 index 000000000..d9300fe2d --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/IncludeThis.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class IncludeThis + { + public static string GetMessage() + { + return "Hello from IncludeThis class!"; + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/Program.cs new file mode 100644 index 000000000..bf3f8b064 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/Program.cs @@ -0,0 +1,14 @@ +using System; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine(IncludeThis.GetMessage()); + Console.WriteLine(HelperBuiltIn1.GetMessage()); + Console.WriteLine(HelperBuiltIn2.GetMessage()); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/project.json new file mode 100644 index 000000000..7418df38c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileBuiltInOptions/project/project.json @@ -0,0 +1,20 @@ +{ + "version": "1.0.0-*", + "compileBuiltIn": [ "Program.cs", "IncludeThis.cs", "../HelperBuiltIn1.cs", "../HelperBuiltIn2.cs" ], + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/ExcludeThis1.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/ExcludeThis1.cs new file mode 100644 index 000000000..c8ee6c75e --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/ExcludeThis1.cs @@ -0,0 +1 @@ +This does not compile but is used to test compile exclusion. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/ExcludeThis2.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/ExcludeThis2.cs new file mode 100644 index 000000000..c8ee6c75e --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/ExcludeThis2.cs @@ -0,0 +1 @@ +This does not compile but is used to test compile exclusion. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/Program.cs new file mode 100644 index 000000000..51233cffa --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/project.json new file mode 100644 index 000000000..3b457a6dc --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileExcludeOptions/project.json @@ -0,0 +1,21 @@ +{ + "version": "1.0.0-*", + "compileExclude": "ExcludeThis1.cs", + "exclude": [ "ExcludeThis2.cs" ], + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/Helper1.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/Helper1.cs new file mode 100644 index 000000000..dd2447c0f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/Helper1.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class Helper1 + { + public static string GetMessage() + { + return "Hello from Helper1 class!"; + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/Helper2.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/Helper2.cs new file mode 100644 index 000000000..eeabb8a3d --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/Helper2.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class Helper2 + { + public static string GetMessage() + { + return "Hello from Helper2 class!"; + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/IncludeThis.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/IncludeThis.cs new file mode 100644 index 000000000..d9300fe2d --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/IncludeThis.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class IncludeThis + { + public static string GetMessage() + { + return "Hello from IncludeThis class!"; + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/Program.cs new file mode 100644 index 000000000..67d7bea12 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/Program.cs @@ -0,0 +1,14 @@ +using System; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine(IncludeThis.GetMessage()); + Console.WriteLine(Helper1.GetMessage()); + Console.WriteLine(Helper2.GetMessage()); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/project.json new file mode 100644 index 000000000..87eeadaa3 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedCompileOptions/project/project.json @@ -0,0 +1,21 @@ +{ + "version": "1.0.0-*", + "compile": "../Helper1.cs", + "compileFiles": "../Helper2.cs", + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFile1.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFile1.txt new file mode 100644 index 000000000..49852374c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFile1.txt @@ -0,0 +1 @@ +Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFile2.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFile2.txt new file mode 100644 index 000000000..49852374c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFile2.txt @@ -0,0 +1 @@ +Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFileBuiltIn1.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFileBuiltIn1.txt new file mode 100644 index 000000000..49852374c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFileBuiltIn1.txt @@ -0,0 +1 @@ +Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFileBuiltIn2.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFileBuiltIn2.txt new file mode 100644 index 000000000..49852374c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/ContentFileBuiltIn2.txt @@ -0,0 +1 @@ +Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/ExcludeThis1.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/ExcludeThis1.txt new file mode 100644 index 000000000..949ca7b7c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/ExcludeThis1.txt @@ -0,0 +1 @@ +Test content file that should be excluded. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/ExcludeThis2.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/ExcludeThis2.txt new file mode 100644 index 000000000..949ca7b7c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/ExcludeThis2.txt @@ -0,0 +1 @@ +Test content file that should be excluded. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/IncludeThis.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/IncludeThis.txt new file mode 100644 index 000000000..49852374c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/IncludeThis.txt @@ -0,0 +1 @@ +Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/Program.cs new file mode 100644 index 000000000..51233cffa --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/project.json new file mode 100644 index 000000000..bf61a22e2 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedContentOptions/project/project.json @@ -0,0 +1,24 @@ +{ + "version": "1.0.0-*", + "content": "*.txt", + "contentExclude": "ExcludeThis1.txt", + "contentFiles": [ "../ContentFile1.txt", "../ContentFile2.txt" ], + "contentBuiltIn": [ "../ContentFileBuiltIn1.txt", "../ContentFileBuiltIn2.txt" ], + "publishExclude": "ExcludeThis2.txt", + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedNamedResourceOption/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedNamedResourceOption/Program.cs new file mode 100644 index 000000000..d0134277c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedNamedResourceOption/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Linq; +using System.Reflection; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + var thisAssembly = typeof(Program).GetTypeInfo().Assembly; + var resources = from resourceName in thisAssembly.GetManifestResourceNames() + select resourceName; + + var resourceNames = string.Join(",", resources); + Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedNamedResourceOption/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedNamedResourceOption/project.json new file mode 100644 index 000000000..0bf0dfa00 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedNamedResourceOption/project.json @@ -0,0 +1,20 @@ +{ + "version": "1.0.0-*", + "namedResource": [ "My.Alias", "Strings.resx" ], + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Content1.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Content1.txt new file mode 100644 index 000000000..a36501f3f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Content1.txt @@ -0,0 +1 @@ +Test pack content file. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Content2.txt b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Content2.txt new file mode 100644 index 000000000..a36501f3f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Content2.txt @@ -0,0 +1 @@ +Test pack content file. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Program.cs new file mode 100644 index 000000000..51233cffa --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/project.json new file mode 100644 index 000000000..5daf77a20 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedPackOptions/project.json @@ -0,0 +1,32 @@ +{ + "version": "1.0.0-*", + "projectUrl": "http://projecturl/", + "licenseUrl": "http://licenseurl/", + "iconUrl": "http://iconurl/", + "owners": [ "owner1", "owner2" ], + "tags": [ "tag1", "tag2" ], + "releaseNotes": "releaseNotes", + "requireLicenseAcceptance": true, + "summary": "summary", + "repository": { + "type": "git", + "url": "http://url/" + }, + "packInclude": [ "Content1.txt", "Content2.txt" ], + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/Strings1.resx b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/Strings1.resx new file mode 100644 index 000000000..1f24a372f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/Strings1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Hello World! + + \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/Strings2.resx b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/Strings2.resx new file mode 100644 index 000000000..1f24a372f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/Strings2.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Hello World! + + \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/Program.cs new file mode 100644 index 000000000..d0134277c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Linq; +using System.Reflection; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + var thisAssembly = typeof(Program).GetTypeInfo().Assembly; + var resources = from resourceName in thisAssembly.GetManifestResourceNames() + select resourceName; + + var resourceNames = string.Join(",", resources); + Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/Resources/Strings.resx b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/Resources/Strings.resx new file mode 100644 index 000000000..1f24a372f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/Resources/Strings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Hello World! + + \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/project.json new file mode 100644 index 000000000..d4f8ee07f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceBuiltInOptions/project/project.json @@ -0,0 +1,20 @@ +{ + "version": "1.0.0-*", + "resourceBuiltIn": [ "../Strings1.resx", "../Strings2.resx" ], + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Exclude1.resx b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Exclude1.resx new file mode 100644 index 000000000..a82c91ddd --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Exclude1.resx @@ -0,0 +1 @@ +This is not a resource file but is used to test resource exclusion. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Exclude2.resx b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Exclude2.resx new file mode 100644 index 000000000..a82c91ddd --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Exclude2.resx @@ -0,0 +1 @@ +This is not a resource file but is used to test resource exclusion. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Program.cs new file mode 100644 index 000000000..d0134277c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Linq; +using System.Reflection; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + var thisAssembly = typeof(Program).GetTypeInfo().Assembly; + var resources = from resourceName in thisAssembly.GetManifestResourceNames() + select resourceName; + + var resourceNames = string.Join(",", resources); + Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/project.json new file mode 100644 index 000000000..01c3c9e23 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceExcludeOptions/project.json @@ -0,0 +1,21 @@ +{ + "version": "1.0.0-*", + "exclude": "Exclude1.resx", + "resourceExclude": [ "Exclude2.resx" ], + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/Strings1.resx b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/Strings1.resx new file mode 100644 index 000000000..1f24a372f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/Strings1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Hello World! + + \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/Strings2.resx b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/Strings2.resx new file mode 100644 index 000000000..1f24a372f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/Strings2.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Hello World! + + \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/Program.cs new file mode 100644 index 000000000..d0134277c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Linq; +using System.Reflection; + +namespace ConsoleApplication +{ + public class Program + { + public static void Main(string[] args) + { + var thisAssembly = typeof(Program).GetTypeInfo().Assembly; + var resources = from resourceName in thisAssembly.GetManifestResourceNames() + select resourceName; + + var resourceNames = string.Join(",", resources); + Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/Resources/Strings.resx b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/Resources/Strings.resx new file mode 100644 index 000000000..1f24a372f --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/Resources/Strings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Hello World! + + \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/project.json new file mode 100644 index 000000000..369f7325d --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithDeprecatedResourceOptions/project/project.json @@ -0,0 +1,21 @@ +{ + "version": "1.0.0-*", + "resource": "../Strings1.resx", + "resourceFiles": [ "../Strings2.resx" ], + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/NoSolutionItemsAfterMigration.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/NoSolutionItemsAfterMigration.sln new file mode 100644 index 000000000..da0ae5935 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/NoSolutionItemsAfterMigration.sln @@ -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}") = "TestApp", "TestApp\TestApp.xproj", "{D65E5A1F-719F-4F95-8835-88BDD67AD457}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FAACC4BE-31AE-4EB7-A4C8-5BB4617EB4AF}" + ProjectSection(SolutionItems) = preProject + global.json = global.json + EndProjectSection +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 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x64.ActiveCfg = Debug|x64 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x64.Build.0 = Debug|x64 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x86.ActiveCfg = Debug|x86 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x86.Build.0 = Debug|x86 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|Any CPU.Build.0 = Release|Any CPU + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x64.ActiveCfg = Release|x64 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x64.Build.0 = Release|x64 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x86.ActiveCfg = Release|x86 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/ReadmeSolutionItemAfterMigration.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/ReadmeSolutionItemAfterMigration.sln new file mode 100644 index 000000000..05aecb75d --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/ReadmeSolutionItemAfterMigration.sln @@ -0,0 +1,40 @@ + +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}") = "TestApp", "TestApp\TestApp.xproj", "{D65E5A1F-719F-4F95-8835-88BDD67AD457}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FAACC4BE-31AE-4EB7-A4C8-5BB4617EB4AF}" + ProjectSection(SolutionItems) = preProject + global.json = global.json + readme.txt = readme.txt + EndProjectSection +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 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x64.ActiveCfg = Debug|x64 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x64.Build.0 = Debug|x64 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x86.ActiveCfg = Debug|x86 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x86.Build.0 = Debug|x86 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|Any CPU.Build.0 = Release|Any CPU + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x64.ActiveCfg = Release|x64 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x64.Build.0 = Release|x64 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x86.ActiveCfg = Release|x86 + {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/TestAssets/TestProjects/TestLibraryWithDeprecatedProjectFile/Helper.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/Program.cs similarity index 59% rename from TestAssets/TestProjects/TestLibraryWithDeprecatedProjectFile/Helper.cs rename to TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/Program.cs index bd9a33ffe..2289ac741 100644 --- a/TestAssets/TestProjects/TestLibraryWithDeprecatedProjectFile/Helper.cs +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/Program.cs @@ -2,14 +2,14 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; - -namespace TestLibrary +namespace TestApp { - public static class Helper + public class Program { - public static void SayHi() + public static int Main(string[] args) { - Console.WriteLine("Hello there!"); + Console.WriteLine("Hello World!"); + return 0; } } } diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/TestApp.xproj new file mode 100644 index 000000000..d18702195 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/TestApp.xproj @@ -0,0 +1,18 @@ + + + + 14.0.23107 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 0138cb8f-4aa9-4029-a21e-c07c30f425ba + TestAppWithContents + ..\..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\..\artifacts\ + + + 2.0 + + + diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/project.json new file mode 100644 index 000000000..166d41c2b --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/project.json @@ -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": {} + } +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/global.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/global.json new file mode 100644 index 000000000..22936715c --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/global.json @@ -0,0 +1,3 @@ +{ + "projects": [ "." ] +} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/readme.txt b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/readme.txt new file mode 100644 index 000000000..6e3eb33f4 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/readme.txt @@ -0,0 +1 @@ +This is just for our test to verify that we do not remove the readme.txt link from the solution. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefThatRefsCsprojWhereSlnDoesNotRefCsproj/TestApp/src/subdir/subdir.csproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefThatRefsCsprojWhereSlnDoesNotRefCsproj/TestApp/src/subdir/subdir.csproj index cec816e3f..731464ac2 100644 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefThatRefsCsprojWhereSlnDoesNotRefCsproj/TestApp/src/subdir/subdir.csproj +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefThatRefsCsprojWhereSlnDoesNotRefCsproj/TestApp/src/subdir/subdir.csproj @@ -8,12 +8,6 @@ F8F96F4A-F10C-4C54-867C-A9EFF55494C8 - - - - - - 1.6.0 diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/Program.cs index c56978bf5..2906f8bbf 100644 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/Program.cs +++ b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/Program.cs @@ -2,9 +2,9 @@ using System; namespace App.Tests { - public class Program + public class TestAssetProgram { - public static void Main(string[] args) + public static void TestAssetMain(string[] args) { Console.WriteLine("Hello World!"); } diff --git a/TestAssets/TestPackages/dotnet-desktop-and-portable/dotnet-desktop-and-portable.csproj b/TestAssets/TestPackages/dotnet-desktop-and-portable/dotnet-desktop-and-portable.csproj index 8a1e7d530..11e93e15a 100644 --- a/TestAssets/TestPackages/dotnet-desktop-and-portable/dotnet-desktop-and-portable.csproj +++ b/TestAssets/TestPackages/dotnet-desktop-and-portable/dotnet-desktop-and-portable.csproj @@ -1,10 +1,10 @@ - + 1.0.0-rc netcoreapp1.0;net451 dotnet-desktop-and-portable Exe - win7-x64;win7-x86;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;osx.10.10-x64;rhel.7-x64 + win7-x64;win7-x86 @@ -23,8 +23,4 @@ - - - $(DefineConstants);RELEASE - diff --git a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj b/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj index b6603c2d8..c1ec38777 100644 --- a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj +++ b/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj @@ -1,6 +1,6 @@  - netcoreapp1.0 + netcoreapp1.1 dotnet-hello Exe 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 @@ -8,7 +8,7 @@ - 1.0.3 + 1.1.0 diff --git a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj b/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj index eaa06bf6e..510f6a431 100644 --- a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj +++ b/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj @@ -1,7 +1,7 @@  2.0.0 - netcoreapp1.0 + netcoreapp1.1 dotnet-hello Exe 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 @@ -9,7 +9,7 @@ - 1.0.3 + 1.1.0 diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj index fe4c0e02c..9c9243987 100755 --- a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj +++ b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj @@ -1,12 +1,12 @@  - netcoreapp1.0 + netcoreapp1.1 Exe - 1.0.3 + 1.1.0 1.0.0 diff --git a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj index bbfb9be11..1f2bc2278 100755 --- a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj +++ b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj @@ -1,14 +1,14 @@  1.0.0 - netcoreapp1.0 + netcoreapp1.1 AppWithDirectDep Exe false - 1.0.3 + 1.1.0 1.0.0 diff --git a/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/Program.cs b/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/Program.cs new file mode 100644 index 000000000..c81448f54 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/Program.cs @@ -0,0 +1,9 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } +} diff --git a/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/project.json b/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/project.json new file mode 100644 index 000000000..67a885251 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/project.json @@ -0,0 +1,24 @@ +{ + "version": "1.0.0-*", + "buildOptions": { + "debugType": "portable", + "emitEntryPoint": true, + "compile": { + "include": [ + "**/*.cs" + ] + } + }, + "dependencies": {}, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.1" + } + }, + "imports": "dnxcore50" + } + } +} diff --git a/TestAssets/TestProjects/TestLibraryWithDeprecatedProjectFile/.noautobuild b/TestAssets/TestProjects/TestLibraryWithDeprecatedProjectFile/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestLibraryWithDeprecatedProjectFile/project.json b/TestAssets/TestProjects/TestLibraryWithDeprecatedProjectFile/project.json deleted file mode 100644 index 90cf856ff..000000000 --- a/TestAssets/TestProjects/TestLibraryWithDeprecatedProjectFile/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "1.0.0-*", - "compilationOptions": { - "xmlDoc": true - }, - "packInclude": {}, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/build.proj b/build.proj index 8e9fd472e..b03807f06 100644 --- a/build.proj +++ b/build.proj @@ -17,14 +17,14 @@ Debug - preview + release/1.1.0 Microsoft.NETCore.App - 1.0.3 - 1.0.1 - 1.0.1 + 1.1.0 + 1.1.0 + 1.1.0 - 1.0.5 - 1.0.5 + 1.1.0 + 1.1.0 .exe @@ -54,7 +54,7 @@ DependsOnTargets="MSBuildWorkaroundTarget; RestoreDotnetCliBuildFramework"> - diff --git a/build/Microsoft.DotNet.Cli.Compile.targets b/build/Microsoft.DotNet.Cli.Compile.targets index 9718ecf7d..effb2348c 100644 --- a/build/Microsoft.DotNet.Cli.Compile.targets +++ b/build/Microsoft.DotNet.Cli.Compile.targets @@ -81,10 +81,15 @@ - - - - + + + + + + + + + @@ -98,7 +103,10 @@ - + @@ -107,7 +115,7 @@ @@ -115,7 +123,7 @@ @@ -146,7 +154,11 @@ + AssetPath="$(BinaryToCorehostifyRelDir)/%(RuntimeTargetsAssetsToRemoveFromDeps.Identity).exe" /> + + @@ -161,6 +173,7 @@ + - 15.1.0-preview-000523-01 - 2.0.0-rc3-61212-03 - 1.0.0-alpha-20170117-4 + 15.1.0-preview-000539-01 + 2.0.0-rc4-61325-08 + 1.0.0-alpha-20170123-1 4.0.0-rc3 1.0.0-alpha-20170120-3-249 15.0.0-preview-20170123-02 diff --git a/build/Microsoft.DotNet.Cli.Monikers.props b/build/Microsoft.DotNet.Cli.Monikers.props index 7a8439645..10981406b 100644 --- a/build/Microsoft.DotNet.Cli.Monikers.props +++ b/build/Microsoft.DotNet.Cli.Monikers.props @@ -3,8 +3,8 @@ Microsoft .NET Core 1.0.3 - SDK RC 4 Microsoft .NET Core 1.0.3 - Runtime - Microsoft .NET Core 1.0.1 - Host - Microsoft .NET Core 1.0.1 - Host FX Resolver + Microsoft .NET Core 1.1.0 - Host + Microsoft .NET Core 1.1.0 - Host FX Resolver Microsoft .NET Core 1.1.0 - Runtime Microsoft .NET Core 1.1.0 - Host diff --git a/build/Microsoft.DotNet.Cli.Prepare.targets b/build/Microsoft.DotNet.Cli.Prepare.targets index 28589ed70..84b8ac3fc 100644 --- a/build/Microsoft.DotNet.Cli.Prepare.targets +++ b/build/Microsoft.DotNet.Cli.Prepare.targets @@ -43,6 +43,10 @@ $(BaseOutputDirectory)/intermediate $(BaseOutputDirectory)/packages $(IntermediateDirectory)/sharedFrameworkPublish + $(Rid) + win7-$(Architecture) + osx.10.10-x64 + rhel.7-x64 @@ -121,10 +125,10 @@ - release/1.1.0 - 1.1.0 - 1.1.0 - 1.1.0 + preview + 1.0.3 + 1.0.1 + 1.0.1 dotnet-host-$(ProductMonikerRid).$(AdditionalSharedHostVersion)$(InstallerExtension) diff --git a/build/Microsoft.DotNet.Cli.Test.targets b/build/Microsoft.DotNet.Cli.Test.targets index 15744a5c3..7e232f861 100644 --- a/build/Microsoft.DotNet.Cli.Test.targets +++ b/build/Microsoft.DotNet.Cli.Test.targets @@ -38,7 +38,7 @@ EnvironmentVariables=$(RunTestEnvironmentVariables); TestProject=%(TestProjects.Identity); TestResultXmlDir=$(TestResultXmlDir); - ToolPath=$(Stage0Directory); + ToolPath=$(Stage2Directory); WorkingDirectory=$([System.IO.Directory]::GetParent(%(TestProjects.Identity))) @@ -86,31 +86,19 @@ - - - %(TestPackageProject.Framework) - true - /p:TargetFramework=$(Framework) - /p:RuntimeIdentifier=%(TestPackageProject.PackRuntime) - + Outputs="%(TestPackageProject.Identity)"> - - - + - + MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion)" /> + diff --git a/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets b/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets index 06456c755..06cae3ffc 100644 --- a/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets +++ b/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets @@ -93,12 +93,12 @@ - - + - $(Rid) - win7-$(Architecture) - osx.10.10-x64 - rhel.7-x64 - + runtime.$(CoreCLRRid).microsoft.netcore.runtime.coreclr runtime.$(CoreCLRRid).microsoft.netcore.runtime.coreclr runtime.$(CoreCLRRid).microsoft.netcore.jit - runtime.$(CoreCLRRid).microsoft.netcore.runtime.coreclr $(NuGetPackagesDir)/$(CoreCLRPackageName)/$(CoreCLRVersion)/runtimes/$(CoreCLRRid)/lib/netstandard1.0 $(NuGetPackagesDir)/$(CrossGenPackageName)/$(CoreCLRVersion)/tools/crossgen$(ExeExtension) diff --git a/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj b/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj index 0be24d98c..b1b375a98 100644 --- a/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj +++ b/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj @@ -90,23 +90,23 @@ Outputs="$(DebianTestResultsXmlFile)" > - - - - + + + + - - - + + + diff --git a/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets b/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets index d3d11daf0..ca94cf99f 100644 --- a/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets +++ b/build/package/Microsoft.DotNet.Cli.Installer.DEB.targets @@ -15,7 +15,7 @@ - + diff --git a/build/test/TestPackageProjects.targets b/build/test/TestPackageProjects.targets index e09a73bdb..a12580b82 100644 --- a/build/test/TestPackageProjects.targets +++ b/build/test/TestPackageProjects.targets @@ -1,76 +1,23 @@ + DependsOnTargets="SetupTestPackageProjectFrameworks"> - - %(Name) - - - - %(BuildOutputs) - $(TestPackagesDir)%(NuPkgName).%(VersionPrefix)%(VersionSuffix).nupkg - - - - - - - - %(TestPackageProject.OutputPath)%(TestPackageProject.Name).dll - - - %(TestPackageProjectFrameworks.Identity) - - + DependsOnTargets="SetupTestPackageProjectBaseData"> - - $(CurrentBuildFramework) - $(CoreCLRRid) - %(OutputPath)$(CurrentBuildFramework)/ + - - - %(BaseTestPackageProject.ProjectPath) - - - - - @(__TestPackageProjectInputs) - - - - - - - <__TestPackageProjectInputs Include="%(BaseTestPackageProject.BuildInputIncludeFilter)" - Exclude="%(BaseTestPackageProject.BuildInputExcludeFilter)"> - %(BaseTestPackageProject.ProjectPath) - - - - - + Microsoft.DotNet.Cli.Utils Microsoft.DotNet.Cli.Utils.csproj True @@ -78,7 +25,17 @@ $(CliVersionPrefix)- rc4-$(TestPackageBuildVersionSuffix) False - netstandard1.5 + + + Microsoft.DotNet.Cli.Utils + Microsoft.DotNet.Cli.Utils.csproj + True + True + $(CliVersionPrefix)- + rc4-$(TestPackageBuildVersionSuffix) + False + /p:TargetFramework=netstandard1.5 Microsoft.DotNet.InternalAbstractions @@ -88,9 +45,9 @@ 2.0.0-beta- beta-$(TestPackageBuildVersionSuffix) False - netstandard1.3 - + PackageWithFakeNativeDep PackageWithFakeNativeDep.csproj False @@ -98,8 +55,7 @@ 1.0.0 True - net45 - $(CoreCLRRid) + /p:RuntimeIdentifier=$(CoreCLRRid) dotnet-dependency-context-test @@ -109,7 +65,6 @@ 1.0.0-rc- rc-$(TestPackageBuildVersionSuffix) True - netcoreapp1.0 dotnet-dependency-tool-invoker @@ -119,9 +74,9 @@ 1.0.0-rc- rc-$(TestPackageBuildVersionSuffix) True - netcoreapp1.0 - + dotnet-desktop-and-portable dotnet-desktop-and-portable.csproj True @@ -129,11 +84,10 @@ 1.0.0-rc- rc-$(TestPackageBuildVersionSuffix) True - net451;netcoreapp1.0 - $(CoreCLRRid) + /p:RuntimeIdentifier=$(CoreCLRRid) + Condition=" '$(IsDesktopAvailable)' == 'True' "> dotnet-desktop-binding-redirects dotnet-desktop-binding-redirects.csproj True @@ -142,8 +96,7 @@ 1.0.0-rc- rc-$(TestPackageBuildVersionSuffix) True - net451 - $(CoreCLRRid) + /p:RuntimeIdentifier=$(CoreCLRRid) dotnet-hello @@ -153,7 +106,6 @@ 1.0.0 True - netcoreapp1.0 dotnet-hello @@ -163,7 +115,6 @@ 2.0.0 True - netcoreapp1.0 dotnet-portable @@ -173,7 +124,6 @@ 1.0.0 True - netcoreapp1.0 dotnet-prefercliruntime @@ -183,7 +133,6 @@ 1.0.0 True - netcoreapp1.0 dotnet-tool-with-output-name @@ -194,13 +143,8 @@ 1.0.0 True - netcoreapp1.0 - - - - $(RepoRoot)%(Identity)/ $(TestPackagesBuildDir)%(Identity)/bin/$(Configuration)/ @@ -208,8 +152,6 @@ %(ProjectDir)%(ProjectName) - %(ProjectDir)**/*.* - %(ProjectDir)bin/**/*.*;%(ProjectDir)obj/**/*.* @@ -219,4 +161,4 @@ %(Name) - \ No newline at end of file + diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index 7ed07d117..e1ed4996a 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -3,10 +3,10 @@ Build scripts for dotnet-cli 1.0.0 - netcoreapp1.0 + netcoreapp1.1 true bin\$(Configuration) - $(PackageTargetFallback);portable-net45+win8+wp8+wpa81 + $(PackageTargetFallback);portable-net45+win8+wp8+wpa81 @@ -17,7 +17,7 @@ 1.6.0 - 1.0.4 + 1.1.0 $(CLI_MSBuild_Version) diff --git a/dir.props b/dir.props index 425b5d385..0c8714f22 100644 --- a/dir.props +++ b/dir.props @@ -13,6 +13,6 @@ true - 1.0.0-rc4 + 1.0.0 diff --git a/scripts/docker/centos/Dockerfile b/scripts/docker/centos/Dockerfile index ae3e87d6a..6bba0fb81 100644 --- a/scripts/docker/centos/Dockerfile +++ b/scripts/docker/centos/Dockerfile @@ -6,6 +6,10 @@ # Dockerfile that creates a container suitable to build dotnet-cli FROM centos:7.1.1503 +# Swap the "fakesystemd" package with the real "systemd" package, because fakesystemd conflicts with openssl-devel. +# The CentOS Docker image uses fakesystemd instead of systemd to reduce disk space. +RUN yum -q -y swap -- remove fakesystemd -- install systemd systemd-libs + RUN yum -q -y install deltarpm RUN yum -q -y install epel-release # RUN yum -y update diff --git a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj index 382259d99..53f8615de 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +++ b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj @@ -15,7 +15,7 @@ 1.0.1-beta-000933 - 1.0.1-beta-000933 + 1.1.0 $(CLI_NuGet_Version) diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs index 57583883e..7a2778d9c 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs @@ -165,7 +165,8 @@ namespace Microsoft.DotNet.Internal.ProjectModel // Project files project.Files = new ProjectFilesCollection(rawProject, project.ProjectDirectory, project.ProjectFilePath); - AddProjectFilesCollectionDiagnostics(rawProject, project); + AddProjectFilesDeprecationDiagnostics(rawProject, project); + ConvertDeprecatedToSupportedFormat(rawProject); var commands = rawProject.Value("commands") as JObject; if (commands != null) @@ -758,10 +759,14 @@ namespace Microsoft.DotNet.Internal.ProjectModel if (rawPackOptions != null) { - var packOptionValue = rawPackOptions.Value(option); - if (packOptionValue != null) + var hasOption = rawPackOptions.Value(option) != null; + if (hasOption) { - return packOptionValue; + var packOptionValue = rawPackOptions.Value(option); + if (packOptionValue != null) + { + return packOptionValue; + } } } @@ -807,37 +812,45 @@ namespace Microsoft.DotNet.Internal.ProjectModel return File.Exists(projectPath); } - private static void AddProjectFilesCollectionDiagnostics(JObject rawProject, Project project) + private static void AddProjectFilesDeprecationDiagnostics(JObject rawProject, Project project) { var compileWarning = "'compile' in 'buildOptions'"; - AddDiagnosticMesage(rawProject, project, "compile", compileWarning); - AddDiagnosticMesage(rawProject, project, "compileExclude", compileWarning); - AddDiagnosticMesage(rawProject, project, "compileFiles", compileWarning); - AddDiagnosticMesage(rawProject, project, "compileBuiltIn", compileWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "compile", compileWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "compileExclude", compileWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "compileFiles", compileWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "compileBuiltIn", compileWarning); var resourceWarning = "'embed' in 'buildOptions'"; - AddDiagnosticMesage(rawProject, project, "resource", resourceWarning); - AddDiagnosticMesage(rawProject, project, "resourceExclude", resourceWarning); - AddDiagnosticMesage(rawProject, project, "resourceFiles", resourceWarning); - AddDiagnosticMesage(rawProject, project, "resourceBuiltIn", resourceWarning); - AddDiagnosticMesage(rawProject, project, "namedResource", resourceWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "resource", resourceWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "resourceExclude", resourceWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "resourceFiles", resourceWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "resourceBuiltIn", resourceWarning); + // Issue: https://github.com/dotnet/cli/issues/5471 + // This is why we mark it as an error which will fail migration. + AddDeprecatedDiagnosticMessage( + rawProject, + project, + "namedResource", + resourceWarning, + DiagnosticMessageSeverity.Error); var contentWarning = "'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output"; - AddDiagnosticMesage(rawProject, project, "content", contentWarning); - AddDiagnosticMesage(rawProject, project, "contentExclude", contentWarning); - AddDiagnosticMesage(rawProject, project, "contentFiles", contentWarning); - AddDiagnosticMesage(rawProject, project, "contentBuiltIn", contentWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "content", contentWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "contentExclude", contentWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "contentFiles", contentWarning); + AddDeprecatedDiagnosticMessage(rawProject, project, "contentBuiltIn", contentWarning); - AddDiagnosticMesage(rawProject, project, "packInclude", "'files' in 'packOptions'"); - AddDiagnosticMesage(rawProject, project, "publishExclude", "'publishOptions'"); - AddDiagnosticMesage(rawProject, project, "exclude", "'exclude' within 'compile' or 'embed'"); + AddDeprecatedDiagnosticMessage(rawProject, project, "packInclude", "'files' in 'packOptions'"); + AddDeprecatedDiagnosticMessage(rawProject, project, "publishExclude", "'publishOptions'"); + AddDeprecatedDiagnosticMessage(rawProject, project, "exclude", "'exclude' within 'compile' or 'embed'"); } - private static void AddDiagnosticMesage( + private static void AddDeprecatedDiagnosticMessage( JObject rawProject, Project project, string option, - string message) + string message, + DiagnosticMessageSeverity severity = DiagnosticMessageSeverity.Warning) { var lineInfo = rawProject.Value(option); if (lineInfo == null) @@ -850,11 +863,132 @@ namespace Microsoft.DotNet.Internal.ProjectModel ErrorCodes.DOTNET1015, $"The '{option}' option is deprecated. Use {message} instead.", project.ProjectFilePath, - DiagnosticMessageSeverity.Warning, + severity, lineInfo.LineNumber, lineInfo.LinePosition)); } + private static void ConvertDeprecatedToSupportedFormat(JObject rawProject) + { + ConvertToBuildOptionsCompile(rawProject); + ConvertToBuildOptionsEmbed(rawProject); + ConvertToBuildOptionsCopyToOutput(rawProject); + ConvertToPackOptions(rawProject); + ConvertToPublishOptions(rawProject); + } + + private static void ConvertToBuildOptionsCompile(JObject rawProject) + { + var jpath = "buildOptions.compile"; + if (AreDeprecatedOptionsIgnored(rawProject, jpath)) + { + return; + } + + ConvertFromDeprecatedFormat(rawProject, jpath, "compile", "include"); + ConvertFromDeprecatedFormat(rawProject, jpath, "exclude", "exclude"); + ConvertFromDeprecatedFormat(rawProject, jpath, "compileExclude", "excludeFiles"); + ConvertFromDeprecatedFormat(rawProject, jpath, "compileFiles", "includeFiles"); + ConvertFromDeprecatedFormat(rawProject, $"{jpath}.builtIns", "compileBuiltIn", "include"); + } + + private static void ConvertToBuildOptionsEmbed(JObject rawProject) + { + var jpath = "buildOptions.embed"; + if (AreDeprecatedOptionsIgnored(rawProject, jpath)) + { + return; + } + + ConvertFromDeprecatedFormat(rawProject, jpath, "resource", "include"); + ConvertFromDeprecatedFormat(rawProject, jpath, "exclude", "exclude"); + ConvertFromDeprecatedFormat(rawProject, jpath, "resourceExclude", "excludeFiles"); + ConvertFromDeprecatedFormat(rawProject, jpath, "resourceFiles", "includeFiles"); + ConvertFromDeprecatedFormat(rawProject, $"{jpath}.builtIns", "resourceBuiltIn", "include"); + } + + private static void ConvertToBuildOptionsCopyToOutput(JObject rawProject) + { + var jpath = "buildOptions.copyToOutput"; + if (AreDeprecatedOptionsIgnored(rawProject, jpath)) + { + return; + } + + ConvertFromDeprecatedFormat(rawProject, jpath, "content", "include"); + ConvertFromDeprecatedFormat(rawProject, jpath, "contentExclude", "excludeFiles"); + ConvertFromDeprecatedFormat(rawProject, jpath, "contentFiles", "includeFiles"); + ConvertFromDeprecatedFormat(rawProject, $"{jpath}.builtIns", "contentBuiltIn", "include"); + } + + private static void ConvertToPackOptions(JObject rawProject) + { + var jpath = "packOptions"; + if (AreDeprecatedOptionsIgnored(rawProject, jpath)) + { + return; + } + + ConvertFromDeprecatedFormat(rawProject, $"{jpath}.files", "packInclude", "include"); + } + + private static void ConvertToPublishOptions(JObject rawProject) + { + var jpath = "publishOptions"; + if (AreDeprecatedOptionsIgnored(rawProject, jpath)) + { + return; + } + + ConvertFromDeprecatedFormat(rawProject, jpath, "content", "include"); + ConvertFromDeprecatedFormat(rawProject, jpath, "publishExclude", "exclude"); + ConvertFromDeprecatedFormat(rawProject, jpath, "contentExclude", "excludeFiles"); + ConvertFromDeprecatedFormat(rawProject, jpath, "contentFiles", "includeFiles"); + ConvertFromDeprecatedFormat(rawProject, $"{jpath}.builtIns", "contentBuiltIn", "include"); + } + + private static bool AreDeprecatedOptionsIgnored(JObject rawProject, string jpathToNewFormatObject) + { + // If the node already exists this means that the project.json file contained both the old and + // new format. In these cases the project.json build ignores the deprecated format and just uses + // the new format. + return (rawProject.SelectToken(jpathToNewFormatObject) != null); + } + + private static void ConvertFromDeprecatedFormat( + JObject rawProject, + string jpathToObject, + string deprecatedKey, + string newKey + ) + { + var deprecatedValue = rawProject.Value(deprecatedKey); + if (deprecatedValue != null) + { + var objectNode = GetOrCreateObjectHierarchy(rawProject, jpathToObject); + objectNode[newKey] = deprecatedValue.DeepClone(); + } + } + + private static JObject GetOrCreateObjectHierarchy(JObject rawProject, string jpath) + { + var currentObject = rawProject as JObject; + + var objectHierarchy = jpath.Split('.'); + foreach (var name in objectHierarchy) + { + var childObject = currentObject.Value(name); + if (childObject == null) + { + childObject = new JObject(); + currentObject[name] = childObject; + } + currentObject = childObject; + } + + return currentObject; + } + private static bool TryGetStringEnumerable(JToken token, out IEnumerable result) { IEnumerable values; diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.ProjectJsonMigration.csproj b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.ProjectJsonMigration.csproj index 06346c987..2704bff36 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.ProjectJsonMigration.csproj +++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.ProjectJsonMigration.csproj @@ -3,7 +3,7 @@ $(CliVersionPrefix) - netcoreapp1.0 + netcoreapp1.1 true ../../tools/Key.snk true diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs index 380a9a435..d8332258a 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs @@ -314,7 +314,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration } foreach (var projectDirectory in - Enumerable.Repeat(directory, 1).Union(directory.GetDirectories())) + Enumerable.Repeat(directory, 1).Union(directory.GetDirectories("*", SearchOption.AllDirectories))) { AddIfProjectExists(projects, projectDirectory); } diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs index 2596d8f2f..2554ee9c8 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs @@ -9,6 +9,7 @@ using Microsoft.Build.Construction; using Microsoft.DotNet.Internal.ProjectModel; using Microsoft.DotNet.Internal.ProjectModel.Graph; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils.ExceptionExtensions; using Microsoft.DotNet.Cli.Sln.Internal; using Microsoft.DotNet.ProjectJsonMigration.Rules; @@ -41,10 +42,11 @@ namespace Microsoft.DotNet.ProjectJsonMigration IEnumerable projectDependencies = null; var projectMigrationReports = new List(); + List warnings = null; try { // Verify up front so we can prefer these errors over an unresolved project dependency - VerifyInputs(rootInputs, rootSettings); + VerifyInputs(rootInputs, rootSettings, out warnings); projectMigrationReports.Add(MigrateProject(rootSettings)); @@ -67,7 +69,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration rootSettings.ProjectDirectory, rootInputs?.DefaultProjectContext?.GetProjectName(), new List {e.Error}, - null) + warnings) }); } @@ -143,6 +145,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration var projectName = migrationRuleInputs.DefaultProjectContext.GetProjectName(); var outputProject = Path.Combine(migrationSettings.OutputDirectory, projectName + ".csproj"); + List warnings = null; try { if (File.Exists(outputProject)) @@ -165,7 +168,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration } } - VerifyInputs(migrationRuleInputs, migrationSettings); + VerifyInputs(migrationRuleInputs, migrationSettings, out warnings); SetupOutputDirectory(migrationSettings.ProjectDirectory, migrationSettings.OutputDirectory); @@ -178,7 +181,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration exc.Error }; - return new ProjectMigrationReport(migrationSettings.ProjectDirectory, projectName, error, null); + return new ProjectMigrationReport(migrationSettings.ProjectDirectory, projectName, error, warnings); } List csprojDependencies = null; @@ -207,7 +210,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration projectName, outputProject, null, - null, + warnings, csprojDependencies); } @@ -234,13 +237,22 @@ namespace Microsoft.DotNet.ProjectJsonMigration return new MigrationRuleInputs(projectContexts, templateMSBuildProject, itemGroup, propertyGroup, xproj); } - private void VerifyInputs(MigrationRuleInputs migrationRuleInputs, MigrationSettings migrationSettings) + private void VerifyInputs( + MigrationRuleInputs migrationRuleInputs, + MigrationSettings migrationSettings, + out List warningMessages + ) { - VerifyProject(migrationRuleInputs.ProjectContexts, migrationSettings.ProjectDirectory); + VerifyProject(migrationRuleInputs.ProjectContexts, migrationSettings.ProjectDirectory, out warningMessages); } - private void VerifyProject(IEnumerable projectContexts, string projectDirectory) + private void VerifyProject( + IEnumerable projectContexts, + string projectDirectory, + out List warningMessages) { + warningMessages = null; + if (!projectContexts.Any()) { MigrationErrorCodes.MIGRATE1013(String.Format(LocalizableStrings.MIGRATE1013Arg, projectDirectory)).Throw(); @@ -251,9 +263,29 @@ namespace Microsoft.DotNet.ProjectJsonMigration var diagnostics = defaultProjectContext.ProjectFile.Diagnostics; if (diagnostics.Any()) { - MigrationErrorCodes.MIGRATE1011( - String.Format("{0}{1}{2}", projectDirectory, Environment.NewLine, string.Join(Environment.NewLine, diagnostics.Select(d => FormatDiagnosticMessage(d))))) - .Throw(); + var warnings = diagnostics.Where(d => d.Severity == DiagnosticMessageSeverity.Warning); + if (warnings.Any()) + { + var migrationError = MigrationErrorCodes.MIGRATE1011(String.Format( + "{0}{1}{2}", + projectDirectory, + Environment.NewLine, + string.Join(Environment.NewLine, diagnostics.Select(d => FormatDiagnosticMessage(d))))); + + warningMessages = new List(); + warningMessages.Add(migrationError.GetFormattedErrorMessage()); + } + + var errors = diagnostics.Where(d => d.Severity == DiagnosticMessageSeverity.Error); + if (errors.Any()) + { + MigrationErrorCodes.MIGRATE1011(String.Format( + "{0}{1}{2}", + projectDirectory, + Environment.NewLine, + string.Join(Environment.NewLine, diagnostics.Select(d => FormatDiagnosticMessage(d))))) + .Throw(); + } } var compilerName = diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs index c0e3b0201..b243be518 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs @@ -110,10 +110,15 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules compilerOptions => projectFolderName, compilerOptions => compilerOptions.OutputName != null); + private string[] _compilePatternsToExclude = new string[] { + "**/*.cs" + }; + private IncludeContextTransform CompileFilesTransform => new IncludeContextTransform( "Compile", transformMappings: false, + patternsToExclude: _compilePatternsToExclude, condition: ic => ic != null, emitBuiltInIncludes: false); diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/IncludeContextTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/IncludeContextTransform.cs index 65630c2da..80a671cd1 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/IncludeContextTransform.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/IncludeContextTransform.cs @@ -25,6 +25,11 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms && includeContext.IncludeFiles != null && includeContext.IncludeFiles.Count > 0); + private bool IsPatternExcluded(string pattern) + { + return _patternsToExclude.Contains(pattern.Replace('\\', '/')); + } + protected virtual Func> IncludeExcludeTransformGetter => (itemName) => new AddItemTransform( itemName, @@ -36,6 +41,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms fullIncludeSet = fullIncludeSet.Union(includeContext.BuiltInsInclude.OrEmptyIfNull()); } + fullIncludeSet = fullIncludeSet.Where((pattern) => !IsPatternExcluded(pattern)); + return FormatGlobPatternsForMsbuild(fullIncludeSet, includeContext.SourceBasePath); }, includeContext => @@ -50,7 +57,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms { return includeContext != null && ( - (includeContext.IncludePatterns != null && includeContext.IncludePatterns.Count > 0) + (includeContext.IncludePatterns != null && includeContext.IncludePatterns.Where((pattern) => !IsPatternExcluded(pattern)).Count() > 0) || (_emitBuiltInIncludes && includeContext.BuiltInsInclude != null && @@ -68,6 +75,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms private readonly string _itemName; private bool _transformMappings; + private string[] _patternsToExclude; private bool _emitBuiltInIncludes; private readonly List> _metadata = new List>(); @@ -75,11 +83,13 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms string itemName, bool transformMappings = true, Func condition = null, - bool emitBuiltInIncludes = true) : base(condition) + bool emitBuiltInIncludes = true, + string[] patternsToExclude = null) : base(condition) { _itemName = itemName; _transformMappings = transformMappings; _emitBuiltInIncludes = emitBuiltInIncludes; + _patternsToExclude = patternsToExclude ?? Array.Empty(); _mappingsToTransfrom = (addItemTransform, targetPath) => { diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs b/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs index ea942eb65..3fc98f0a4 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs +++ b/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs @@ -104,6 +104,15 @@ namespace Microsoft.DotNet.TestFramework return this; } + public TestAssetInstance WithEmptyGlobalJson() + { + var file = Root.Parent.GetFile("global.json"); + + File.WriteAllText(file.FullName, @"{}"); + + return this; + } + private void CopyFiles(IEnumerable filesToCopy) { foreach (var file in filesToCopy) diff --git a/src/dotnet-archive/dotnet-archive.csproj b/src/dotnet-archive/dotnet-archive.csproj index 1b6c8e41c..3bf1aba42 100644 --- a/src/dotnet-archive/dotnet-archive.csproj +++ b/src/dotnet-archive/dotnet-archive.csproj @@ -2,7 +2,7 @@ - netcoreapp1.0 + netcoreapp1.1 Exe @@ -13,7 +13,7 @@ - 1.0.3 + 1.1.0 diff --git a/src/dotnet/SlnFileExtensions.cs b/src/dotnet/SlnFileExtensions.cs new file mode 100644 index 000000000..7fbf0fb70 --- /dev/null +++ b/src/dotnet/SlnFileExtensions.cs @@ -0,0 +1,330 @@ +// 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 Microsoft.Build.Construction; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Execution; +using Microsoft.DotNet.Cli.Sln.Internal; +using Microsoft.DotNet.Cli.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace Microsoft.DotNet.Tools.Common +{ + internal static class SlnFileExtensions + { + public static void AddProject(this SlnFile slnFile, string fullProjectPath) + { + if (string.IsNullOrEmpty(fullProjectPath)) + { + throw new ArgumentException(); + } + + var relativeProjectPath = PathUtility.GetRelativePath( + PathUtility.EnsureTrailingSlash(slnFile.BaseDirectory), + fullProjectPath); + + if (slnFile.Projects.Any((p) => + string.Equals(p.FilePath, relativeProjectPath, StringComparison.OrdinalIgnoreCase))) + { + Reporter.Output.WriteLine(string.Format( + CommonLocalizableStrings.SolutionAlreadyContainsProject, + slnFile.FullPath, + relativeProjectPath)); + } + else + { + var projectInstance = new ProjectInstance(fullProjectPath); + + var slnProject = new SlnProject + { + Id = projectInstance.GetProjectId(), + TypeGuid = projectInstance.GetProjectTypeGuid(), + Name = Path.GetFileNameWithoutExtension(relativeProjectPath), + FilePath = relativeProjectPath + }; + + slnFile.AddDefaultBuildConfigurations(slnProject); + + slnFile.AddSolutionFolders(slnProject); + + slnFile.Projects.Add(slnProject); + + Reporter.Output.WriteLine( + string.Format(CommonLocalizableStrings.ProjectAddedToTheSolution, relativeProjectPath)); + } + } + + public static void AddDefaultBuildConfigurations(this SlnFile slnFile, SlnProject slnProject) + { + if (slnProject == null) + { + throw new ArgumentException(); + } + + var defaultConfigurations = new List() + { + "Debug|Any CPU", + "Debug|x64", + "Debug|x86", + "Release|Any CPU", + "Release|x64", + "Release|x86", + }; + + // NOTE: The order you create the sections determines the order they are written to the sln + // file. In the case of an empty sln file, in order to make sure the solution configurations + // section comes first we need to add it first. This doesn't affect correctness but does + // stop VS from re-ordering things later on. Since we are keeping the SlnFile class low-level + // it shouldn't care about the VS implementation details. That's why we handle this here. + AddDefaultSolutionConfigurations(defaultConfigurations, slnFile.SolutionConfigurationsSection); + AddDefaultProjectConfigurations( + defaultConfigurations, + slnFile.ProjectConfigurationsSection.GetOrCreatePropertySet(slnProject.Id)); + } + + private static void AddDefaultSolutionConfigurations( + List defaultConfigurations, + SlnPropertySet solutionConfigs) + { + foreach (var config in defaultConfigurations) + { + if (!solutionConfigs.ContainsKey(config)) + { + solutionConfigs[config] = config; + } + } + } + + private static void AddDefaultProjectConfigurations( + List defaultConfigurations, + SlnPropertySet projectConfigs) + { + foreach (var config in defaultConfigurations) + { + var activeCfgKey = $"{config}.ActiveCfg"; + if (!projectConfigs.ContainsKey(activeCfgKey)) + { + projectConfigs[activeCfgKey] = config; + } + + var build0Key = $"{config}.Build.0"; + if (!projectConfigs.ContainsKey(build0Key)) + { + projectConfigs[build0Key] = config; + } + } + } + + public static void AddSolutionFolders(this SlnFile slnFile, SlnProject slnProject) + { + if (slnProject == null) + { + throw new ArgumentException(); + } + + var solutionFolders = slnProject.GetSolutionFoldersFromProject(); + + if (solutionFolders.Any()) + { + var nestedProjectsSection = slnFile.Sections.GetOrCreateSection( + "NestedProjects", + SlnSectionType.PreProcess); + + var pathToGuidMap = slnFile.GetSolutionFolderPaths(nestedProjectsSection.Properties); + + string parentDirGuid = null; + var solutionFolderHierarchy = string.Empty; + foreach (var dir in solutionFolders) + { + solutionFolderHierarchy = Path.Combine(solutionFolderHierarchy, dir); + if (pathToGuidMap.ContainsKey(solutionFolderHierarchy)) + { + parentDirGuid = pathToGuidMap[solutionFolderHierarchy]; + } + else + { + var solutionFolder = new SlnProject + { + Id = Guid.NewGuid().ToString("B").ToUpper(), + TypeGuid = ProjectTypeGuids.SolutionFolderGuid, + Name = dir, + FilePath = dir + }; + + slnFile.Projects.Add(solutionFolder); + + if (parentDirGuid != null) + { + nestedProjectsSection.Properties[solutionFolder.Id] = parentDirGuid; + } + parentDirGuid = solutionFolder.Id; + } + } + + nestedProjectsSection.Properties[slnProject.Id] = parentDirGuid; + } + } + + private static IDictionary GetSolutionFolderPaths( + this SlnFile slnFile, + SlnPropertySet nestedProjects) + { + var solutionFolderPaths = new Dictionary(); + + var solutionFolderProjects = slnFile.Projects.GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid); + foreach (var slnProject in solutionFolderProjects) + { + var path = slnProject.FilePath; + var id = slnProject.Id; + while (nestedProjects.ContainsKey(id)) + { + id = nestedProjects[id]; + var parentSlnProject = solutionFolderProjects.Where(p => p.Id == id).Single(); + path = Path.Combine(parentSlnProject.FilePath, path); + } + + solutionFolderPaths[path] = slnProject.Id; + } + + return solutionFolderPaths; + } + + public static bool RemoveProject(this SlnFile slnFile, string projectPath) + { + if (string.IsNullOrEmpty(projectPath)) + { + throw new ArgumentException(); + } + + var projectPathNormalized = PathUtility.GetPathWithDirectorySeparator(projectPath); + + var projectsToRemove = slnFile.Projects.Where((p) => + string.Equals(p.FilePath, projectPathNormalized, StringComparison.OrdinalIgnoreCase)).ToList(); + + bool projectRemoved = false; + if (projectsToRemove.Count == 0) + { + Reporter.Output.WriteLine(string.Format( + CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, + projectPath)); + } + else + { + foreach (var slnProject in projectsToRemove) + { + var buildConfigsToRemove = slnFile.ProjectConfigurationsSection.GetPropertySet(slnProject.Id); + if (buildConfigsToRemove != null) + { + slnFile.ProjectConfigurationsSection.Remove(buildConfigsToRemove); + } + + var nestedProjectsSection = slnFile.Sections.GetSection( + "NestedProjects", + SlnSectionType.PreProcess); + if (nestedProjectsSection != null && nestedProjectsSection.Properties.ContainsKey(slnProject.Id)) + { + nestedProjectsSection.Properties.Remove(slnProject.Id); + } + + slnFile.Projects.Remove(slnProject); + Reporter.Output.WriteLine( + string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, slnProject.FilePath)); + } + + projectRemoved = true; + } + + return projectRemoved; + } + + public static void RemoveEmptyConfigurationSections(this SlnFile slnFile) + { + if (slnFile.Projects.Count == 0) + { + var solutionConfigs = slnFile.Sections.GetSection("SolutionConfigurationPlatforms"); + if (solutionConfigs != null) + { + slnFile.Sections.Remove(solutionConfigs); + } + + var projectConfigs = slnFile.Sections.GetSection("ProjectConfigurationPlatforms"); + if (projectConfigs != null) + { + slnFile.Sections.Remove(projectConfigs); + } + } + } + + public static void RemoveEmptySolutionFolders(this SlnFile slnFile) + { + var solutionFolderProjects = slnFile.Projects + .GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid) + .ToList(); + + if (solutionFolderProjects.Any()) + { + var nestedProjectsSection = slnFile.Sections.GetSection( + "NestedProjects", + SlnSectionType.PreProcess); + + if (nestedProjectsSection == null) + { + foreach (var solutionFolderProject in solutionFolderProjects) + { + if (solutionFolderProject.Sections.Count() == 0) + { + slnFile.Projects.Remove(solutionFolderProject); + } + } + } + else + { + var solutionFoldersInUse = slnFile.GetSolutionFoldersThatContainProjectsInItsHierarchy( + nestedProjectsSection.Properties); + + foreach (var solutionFolderProject in solutionFolderProjects) + { + if (!solutionFoldersInUse.Contains(solutionFolderProject.Id)) + { + nestedProjectsSection.Properties.Remove(solutionFolderProject.Id); + if (solutionFolderProject.Sections.Count() == 0) + { + slnFile.Projects.Remove(solutionFolderProject); + } + } + } + + if (nestedProjectsSection.IsEmpty) + { + slnFile.Sections.Remove(nestedProjectsSection); + } + } + } + } + + private static HashSet GetSolutionFoldersThatContainProjectsInItsHierarchy( + this SlnFile slnFile, + SlnPropertySet nestedProjects) + { + var solutionFoldersInUse = new HashSet(); + + var nonSolutionFolderProjects = slnFile.Projects.GetProjectsNotOfType( + ProjectTypeGuids.SolutionFolderGuid); + + foreach (var nonSolutionFolderProject in nonSolutionFolderProjects) + { + var id = nonSolutionFolderProject.Id; + while (nestedProjects.ContainsKey(id)) + { + id = nestedProjects[id]; + solutionFoldersInUse.Add(id); + } + } + + return solutionFoldersInUse; + } + } +} diff --git a/src/dotnet/SlnProjectCollectionExtensions.cs b/src/dotnet/SlnProjectCollectionExtensions.cs index d99b34eee..09499e5a2 100644 --- a/src/dotnet/SlnProjectCollectionExtensions.cs +++ b/src/dotnet/SlnProjectCollectionExtensions.cs @@ -8,7 +8,7 @@ using System.Linq; namespace Microsoft.DotNet.Tools.Common { - public static class SlnProjectCollectionExtensions + internal static class SlnProjectCollectionExtensions { public static IEnumerable GetProjectsByType( this SlnProjectCollection projects, diff --git a/src/dotnet/SlnProjectExtensions.cs b/src/dotnet/SlnProjectExtensions.cs index 925089beb..80ebf5d3e 100644 --- a/src/dotnet/SlnProjectExtensions.cs +++ b/src/dotnet/SlnProjectExtensions.cs @@ -8,7 +8,7 @@ using System.Linq; namespace Microsoft.DotNet.Tools.Common { - public static class SlnProjectExtensions + internal static class SlnProjectExtensions { public static IList GetSolutionFoldersFromProject(this SlnProject project) { diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf index becde7aba..ab216036c 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf @@ -10,7 +10,7 @@ Command to add project to project reference - Befehl zum Hinzufügen des Projekts zum Projektverweis + Befehl zum Hinzufügen eines Projekt-zu-Projekt-Verweises diff --git a/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs index 34c8bbc53..131a9c3c2 100644 --- a/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs +++ b/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs @@ -103,7 +103,24 @@ namespace Microsoft.DotNet.Tools.Migrate private void UpdateSolutionFile(MigrationReport migrationReport) { - if (_slnFile == null) + if(_slnFile != null) + { + UpdateSolutionFile(migrationReport, _slnFile); + } + else + { + foreach (var slnPath in _workspaceDirectory.EnumerateFiles("*.sln")) + { + var slnFile = SlnFile.Read(slnPath.FullName); + + UpdateSolutionFile(migrationReport, slnFile); + } + } + } + + private void UpdateSolutionFile(MigrationReport migrationReport, SlnFile slnFile) + { + if (slnFile == null) { return; } @@ -115,7 +132,7 @@ namespace Microsoft.DotNet.Tools.Migrate var csprojFilesToAdd = new HashSet(); - var slnPathWithTrailingSlash = PathUtility.EnsureTrailingSlash(_slnFile.BaseDirectory); + var slnPathWithTrailingSlash = PathUtility.EnsureTrailingSlash(slnFile.BaseDirectory); foreach (var report in migrationReport.ProjectMigrationReports) { var reportPathWithTrailingSlash = PathUtility.EnsureTrailingSlash(report.ProjectDirectory); @@ -124,7 +141,7 @@ namespace Microsoft.DotNet.Tools.Migrate reportPathWithTrailingSlash); var xprojPath = Path.Combine(relativeReportPath, report.ProjectName + ".xproj"); - var xprojProjectsReferencedBySolution = _slnFile.Projects.Where(p => p.FilePath == xprojPath); + var xprojProjectsReferencedBySolution = slnFile.Projects.Where(p => p.FilePath == xprojPath); var migratedProjectName = report.ProjectName + ".csproj"; if (xprojProjectsReferencedBySolution.Count() == 1) @@ -138,7 +155,7 @@ namespace Microsoft.DotNet.Tools.Migrate else { var csprojPath = Path.Combine(relativeReportPath, migratedProjectName); - var solutionContainsCsprojPriorToMigration = _slnFile.Projects + var solutionContainsCsprojPriorToMigration = slnFile.Projects .Where(p => p.FilePath == csprojPath) .Any(); @@ -155,21 +172,43 @@ namespace Microsoft.DotNet.Tools.Migrate } Version version; - if (!Version.TryParse(_slnFile.VisualStudioVersion, out version) || version.Major < 15) + if (!Version.TryParse(slnFile.VisualStudioVersion, out version) || version.Major < 15) { - _slnFile.ProductDescription = ProductDescription; - _slnFile.VisualStudioVersion = VisualStudioVersion; - _slnFile.MinimumVisualStudioVersion = MinimumVisualStudioVersion; + slnFile.ProductDescription = ProductDescription; + slnFile.VisualStudioVersion = VisualStudioVersion; + slnFile.MinimumVisualStudioVersion = MinimumVisualStudioVersion; } - _slnFile.Write(); + RemoveReferencesToMigratedFiles(slnFile); + + slnFile.Write(); foreach (var csprojFile in csprojFilesToAdd) { - AddProject(_slnFile.FullPath, csprojFile); + AddProject(slnFile.FullPath, csprojFile); } } + private void RemoveReferencesToMigratedFiles(SlnFile slnFile) + { + var solutionFolders = slnFile.Projects.GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid); + + foreach (var solutionFolder in solutionFolders) + { + var solutionItems = solutionFolder.Sections.GetSection("SolutionItems"); + if (solutionItems != null && solutionItems.Properties.ContainsKey("global.json")) + { + solutionItems.Properties.Remove("global.json"); + if (solutionItems.IsEmpty) + { + solutionFolder.Sections.Remove(solutionItems); + } + } + } + + slnFile.RemoveEmptySolutionFolders(); + } + private void AddProject(string slnPath, string csprojPath) { List args = new List() @@ -240,6 +279,8 @@ namespace Microsoft.DotNet.Tools.Migrate { var errorContent = GetProjectReportErrorContent(projectMigrationReport, colored: true); var successContent = GetProjectReportSuccessContent(projectMigrationReport, colored: true); + var warningContent = GetProjectReportWarningContent(projectMigrationReport, colored: true); + Reporter.Output.WriteLine(warningContent); if (!string.IsNullOrEmpty(errorContent)) { Reporter.Error.WriteLine(errorContent); @@ -268,6 +309,8 @@ namespace Microsoft.DotNet.Tools.Migrate { var errorContent = GetProjectReportErrorContent(projectMigrationReport, colored: colored); var successContent = GetProjectReportSuccessContent(projectMigrationReport, colored: colored); + var warningContent = GetProjectReportWarningContent(projectMigrationReport, colored: colored); + sb.AppendLine(warningContent); if (!string.IsNullOrEmpty(errorContent)) { sb.AppendLine(errorContent); @@ -309,6 +352,19 @@ namespace Microsoft.DotNet.Tools.Migrate projectMigrationReport.ProjectDirectory)); } + private string GetProjectReportWarningContent(ProjectMigrationReport projectMigrationReport, bool colored) + { + StringBuilder sb = new StringBuilder(); + Func YellowIfColored = (str) => colored ? str.Yellow() : str; + + foreach (var warning in projectMigrationReport.Warnings) + { + sb.AppendLine(YellowIfColored(warning)); + } + + return sb.ToString(); + } + private string GetProjectReportErrorContent(ProjectMigrationReport projectMigrationReport, bool colored) { StringBuilder sb = new StringBuilder(); diff --git a/src/dotnet/commands/dotnet-new/CSharp_Mstest/$projectName$.csproj b/src/dotnet/commands/dotnet-new/CSharp_Mstest/$projectName$.csproj index 051122114..229580c09 100644 --- a/src/dotnet/commands/dotnet-new/CSharp_Mstest/$projectName$.csproj +++ b/src/dotnet/commands/dotnet-new/CSharp_Mstest/$projectName$.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/src/dotnet/commands/dotnet-new/FSharp_Mstest/$projectName$.fsproj b/src/dotnet/commands/dotnet-new/FSharp_Mstest/$projectName$.fsproj index ec090fa88..fbccc158c 100644 --- a/src/dotnet/commands/dotnet-new/FSharp_Mstest/$projectName$.fsproj +++ b/src/dotnet/commands/dotnet-new/FSharp_Mstest/$projectName$.fsproj @@ -14,8 +14,8 @@ - - + + diff --git a/src/dotnet/commands/dotnet-sln/add/Program.cs b/src/dotnet/commands/dotnet-sln/add/Program.cs index 889506662..6b6124a29 100644 --- a/src/dotnet/commands/dotnet-sln/add/Program.cs +++ b/src/dotnet/commands/dotnet-sln/add/Program.cs @@ -1,9 +1,6 @@ // 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 Microsoft.Build.Construction; -using Microsoft.Build.Evaluation; -using Microsoft.Build.Execution; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Sln.Internal; using Microsoft.DotNet.Cli.Utils; @@ -49,7 +46,7 @@ namespace Microsoft.DotNet.Tools.Sln.Add int preAddProjectCount = slnFile.Projects.Count; foreach (var fullProjectPath in fullProjectPaths) { - AddProject(slnFile, fullProjectPath); + slnFile.AddProject(fullProjectPath); } if (slnFile.Projects.Count > preAddProjectCount) @@ -59,165 +56,5 @@ namespace Microsoft.DotNet.Tools.Sln.Add return 0; } - - private void AddProject(SlnFile slnFile, string fullProjectPath) - { - var relativeProjectPath = PathUtility.GetRelativePath( - PathUtility.EnsureTrailingSlash(slnFile.BaseDirectory), - fullProjectPath); - - if (slnFile.Projects.Any((p) => - string.Equals(p.FilePath, relativeProjectPath, StringComparison.OrdinalIgnoreCase))) - { - Reporter.Output.WriteLine(string.Format( - CommonLocalizableStrings.SolutionAlreadyContainsProject, - slnFile.FullPath, - relativeProjectPath)); - } - else - { - var projectInstance = new ProjectInstance(fullProjectPath); - - var slnProject = new SlnProject - { - Id = projectInstance.GetProjectId(), - TypeGuid = projectInstance.GetProjectTypeGuid(), - Name = Path.GetFileNameWithoutExtension(relativeProjectPath), - FilePath = relativeProjectPath - }; - - AddDefaultBuildConfigurations(slnFile, slnProject); - - AddSolutionFolders(slnFile, slnProject); - - slnFile.Projects.Add(slnProject); - - Reporter.Output.WriteLine( - string.Format(CommonLocalizableStrings.ProjectAddedToTheSolution, relativeProjectPath)); - } - } - - private void AddDefaultBuildConfigurations(SlnFile slnFile, SlnProject slnProject) - { - var defaultConfigurations = new List() - { - "Debug|Any CPU", - "Debug|x64", - "Debug|x86", - "Release|Any CPU", - "Release|x64", - "Release|x86", - }; - - // NOTE: The order you create the sections determines the order they are written to the sln - // file. In the case of an empty sln file, in order to make sure the solution configurations - // section comes first we need to add it first. This doesn't affect correctness but does - // stop VS from re-ordering things later on. Since we are keeping the SlnFile class low-level - // it shouldn't care about the VS implementation details. That's why we handle this here. - AddDefaultSolutionConfigurations(defaultConfigurations, slnFile.SolutionConfigurationsSection); - AddDefaultProjectConfigurations( - defaultConfigurations, - slnFile.ProjectConfigurationsSection.GetOrCreatePropertySet(slnProject.Id)); - } - - private void AddDefaultSolutionConfigurations( - List defaultConfigurations, - SlnPropertySet solutionConfigs) - { - foreach (var config in defaultConfigurations) - { - if (!solutionConfigs.ContainsKey(config)) - { - solutionConfigs[config] = config; - } - } - } - - private void AddDefaultProjectConfigurations( - List defaultConfigurations, - SlnPropertySet projectConfigs) - { - foreach (var config in defaultConfigurations) - { - var activeCfgKey = $"{config}.ActiveCfg"; - if (!projectConfigs.ContainsKey(activeCfgKey)) - { - projectConfigs[activeCfgKey] = config; - } - - var build0Key = $"{config}.Build.0"; - if (!projectConfigs.ContainsKey(build0Key)) - { - projectConfigs[build0Key] = config; - } - } - } - - private void AddSolutionFolders(SlnFile slnFile, SlnProject slnProject) - { - var solutionFolders = slnProject.GetSolutionFoldersFromProject(); - - if (solutionFolders.Any()) - { - var nestedProjectsSection = slnFile.Sections.GetOrCreateSection( - "NestedProjects", - SlnSectionType.PreProcess); - - var pathToGuidMap = GetSolutionFolderPaths(slnFile, nestedProjectsSection.Properties); - - string parentDirGuid = null; - var solutionFolderHierarchy = string.Empty; - foreach (var dir in solutionFolders) - { - solutionFolderHierarchy = Path.Combine(solutionFolderHierarchy, dir); - if (pathToGuidMap.ContainsKey(solutionFolderHierarchy)) - { - parentDirGuid = pathToGuidMap[solutionFolderHierarchy]; - } - else - { - var solutionFolder = new SlnProject - { - Id = Guid.NewGuid().ToString("B").ToUpper(), - TypeGuid = ProjectTypeGuids.SolutionFolderGuid, - Name = dir, - FilePath = dir - }; - - slnFile.Projects.Add(solutionFolder); - - if (parentDirGuid != null) - { - nestedProjectsSection.Properties[solutionFolder.Id] = parentDirGuid; - } - parentDirGuid = solutionFolder.Id; - } - } - - nestedProjectsSection.Properties[slnProject.Id] = parentDirGuid; - } - } - - private IDictionary GetSolutionFolderPaths(SlnFile slnFile, SlnPropertySet nestedProjects) - { - var solutionFolderPaths = new Dictionary(); - - var solutionFolderProjects = slnFile.Projects.GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid); - foreach (var slnProject in solutionFolderProjects) - { - var path = slnProject.FilePath; - var id = slnProject.Id; - while (nestedProjects.ContainsKey(id)) - { - id = nestedProjects[id]; - var parentSlnProject = solutionFolderProjects.Where(p => p.Id == id).Single(); - path = Path.Combine(parentSlnProject.FilePath, path); - } - - solutionFolderPaths[path] = slnProject.Id; - } - - return solutionFolderPaths; - } } } diff --git a/src/dotnet/commands/dotnet-sln/remove/Program.cs b/src/dotnet/commands/dotnet-sln/remove/Program.cs index 18f3866e5..c147052cd 100644 --- a/src/dotnet/commands/dotnet-sln/remove/Program.cs +++ b/src/dotnet/commands/dotnet-sln/remove/Program.cs @@ -48,12 +48,12 @@ namespace Microsoft.DotNet.Tools.Sln.Remove bool slnChanged = false; foreach (var path in relativeProjectPaths) { - slnChanged |= RemoveProject(slnFile, path); + slnChanged |= slnFile.RemoveProject(path); } - RemoveEmptyConfigurationSections(slnFile); + slnFile.RemoveEmptyConfigurationSections(); - RemoveEmptySolutionFolders(slnFile); + slnFile.RemoveEmptySolutionFolders(); if (slnChanged) { @@ -62,120 +62,5 @@ namespace Microsoft.DotNet.Tools.Sln.Remove return 0; } - - private bool RemoveProject(SlnFile slnFile, string projectPath) - { - var projectPathNormalized = PathUtility.GetPathWithDirectorySeparator(projectPath); - - var projectsToRemove = slnFile.Projects.Where((p) => - string.Equals(p.FilePath, projectPathNormalized, StringComparison.OrdinalIgnoreCase)).ToList(); - - bool projectRemoved = false; - if (projectsToRemove.Count == 0) - { - Reporter.Output.WriteLine(string.Format( - CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, - projectPath)); - } - else - { - foreach (var slnProject in projectsToRemove) - { - var buildConfigsToRemove = slnFile.ProjectConfigurationsSection.GetPropertySet(slnProject.Id); - if (buildConfigsToRemove != null) - { - slnFile.ProjectConfigurationsSection.Remove(buildConfigsToRemove); - } - - var nestedProjectsSection = slnFile.Sections.GetSection( - "NestedProjects", - SlnSectionType.PreProcess); - if (nestedProjectsSection != null && nestedProjectsSection.Properties.ContainsKey(slnProject.Id)) - { - nestedProjectsSection.Properties.Remove(slnProject.Id); - } - - slnFile.Projects.Remove(slnProject); - Reporter.Output.WriteLine( - string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, slnProject.FilePath)); - } - - projectRemoved = true; - } - - return projectRemoved; - } - - private void RemoveEmptyConfigurationSections(SlnFile slnFile) - { - if (slnFile.Projects.Count == 0) - { - var solutionConfigs = slnFile.Sections.GetSection("SolutionConfigurationPlatforms"); - if (solutionConfigs != null) - { - slnFile.Sections.Remove(solutionConfigs); - } - - var projectConfigs = slnFile.Sections.GetSection("ProjectConfigurationPlatforms"); - if (projectConfigs != null) - { - slnFile.Sections.Remove(projectConfigs); - } - } - } - - private void RemoveEmptySolutionFolders(SlnFile slnFile) - { - var solutionFolderProjects = slnFile.Projects - .GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid) - .ToList(); - - if (solutionFolderProjects.Any()) - { - var nestedProjectsSection = slnFile.Sections.GetSection( - "NestedProjects", - SlnSectionType.PreProcess); - - var solutionFoldersInUse = GetSolutionFoldersThatContainProjectsInItsHierarchy( - slnFile, - nestedProjectsSection.Properties); - - foreach (var solutionFolderProject in solutionFolderProjects) - { - if (!solutionFoldersInUse.Contains(solutionFolderProject.Id)) - { - slnFile.Projects.Remove(solutionFolderProject); - nestedProjectsSection.Properties.Remove(solutionFolderProject.Id); - } - } - - if (nestedProjectsSection.IsEmpty) - { - slnFile.Sections.Remove(nestedProjectsSection); - } - } - } - - private HashSet GetSolutionFoldersThatContainProjectsInItsHierarchy( - SlnFile slnFile, - SlnPropertySet nestedProjects) - { - var solutionFoldersInUse = new HashSet(); - - var nonSolutionFolderProjects = slnFile.Projects.GetProjectsNotOfType( - ProjectTypeGuids.SolutionFolderGuid); - - foreach (var nonSolutionFolderProject in nonSolutionFolderProjects) - { - var id = nonSolutionFolderProject.Id; - while (nestedProjects.ContainsKey(id)) - { - id = nestedProjects[id]; - solutionFoldersInUse.Add(id); - } - } - - return solutionFoldersInUse; - } } } diff --git a/src/dotnet/dotnet.csproj b/src/dotnet/dotnet.csproj index c2f1a9fad..915e1a36b 100755 --- a/src/dotnet/dotnet.csproj +++ b/src/dotnet/dotnet.csproj @@ -3,13 +3,13 @@ $(CliVersionPrefix) - netcoreapp1.0 + netcoreapp1.1 dotnet Exe ../../tools/Key.snk true true - $(PackageTargetFallback);dotnet5.4 + $(PackageTargetFallback);dotnet5.4 @@ -32,44 +32,44 @@ 9.0.1 - 4.0.1 + 4.3.0 - 4.0.0 + 4.3.0 2.0.0 - 1.0.3 + 1.1.0 - 4.0.0 + 4.3.0 - 4.0.0 + 4.3.0 - 4.0.0 + 4.3.0 - 4.1.1 + 4.3.0 - 4.1.1 + 4.3.0 - 4.1.0 + 4.3.0 - 4.0.0 + 4.3.0 Analyzers;Build;ContentFiles;Native;Runtime $(CLI_MSBuild_Version) - 1.0.1-beta-000933 + 1.1.0 diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index 02884fadb..c74807583 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -3,13 +3,13 @@ $(CliVersionPrefix) - netcoreapp1.0 + netcoreapp1.1 true - $(PackageTargetFallback);dotnet5.4 + $(PackageTargetFallback);dotnet5.4 - 1.0.3 + 1.1.0 $(CLI_MSBuild_Version) @@ -24,7 +24,7 @@ $(CLI_TestPlatform_Version) - + diff --git a/src/tool_msbuild/tool_msbuild.csproj b/src/tool_msbuild/tool_msbuild.csproj index 40082b920..006bbeec2 100644 --- a/src/tool_msbuild/tool_msbuild.csproj +++ b/src/tool_msbuild/tool_msbuild.csproj @@ -3,11 +3,11 @@ $(CliVersionPrefix) - netcoreapp1.0 + netcoreapp1.1 - 1.0.3 + 1.1.0 $(CLI_MSBuild_Version) diff --git a/src/tool_nuget/tool_nuget.csproj b/src/tool_nuget/tool_nuget.csproj index a9163b695..163953ae9 100644 --- a/src/tool_nuget/tool_nuget.csproj +++ b/src/tool_nuget/tool_nuget.csproj @@ -3,11 +3,11 @@ $(CliVersionPrefix) - netcoreapp1.0 + netcoreapp1.1 - 1.0.3 + 1.1.0 $(CLI_NuGet_Version) diff --git a/src/tool_roslyn/tool_roslyn.csproj b/src/tool_roslyn/tool_roslyn.csproj index 3f52caad6..d02092146 100644 --- a/src/tool_roslyn/tool_roslyn.csproj +++ b/src/tool_roslyn/tool_roslyn.csproj @@ -4,15 +4,15 @@ $(CliVersionPrefix) - netcoreapp1.0 + netcoreapp1.1 true - + - + @@ -37,14 +37,18 @@ AfterTargets="Publish" BeforeTargets="RemoveFilesAfterPublish"> - - + + + - + SectionName="%(AssetsToRemoveFromDeps.SectionName)" + AssetPath="%(AssetsToRemoveFromDeps.Identity)" /> + - netcoreapp1.0 + netcoreapp1.1 ArgumentForwardingTests Exe - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -33,16 +33,16 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 - 1.0.1-beta-000933 + 1.1.0 diff --git a/test/ArgumentsReflector/ArgumentsReflector.csproj b/test/ArgumentsReflector/ArgumentsReflector.csproj index 18b1c199a..85e00819d 100644 --- a/test/ArgumentsReflector/ArgumentsReflector.csproj +++ b/test/ArgumentsReflector/ArgumentsReflector.csproj @@ -2,9 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 ArgumentsReflector Exe + netcoreapp1.1 @@ -16,7 +17,13 @@ - 1.0.3 + 1.1.0 + + + $(CLI_Roslyn_Version) + + + $(CLI_Roslyn_Version) diff --git a/test/EndToEnd/EndToEnd.csproj b/test/EndToEnd/EndToEnd.csproj index 5949bf3bc..07404de4c 100644 --- a/test/EndToEnd/EndToEnd.csproj +++ b/test/EndToEnd/EndToEnd.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 EndToEnd Exe - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -40,10 +40,10 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 @@ -52,7 +52,7 @@ 1.0.0-prerelease-00206 - 1.0.1-beta-000933 + 1.1.0 diff --git a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj b/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj index 6b5dc5ebd..339fbd222 100644 --- a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj +++ b/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj @@ -2,13 +2,13 @@ - netcoreapp1.0 + netcoreapp1.1 true Microsoft.DotNet.Cli.Sln.Internal.Tests ../../tools/test_key.snk true true - $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 @@ -21,7 +21,7 @@ - 1.0.3 + 1.1.0 $(CLI_TestPlatform_Version) @@ -33,7 +33,7 @@ 2.2.0-beta4-build1194 - 4.0.0 + 4.18.0 \ No newline at end of file diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs index 26640ab59..be5c756b6 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs @@ -282,7 +282,7 @@ namespace Microsoft.DotNet.Tests result.Should().NotBeNull(); - result.Args.Should().Contain("--fx-version 1.0.3"); + result.Args.Should().Contain("--fx-version 1.1.0"); } [Fact] diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj b/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj index 479ce5be6..9e1e3201d 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj @@ -2,13 +2,13 @@ - netcoreapp1.0 + netcoreapp1.1 Microsoft.DotNet.Cli.Utils.Tests Exe ../../tools/Key.snk true true - $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 @@ -48,13 +48,13 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.0.0 + 4.3.0 - 4.1.1 + 4.3.0 $(CLI_NuGet_Version) @@ -75,7 +75,7 @@ 2.2.0-beta4-build3444 - 1.0.1-beta-000933 + 1.1.0 $(CLI_MSBuild_Version) diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj b/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj index f4d56da4e..793b249b9 100644 --- a/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj +++ b/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj @@ -2,13 +2,13 @@ - netcoreapp1.0 + netcoreapp1.1 true Microsoft.DotNet.Configurer.UnitTests ../../tools/Key.snk true true - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -40,13 +40,13 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.0.0 + 4.3.0 - 4.0.0 + 4.18.0 4.4.0-beta8 diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenAProjectMigrator.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenAProjectMigrator.cs index d15de0265..e6ca62262 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenAProjectMigrator.cs +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenAProjectMigrator.cs @@ -6,6 +6,7 @@ using FluentAssertions; using Microsoft.Build.Construction; using Microsoft.DotNet.ProjectJsonMigration.Rules; using Microsoft.DotNet.Internal.ProjectModel; +using Microsoft.DotNet.TestFramework; using Microsoft.DotNet.Tools.Common; using Microsoft.DotNet.Tools.Test.Utilities; using NuGet.Frameworks; @@ -39,24 +40,54 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests } [Fact] - public void ItHasErrorWhenMigratingADeprecatedProjectJson() + public void ItHasWarningWhenMigratingADeprecatedProjectJson() { - var testProjectDirectory = - TestAssetsManager.CreateTestInstance("TestLibraryWithDeprecatedProjectFile", callingMethod: "z") - .Path; + var testProjectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompileOptions") + .CreateInstance() + .WithSourceFiles() + .Root + .GetDirectory("project") + .FullName; var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(testProjectDirectory, testProjectDirectory, mockProj); + var testSettings = MigrationSettings.CreateMigrationSettingsTestHook( + testProjectDirectory, + testProjectDirectory, + mockProj); var projectMigrator = new ProjectMigrator(new FakeEmptyMigrationRule()); var report = projectMigrator.Migrate(testSettings); var projectReport = report.ProjectMigrationReports.First(); + var warningMessage = projectReport.Warnings.First(); + warningMessage.Should().Contain("MIGRATE1011::Deprecated Project:"); + warningMessage.Should().Contain("The 'compile' option is deprecated. Use 'compile' in 'buildOptions' instead. (line: 3, file:"); + } + [Fact] + public void ItHasErrorWhenMigratingADeprecatedNamedResourceOptionProjectJson() + { + var testProjectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedNamedResourceOption") + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + var mockProj = ProjectRootElement.Create(); + var testSettings = MigrationSettings.CreateMigrationSettingsTestHook( + testProjectDirectory, + testProjectDirectory, + mockProj); + + var projectMigrator = new ProjectMigrator(new FakeEmptyMigrationRule()); + var report = projectMigrator.Migrate(testSettings); + + var projectReport = report.ProjectMigrationReports.First(); var errorMessage = projectReport.Errors.First().GetFormattedErrorMessage(); errorMessage.Should().Contain("MIGRATE1011::Deprecated Project:"); - errorMessage.Should().Contain("The 'packInclude' option is deprecated. Use 'files' in 'packOptions' instead. (line: 6, file:"); - errorMessage.Should().Contain("The 'compilationOptions' option is deprecated. Use 'buildOptions' instead. (line: 3, file:"); + errorMessage.Should().Contain("The 'namedResource' option is deprecated. Use 'embed' in 'buildOptions' instead. (line: 3, file:"); } [Fact] diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Microsoft.DotNet.ProjectJsonMigration.Tests.csproj b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Microsoft.DotNet.ProjectJsonMigration.Tests.csproj index 9732db55b..0b76dd001 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Microsoft.DotNet.ProjectJsonMigration.Tests.csproj +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Microsoft.DotNet.ProjectJsonMigration.Tests.csproj @@ -2,13 +2,13 @@ - netcoreapp1.0 + netcoreapp1.1 true Microsoft.DotNet.ProjectJsonMigration.Tests ../../tools/test_key.snk true true - $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 @@ -44,13 +44,13 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 2.2.0-beta4-build3444 - 4.0.0 + 4.18.0 4.4.0-beta8 diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackageDependencies.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackageDependencies.cs index 3067b567a..755abacde 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackageDependencies.cs +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackageDependencies.cs @@ -435,50 +435,5 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests mockProj.Items.Should().ContainSingle( i => (i.Include == "NETStandard.Library" && i.ItemType == "PackageReference")); } - - new private void EmitsPackageReferences(ProjectRootElement mockProj, params Tuple[] packageSpecs) - { - foreach (var packageSpec in packageSpecs) - { - var packageName = packageSpec.Item1; - var packageVersion = packageSpec.Item2; - var packageTFM = packageSpec.Item3; - - var items = mockProj.Items - .Where(i => i.ItemType == "PackageReference") - .Where(i => string.IsNullOrEmpty(packageTFM) || i.ConditionChain().Any(c => c.Contains(packageTFM))) - .Where(i => i.Include == packageName) - .Where(i => i.GetMetadataWithName("Version").Value == packageVersion && - i.GetMetadataWithName("Version").ExpressedAsAttribute); - - items.Should().HaveCount(1); - } - } - - new private void EmitsToolReferences(ProjectRootElement mockProj, params Tuple[] toolSpecs) - { - foreach (var toolSpec in toolSpecs) - { - var packageName = toolSpec.Item1; - var packageVersion = toolSpec.Item2; - - var items = mockProj.Items - .Where(i => i.ItemType == "DotNetCliToolReference") - .Where(i => i.Include == packageName) - .Where(i => i.GetMetadataWithName("Version").Value == packageVersion && - i.GetMetadataWithName("Version").ExpressedAsAttribute); - - items.Should().HaveCount(1); - } - } - - new private ProjectRootElement RunPackageDependenciesRuleOnPj(string s, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigratePackageDependenciesAndToolsRule() - }, s, testDirectory); - } } } \ No newline at end of file diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/PackageDependenciesTestBase.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/PackageDependenciesTestBase.cs index e0eb3a99e..9a5526646 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/PackageDependenciesTestBase.cs +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/PackageDependenciesTestBase.cs @@ -24,7 +24,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests .Where(i => i.ItemType == "PackageReference") .Where(i => string.IsNullOrEmpty(packageTFM) || i.ConditionChain().Any(c => c.Contains(packageTFM))) .Where(i => i.Include == packageName) - .Where(i => i.GetMetadataWithName("Version").Value == packageVersion); + .Where(i => i.GetMetadataWithName("Version").Value == packageVersion && + i.GetMetadataWithName("Version").ExpressedAsAttribute); items.Should().HaveCount(1); } @@ -40,7 +41,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests var items = mockProj.Items .Where(i => i.ItemType == "DotNetCliToolReference") .Where(i => i.Include == packageName) - .Where(i => i.GetMetadataWithName("Version").Value == packageVersion); + .Where(i => i.GetMetadataWithName("Version").Value == packageVersion && + i.GetMetadataWithName("Version").ExpressedAsAttribute); items.Should().HaveCount(1); } @@ -48,7 +50,10 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests protected ProjectRootElement RunPackageDependenciesRuleOnPj(string s, string testDirectory = null) { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; + testDirectory = + testDirectory ?? + Temp.CreateDirectory().DirectoryInfo.CreateSubdirectory("project").FullName; + return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] { new MigratePackageDependenciesAndToolsRule() diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/TemporaryProjectFileRuleRunner.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/TemporaryProjectFileRuleRunner.cs index f574e26a6..e8b7484ed 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/TemporaryProjectFileRuleRunner.cs +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/TemporaryProjectFileRuleRunner.cs @@ -3,7 +3,9 @@ using System.Linq; using Microsoft.Build.Construction; using Microsoft.DotNet.ProjectJsonMigration.Rules; using Microsoft.DotNet.Internal.ProjectModel; +using Microsoft.DotNet.TestFramework; using NuGet.Frameworks; +using System.IO; namespace Microsoft.DotNet.ProjectJsonMigration.Tests { @@ -23,6 +25,21 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests string projectDirectory, string json) { + + var globalJson = Path.Combine(new DirectoryInfo(projectDirectory).Parent.FullName, "global.json"); + if (!File.Exists(globalJson)) + { + var file = new FileInfo(globalJson); + try + { + File.WriteAllText(file.FullName, @"{}"); + } + catch (IOException) + { + //this means there is someone else writing to the file already. So, just ignore it. + } + } + var testPj = new ProjectJsonBuilder(null) .FromStringBase(json) .SaveToDisk(projectDirectory); diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj b/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj index 32a322248..3f4dfe997 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj @@ -3,13 +3,13 @@ Microsoft.DotNet.Tools.Tests.Utilities Class Library - netcoreapp1.0 + netcoreapp1.1 true Microsoft.DotNet.Tools.Tests.Utilities ../../tools/Key.snk true true - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -21,13 +21,19 @@ 1.6.0 - 4.0.0 + 4.18.0 + + + 1.1.0 + + + 4.3.0 2.2.0-beta4-build3444 - 1.0.1-beta-000933 + 1.1.0 diff --git a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj index 9982648ea..91dbcc61a 100644 --- a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj +++ b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true Msbuild.Tests.Utilities - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -31,10 +31,10 @@ 1.6.0 - 4.1.1 + 4.3.0 - 4.0.0 + 4.18.0 2.2.0-beta4-build3444 diff --git a/test/Performance/Performance.csproj b/test/Performance/Performance.csproj new file mode 100644 index 000000000..7c295a2be --- /dev/null +++ b/test/Performance/Performance.csproj @@ -0,0 +1,55 @@ + + + + + netcoreapp1.1 + true + Performance + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + + + + + + + true + + + true + + + + + + true + + + + + + 15.0.0-preview-20161024-02 + + + 2.2.0-beta4-build1194 + + + 1.1.0 + + + 4.3.0 + + + 2.2.0-beta4-build3444 + + + 1.0.0-prerelease-00206 + + + 1.0.0-alpha-build0028 + + + + + $(DefineConstants);RELEASE + + diff --git a/test/binding-redirects.Tests/binding-redirects.Tests.csproj b/test/binding-redirects.Tests/binding-redirects.Tests.csproj index 9b619c83f..5e1b681d2 100644 --- a/test/binding-redirects.Tests/binding-redirects.Tests.csproj +++ b/test/binding-redirects.Tests/binding-redirects.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true binding-redirects.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -13,10 +13,10 @@ - + - + diff --git a/test/crossgen.Tests/crossgen.Tests.csproj b/test/crossgen.Tests/crossgen.Tests.csproj index 657fc9dbc..c5d314cde 100644 --- a/test/crossgen.Tests/crossgen.Tests.csproj +++ b/test/crossgen.Tests/crossgen.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true crossgen.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -33,7 +33,7 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj b/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj index 6a052db05..63c5eff1c 100644 --- a/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj +++ b/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj @@ -2,7 +2,7 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-add-package.Tests $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -17,7 +17,7 @@ - + diff --git a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj b/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj index 09141e8e2..d7072a465 100644 --- a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj +++ b/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-add-reference.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -36,10 +36,10 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-build.Tests/dotnet-build.Tests.csproj b/test/dotnet-build.Tests/dotnet-build.Tests.csproj index 3efad2804..10a181763 100644 --- a/test/dotnet-build.Tests/dotnet-build.Tests.csproj +++ b/test/dotnet-build.Tests/dotnet-build.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-build.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -35,10 +35,10 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-help.Tests/dotnet-help.Tests.csproj b/test/dotnet-help.Tests/dotnet-help.Tests.csproj index a9b94fe86..0b2aea8f7 100644 --- a/test/dotnet-help.Tests/dotnet-help.Tests.csproj +++ b/test/dotnet-help.Tests/dotnet-help.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-help.Tests - $(PackageTargetFallback);dnxcore50;portable-net45+win8 + $(PackageTargetFallback);dnxcore50;portable-net45+win8 @@ -40,7 +40,7 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 $(CLI_MSBuild_Version) diff --git a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj b/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj index e3c8454f4..4fbc41e22 100644 --- a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj +++ b/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-list-reference.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -36,16 +36,16 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 - 4.0.0 + 4.18.0 diff --git a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateDeprecatedProjects.cs b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateDeprecatedProjects.cs new file mode 100644 index 000000000..c80911fc7 --- /dev/null +++ b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateDeprecatedProjects.cs @@ -0,0 +1,546 @@ +// 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 FluentAssertions; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Xml.Linq; +using Xunit; + +namespace Microsoft.DotNet.Migration.Tests +{ + public class GivenThatIWantToMigrateDeprecatedProjects : TestBase + { + [Fact] + public void WhenMigratingAProjectWithDeprecatedPackOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedPackOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'repository' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'projectUrl' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'licenseUrl' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'iconUrl' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'owners' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'tags' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'releaseNotes' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'requireLicenseAcceptance' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'summary' option in the root is deprecated. Use it in 'packOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'packInclude' option is deprecated. Use 'files' in 'packOptions' instead."); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedPackOptionsItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedPackOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("build -c Debug") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("pack -c Debug") + .Should().Pass(); + + var outputDir = projectDirectory.GetDirectory("bin", "Debug"); + outputDir.Should().Exist() + .And.HaveFile("PJAppWithDeprecatedPackOptions.1.0.0.nupkg"); + + var outputPackage = outputDir.GetFile("PJAppWithDeprecatedPackOptions.1.0.0.nupkg"); + + var zip = ZipFile.Open(outputPackage.FullName, ZipArchiveMode.Read); + zip.Entries.Should().Contain(e => e.FullName == "PJAppWithDeprecatedPackOptions.nuspec") + .And.Contain(e => e.FullName == "content/Content1.txt") + .And.Contain(e => e.FullName == "content/Content2.txt"); + + var manifestReader = new StreamReader( + zip.Entries.First(e => e.FullName == "PJAppWithDeprecatedPackOptions.nuspec").Open()); + + // NOTE: Commented out those that are not migrated. + // https://microsoft.sharepoint.com/teams/netfx/corefx/_layouts/15/WopiFrame.aspx?sourcedoc=%7B0cfbc196-0645-4781-84c6-5dffabd76bee%7D&action=edit&wd=target%28Planning%2FMSBuild%20CLI%20integration%2Eone%7C41D470DD-CF44-4595-8E05-0CE238864B55%2FProject%2Ejson%20Migration%7CA553D979-EBC6-484B-A12E-036E0730864A%2F%29 + var nuspecXml = XDocument.Parse(manifestReader.ReadToEnd()); + nuspecXml.Descendants().Single(e => e.Name.LocalName == "projectUrl").Value + .Should().Be("http://projecturl/"); + nuspecXml.Descendants().Single(e => e.Name.LocalName == "licenseUrl").Value + .Should().Be("http://licenseurl/"); + nuspecXml.Descendants().Single(e => e.Name.LocalName == "iconUrl").Value + .Should().Be("http://iconurl/"); + //nuspecXml.Descendants().Single(e => e.Name.LocalName == "owners").Value + // .Should().Be("owner1,owner2"); + nuspecXml.Descendants().Single(e => e.Name.LocalName == "tags").Value + .Should().Be("tag1 tag2"); + nuspecXml.Descendants().Single(e => e.Name.LocalName == "releaseNotes").Value + .Should().Be("releaseNotes"); + nuspecXml.Descendants().Single(e => e.Name.LocalName == "requireLicenseAcceptance").Value + .Should().Be("true"); + //nuspecXml.Descendants().Single(e => e.Name.LocalName == "summary").Value + // .Should().Be("summary"); + + var repositoryNode = nuspecXml.Descendants().Single(e => e.Name.LocalName == "repository"); + repositoryNode.Attributes("type").Single().Value.Should().Be("git"); + repositoryNode.Attributes("url").Single().Value.Should().Be("http://url/"); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedCompilationOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompilationOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'compilerName' option in the root is deprecated. Use it in 'buildOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'compilationOptions' option is deprecated. Use 'buildOptions' instead."); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedCompilationOptionsItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompilationOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("build -c Debug") + .Should().Pass(); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedContentOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedContentOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'content' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); + cmd.StdOut.Should().Contain( + "The 'contentExclude' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); + cmd.StdOut.Should().Contain( + "The 'contentFiles' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); + cmd.StdOut.Should().Contain( + "The 'contentBuiltIn' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedContentOptionsItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedContentOptions") + .CreateInstance() + .WithSourceFiles() + .Root + .GetDirectory("project"); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("build -c Debug") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("publish -c Debug") + .Should().Pass(); + + var outputDir = projectDirectory.GetDirectory("bin", "Debug", "netcoreapp1.0"); + outputDir.Should().Exist() + .And.HaveFiles(new[] + { + "ContentFile1.txt", + "ContentFile2.txt", + "ContentFileBuiltIn1.txt", + "ContentFileBuiltIn2.txt", + "IncludeThis.txt", + }); + Directory.Exists(Path.Combine(outputDir.FullName, "ExcludeThis1.txt")).Should().BeFalse(); + Directory.Exists(Path.Combine(outputDir.FullName, "ExcludeThis2.txt")).Should().BeFalse(); + + var publishDir = projectDirectory.GetDirectory("bin", "Debug", "netcoreapp1.0", "publish"); + publishDir.Should().Exist() + .And.HaveFiles(new[] + { + "ContentFile1.txt", + "ContentFile2.txt", + "ContentFileBuiltIn1.txt", + "ContentFileBuiltIn2.txt", + "IncludeThis.txt", + }); + Directory.Exists(Path.Combine(publishDir.FullName, "ExcludeThis1.txt")).Should().BeFalse(); + Directory.Exists(Path.Combine(publishDir.FullName, "ExcludeThis2.txt")).Should().BeFalse(); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedCompileOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompileOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'compile' option is deprecated. Use 'compile' in 'buildOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'compileFiles' option is deprecated. Use 'compile' in 'buildOptions' instead."); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedCompileOptionsItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompileOptions") + .CreateInstance() + .WithSourceFiles() + .Root + .GetDirectory("project"); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("build -c Debug") + .Should().Pass(); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedCompileBuiltInOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompileBuiltInOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'compileBuiltIn' option is deprecated. Use 'compile' in 'buildOptions' instead."); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedCompileBuiltInOptionsItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompileBuiltInOptions") + .CreateInstance() + .WithSourceFiles() + .Root + .GetDirectory("project"); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + //Issue: https://github.com/dotnet/cli/issues/5467 + //new DotnetCommand() + // .WithWorkingDirectory(projectDirectory) + // .Execute("build -c Debug") + // .Should().Pass(); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedCompileExcludeOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompileExcludeOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'compileExclude' option is deprecated. Use 'compile' in 'buildOptions' instead."); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedCompileExcludeOptionsItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedCompileExcludeOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + // Issue: https://github.com/dotnet/cli/issues/5461 + //new DotnetCommand() + // .WithWorkingDirectory(projectDirectory) + // .Execute("build -c Debug") + // .Should().Pass(); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedResourceOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedResourceOptions") + .CreateInstance() + .WithSourceFiles() + .Root + .GetDirectory("project"); + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'resource' option is deprecated. Use 'embed' in 'buildOptions' instead."); + cmd.StdOut.Should().Contain( + "The 'resourceFiles' option is deprecated. Use 'embed' in 'buildOptions' instead."); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedResourceOptionsItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedResourceOptions") + .CreateInstance() + .WithSourceFiles() + .Root + .GetDirectory("project"); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("build -c Debug") + .Should().Pass(); + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("run -c Debug"); + cmd.Should().Pass(); + cmd.StdOut.Should().Contain("3 Resources Found:"); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedResourceBuiltInOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedResourceBuiltInOptions") + .CreateInstance() + .WithSourceFiles() + .Root + .GetDirectory("project"); + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'resourceBuiltIn' option is deprecated. Use 'embed' in 'buildOptions' instead."); + } + + [Fact] + public void WhenMigratingDeprecatedBuiltInResItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedResourceBuiltInOptions") + .CreateInstance() + .WithSourceFiles() + .Root + .GetDirectory("project"); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("build -c Debug") + .Should().Pass(); + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("run -c Debug"); + cmd.Should().Pass(); + // Issue: https://github.com/dotnet/cli/issues/5467 + //cmd.StdOut.Should().Contain("2 Resources Found:"); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedResourceExcludeOptionsWarningsArePrinted() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedResourceExcludeOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput("migrate"); + + cmd.Should().Pass(); + + cmd.StdOut.Should().Contain( + "The 'resourceExclude' option is deprecated. Use 'embed' in 'buildOptions' instead."); + } + + [Fact] + public void WhenMigratingAProjectWithDeprecatedResourceExcludeOptionsItSucceeds() + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithDeprecatedResourceExcludeOptions") + .CreateInstance() + .WithSourceFiles() + .Root; + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("migrate") + .Should().Pass(); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute("restore") + .Should().Pass(); + + // Issue: https://github.com/dotnet/cli/issues/5461 + //new DotnetCommand() + // .WithWorkingDirectory(projectDirectory) + // .Execute("build -c Debug") + // .Should().Pass(); + + //var cmd = new DotnetCommand() + // .WithWorkingDirectory(projectDirectory) + // .ExecuteWithCapturedOutput("run -c Debug"); + //cmd.Should().Pass(); + //cmd.StdOut.Should().Contain("0 Resources Found:"); + } + } +} diff --git a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs index 095518dae..330baa6e0 100644 --- a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs +++ b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs @@ -28,6 +28,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, projectName) .CreateInstance(identifier: projectName) .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var solutionRelPath = "TestApp.sln"; @@ -58,6 +59,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithSlnAndXprojRefs") .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); @@ -103,6 +105,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("NonRestoredTestProjects", "PJAppWithSlnAndOneAlreadyMigratedCsproj") .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); @@ -136,6 +139,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithSlnAndOneAlreadyMigratedCsproj") .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); @@ -149,12 +153,96 @@ namespace Microsoft.DotNet.Migration.Tests cmd.StdErr.Should().BeEmpty(); } + [Theory] + [InlineData("NoSolutionItemsAfterMigration.sln", false)] + [InlineData("ReadmeSolutionItemAfterMigration.sln", true)] + public void WhenMigratingAnSlnLinksReferencingItemsMovedToBackupAreRemoved( + string slnFileName, + bool solutionItemsContainsReadme) + { + var projectDirectory = TestAssets + .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithSlnAndSolutionItemsToMoveToBackup") + .CreateInstance(Path.GetFileNameWithoutExtension(slnFileName)) + .WithSourceFiles() + .Root + .FullName; + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute($"migrate \"{slnFileName}\"") + .Should().Pass(); + + var slnFile = SlnFile.Read(Path.Combine(projectDirectory, slnFileName)); + var solutionFolders = slnFile.Projects.Where(p => p.TypeGuid == ProjectTypeGuids.SolutionFolderGuid); + if (solutionItemsContainsReadme) + { + solutionFolders.Count().Should().Be(1); + var solutionItems = solutionFolders.Single().Sections.GetSection("SolutionItems"); + solutionItems.Should().NotBeNull(); + solutionItems.Properties.Count().Should().Be(1); + solutionItems.Properties["readme.txt"].Should().Be("readme.txt"); + } + else + { + solutionFolders.Count().Should().Be(0); + } + } + + [Fact] + public void ItMigratesSolutionInTheFolderWhenWeRunMigrationInThatFolder() + { + var projectDirectory = TestAssets + .Get("NonRestoredTestProjects", "PJAppWithSlnAndXprojRefs") + .CreateInstance() + .WithSourceFiles() + .WithEmptyGlobalJson() + .Root; + + var workingDirectory = new DirectoryInfo(Path.Combine(projectDirectory.FullName, "TestApp")); + var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); + + new DotnetCommand() + .WithWorkingDirectory(workingDirectory) + .Execute($"migrate") + .Should().Pass(); + + SlnFile slnFile = SlnFile.Read(Path.Combine(projectDirectory.FullName, solutionRelPath)); + + var nonSolutionFolderProjects = slnFile.Projects + .Where(p => p.TypeGuid != ProjectTypeGuids.SolutionFolderGuid); + + nonSolutionFolderProjects.Count().Should().Be(4); + + var slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "TestApp").Single(); + slnProject.TypeGuid.Should().Be(ProjectTypeGuids.CSharpProjectTypeGuid); + slnProject.FilePath.Should().Be("TestApp.csproj"); + + slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "TestLibrary").Single(); + slnProject.TypeGuid.Should().Be(ProjectTypeGuids.CSharpProjectTypeGuid); + slnProject.FilePath.Should().Be(Path.Combine("..", "TestLibrary", "TestLibrary.csproj")); + + slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "subdir").Single(); + slnProject.FilePath.Should().Be(Path.Combine("src", "subdir", "subdir.csproj")); + + new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute($"restore \"{solutionRelPath}\"") + .Should().Pass(); + + //ISSUE: https://github.com/dotnet/cli/issues/5205 + //new DotnetCommand() + // .WithWorkingDirectory(projectDirectory) + // .Execute($"build \"{solutionRelPath}\"") + // .Should().Pass(); + } + private void MigrateAndBuild(string groupName, string projectName, [CallerMemberName] string callingMethod = "", string identifier = "") { var projectDirectory = TestAssets .Get(groupName, projectName) .CreateInstance(callingMethod: callingMethod, identifier: identifier) .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); diff --git a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateTestApps.cs b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateTestApps.cs index c569c6cc6..b2a51bf2b 100644 --- a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateTestApps.cs +++ b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateTestApps.cs @@ -34,6 +34,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance(identifier: projectName) .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; CleanBinObj(projectDirectory); @@ -68,6 +69,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance(identifier: projectName) .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; CleanBinObj(projectDirectory); @@ -87,6 +89,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance() .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; CleanBinObj(projectDirectory); @@ -115,6 +118,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("ProjectJsonConsoleTemplate") .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var outputComparisonData = GetComparisonData(projectDirectory); @@ -140,6 +144,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance() .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; var globalDirectory = projectDirectory.Parent; @@ -168,6 +173,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson(projectName) .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; File.Copy("NuGet.tempaspnetpatch.config", projectDirectory.GetFile("NuGet.Config").FullName); @@ -185,6 +191,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("AppWithPackageNamedAfterFolder") .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var appProject = solutionDirectory @@ -209,6 +216,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("TestAppDependencyGraph") .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; MigrateProject(projectDirectory.GetDirectory(dependencyProject).FullName); @@ -224,6 +232,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance() .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; var globalDirectory = projectDirectory.Parent; @@ -245,6 +254,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance(identifier: projectName) .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName); @@ -270,6 +280,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance(identifier: projectName) .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName); @@ -296,6 +307,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance(identifier: projectName) .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild( @@ -326,6 +338,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("TestAppDependencyGraph") .CreateInstance(identifier: $"{projectName}.RefsTest") .WithSourceFiles() + .WithEmptyGlobalJson() .Root; MigrateProject(new [] { projectDirectory.GetDirectory(projectName).FullName }); @@ -347,6 +360,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("TestAppDependencyGraph") .CreateInstance($"{projectName}.SkipRefsTest") .WithSourceFiles() + .WithEmptyGlobalJson() .Root; MigrateProject(new [] { projectDirectory.GetDirectory(projectName).FullName, "--skip-project-references" }); @@ -363,6 +377,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("TestAppDependencyGraph") .CreateInstance(callingMethod: $"MigrateDirectory.SkipRefs.{skipRefs}") .WithSourceFiles() + .WithEmptyGlobalJson() .Root; if (skipRefs) @@ -386,6 +401,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("TestAppDependencyGraph") .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var project = projectDirectory @@ -408,6 +424,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance() .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; var projectDirectory = assetsDir.GetDirectory("ProjectF"); @@ -443,6 +460,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance(identifier: projectNameSuffix) .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; var projectName = $"Project{projectNameSuffix}"; @@ -532,6 +550,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance() .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; CleanBinObj(projectDirectory); @@ -551,6 +570,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance() .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; CleanBinObj(projectDirectory); @@ -570,6 +590,7 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson("TestAppDependencyGraph") .CreateInstance() .WithSourceFiles() + .WithEmptyGlobalJson() .Root; var projectDirectory = solutionDirectory.GetDirectory(projectName); @@ -594,6 +615,7 @@ namespace Microsoft.DotNet.Migration.Tests .CreateInstance() .WithSourceFiles() .WithRestoreFiles() + .WithEmptyGlobalJson() .Root; var expectedCsprojPath = projectDirectory.GetFile($"{projectName}.csproj"); @@ -634,6 +656,21 @@ namespace Microsoft.DotNet.Migration.Tests .GetProjectJson(projectName) .CreateInstance(identifier: projectName) .WithSourceFiles() + .WithEmptyGlobalJson() + .Root; + + MigrateProject(projectDirectory.FullName); + Restore(projectDirectory, projectName); + BuildMSBuild(projectDirectory, projectName); + } + + [Fact] + public void ItMigratesAndBuildsAppWithExplicitIncludeGlob() + { + const string projectName = "TestAppWithExplicitIncludeGlob"; + var projectDirectory = TestAssets.Get(projectName) + .CreateInstance() + .WithSourceFiles() .Root; MigrateProject(projectDirectory.FullName); diff --git a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj index 3dc1cb000..64e43d38a 100644 --- a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj +++ b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-migrate.Tests - $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 @@ -48,13 +48,13 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 2.2.0-beta4-build3444 - 4.0.0 + 4.18.0 4.4.0-beta8 diff --git a/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj b/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj index 7907fe5be..a601acd01 100644 --- a/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj +++ b/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-msbuild.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -46,7 +46,7 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 4.1.1 diff --git a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs index 80aed33d3..00621c34a 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs @@ -41,7 +41,8 @@ namespace Microsoft.DotNet.New.Tests if (useNuGetConfigForAspNet) { - File.Copy("NuGet.tempaspnetpatch.config", Path.Combine(rootPath, "NuGet.Config")); + var configFile = new FileInfo(Path.Combine(rootPath,"..","..","..","..","NuGet.tempaspnetpatch.config")); + File.Copy(configFile.FullName, Path.Combine(rootPath, "NuGet.Config")); } new TestCommand("dotnet") diff --git a/test/dotnet-new.Tests/New3/GivenThatIWantANewAppWithSpecifiedType.cs b/test/dotnet-new.Tests/New3/GivenThatIWantANewAppWithSpecifiedType.cs index b61565d83..f89bca7cd 100644 --- a/test/dotnet-new.Tests/New3/GivenThatIWantANewAppWithSpecifiedType.cs +++ b/test/dotnet-new.Tests/New3/GivenThatIWantANewAppWithSpecifiedType.cs @@ -38,7 +38,8 @@ namespace Microsoft.DotNet.New3.Tests if (useNuGetConfigForAspNet) { - File.Copy("NuGet.tempaspnetpatch.config", Path.Combine(rootPath, "NuGet.Config")); + var configFile = new FileInfo(Path.Combine(rootPath,"..","..","..","..","NuGet.tempaspnetpatch.config")); + File.Copy(configFile.FullName, Path.Combine(rootPath, "NuGet.Config")); } string globalJsonPath = Path.Combine(rootPath, "global.json"); diff --git a/test/dotnet-new.Tests/dotnet-new.Tests.csproj b/test/dotnet-new.Tests/dotnet-new.Tests.csproj index 30e772e67..fc811a75c 100644 --- a/test/dotnet-new.Tests/dotnet-new.Tests.csproj +++ b/test/dotnet-new.Tests/dotnet-new.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-new.Tests - $(PackageTargetFallback);dnxcore50;portable-net45+win8 + $(PackageTargetFallback);dnxcore50;portable-net45+win8 @@ -46,7 +46,7 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 $(CLI_MSBuild_Version) diff --git a/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj b/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj index 70805d0f3..b67766466 100644 --- a/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj +++ b/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-nuget.UnitTests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -46,10 +46,10 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj b/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj index e0b97e719..b6d0698e3 100644 --- a/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj +++ b/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-pack.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -40,13 +40,13 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 - 4.0.1 + 4.3.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj index fc1d3fad8..23daaa675 100644 --- a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj +++ b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-publish.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -42,10 +42,10 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj b/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj index c03c7c6ae..a339974dd 100644 --- a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj +++ b/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-remove-reference.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -36,10 +36,10 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 @@ -48,7 +48,7 @@ $(CLI_MSBuild_Version) - 4.0.0 + 4.18.0 diff --git a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj index 0adf2a9de..2cc814fb5 100644 --- a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj +++ b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-restore.Tests - $(PackageTargetFallback);dnxcore50;portable-net45+win8 + $(PackageTargetFallback);dnxcore50;portable-net45+win8 @@ -46,7 +46,7 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 $(CLI_MSBuild_Version) @@ -55,10 +55,10 @@ 2.2.0-beta4-build3444 - 1.0.1-beta-000933 + 1.1.0 - 4.0.0 + 4.18.0 diff --git a/test/dotnet-run.Tests/dotnet-run.Tests.csproj b/test/dotnet-run.Tests/dotnet-run.Tests.csproj index 6fa3f48be..4b3dece00 100644 --- a/test/dotnet-run.Tests/dotnet-run.Tests.csproj +++ b/test/dotnet-run.Tests/dotnet-run.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-run.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -35,10 +35,10 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj index 08a73c20e..29025c38a 100644 --- a/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj +++ b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-sln-add.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -24,7 +24,7 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj index 9c5727e68..6dc24ff30 100644 --- a/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj +++ b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-sln-list.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -24,7 +24,7 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj index 50a6d2592..5e062c352 100644 --- a/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj +++ b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-sln-remove.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -24,7 +24,7 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-test.Tests/dotnet-test.Tests.csproj b/test/dotnet-test.Tests/dotnet-test.Tests.csproj index 443a67a9d..aa68a2b2b 100644 --- a/test/dotnet-test.Tests/dotnet-test.Tests.csproj +++ b/test/dotnet-test.Tests/dotnet-test.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-test.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -35,10 +35,10 @@ 2.2.0-beta4-build1194 - 1.0.0 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 diff --git a/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj b/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj index c0ce2eef3..99ab8dfcc 100644 --- a/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj +++ b/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet-vstest.Tests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -35,10 +35,10 @@ 2.2.0-beta4-build1194 - 1.0.0 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 diff --git a/test/dotnet.Tests/PackagedCommandTests.cs b/test/dotnet.Tests/PackagedCommandTests.cs index b08cc2eeb..d1f8b0c93 100644 --- a/test/dotnet.Tests/PackagedCommandTests.cs +++ b/test/dotnet.Tests/PackagedCommandTests.cs @@ -267,7 +267,6 @@ namespace Microsoft.DotNet.Tests new BuildCommand() .WithWorkingDirectory(testInstance.Root) - .WithFramework(NuGet.Frameworks.FrameworkConstants.CommonFrameworks.NetCoreApp10) .Execute() .Should().Pass(); diff --git a/test/dotnet.Tests/dotnet.Tests.csproj b/test/dotnet.Tests/dotnet.Tests.csproj index c0861efb2..afde5c00a 100644 --- a/test/dotnet.Tests/dotnet.Tests.csproj +++ b/test/dotnet.Tests/dotnet.Tests.csproj @@ -2,13 +2,13 @@ - netcoreapp1.0 + netcoreapp1.1 true dotnet.Tests ../../tools/Key.snk true true - $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 @@ -60,10 +60,10 @@ 2.2.0-beta4-build1194 - 1.0.3 + 1.1.0 - 4.1.1 + 4.3.0 2.2.0-beta4-build3444 @@ -72,7 +72,7 @@ 1.0.0-prerelease-00206 - 1.0.1-beta-000933 + 1.1.0 diff --git a/test/dotnet.Tests/¬/.dotnet/optimizationdata/1.0.0-rc4-004536/osx.10.11-x64/dotnet b/test/dotnet.Tests/¬/.dotnet/optimizationdata/1.0.0-rc4-004536/osx.10.11-x64/dotnet deleted file mode 100644 index 30393cb6d..000000000 Binary files a/test/dotnet.Tests/¬/.dotnet/optimizationdata/1.0.0-rc4-004536/osx.10.11-x64/dotnet and /dev/null differ diff --git a/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj b/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj index 30faccc85..c6adb0cd5 100644 --- a/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj +++ b/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 true msbuild.IntegrationTests - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 @@ -35,7 +35,7 @@ 2.2.0-beta4-build1194 - 1.0.0 + 1.1.0 2.2.0-beta4-build3444 diff --git a/tools/Archiver/Archiver.csproj b/tools/Archiver/Archiver.csproj index 3d673f7ac..a1d99b659 100644 --- a/tools/Archiver/Archiver.csproj +++ b/tools/Archiver/Archiver.csproj @@ -2,7 +2,7 @@ - netcoreapp1.0 + netcoreapp1.1 Exe win7-x64;win7-x86;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;osx.10.10-x64;rhel.7-x64 @@ -15,7 +15,7 @@ - 1.0.3 + 1.1.0 diff --git a/tools/MigrationDefaultsConstructor/MigrationDefaultsConstructor.csproj b/tools/MigrationDefaultsConstructor/MigrationDefaultsConstructor.csproj index c801a1d11..090b114cd 100644 --- a/tools/MigrationDefaultsConstructor/MigrationDefaultsConstructor.csproj +++ b/tools/MigrationDefaultsConstructor/MigrationDefaultsConstructor.csproj @@ -2,10 +2,10 @@ - netcoreapp1.0 + netcoreapp1.1 portable Exe - $(PackageTargetFallback);dnxcore50;portable-net45+win8 + $(PackageTargetFallback);dnxcore50;portable-net45+win8 @@ -13,7 +13,7 @@ - 1.0.3 + 1.1.0 $(CLI_MSBuild_Version)