diff --git a/README.md b/README.md index e2eda7100..0fbe7ded6 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,17 @@ This repo contains the source code for cross-platform [.NET Core](http://github.com/dotnet/core) command line toolchain. It contains the implementation of each command, the native packages for various supported platforms as well as documentation. -Preview 4 release - MSBuild based tools +RC 4 release - MSBuild based tools --------------------------------------- -As was outlined in the ["Changes to project.json" blog post](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/), we have started work to move away from project.json to csproj and MSBuild. All the new `latest` releases from this repo (from `rel/1.0.0` branch) are MSBuild-enabled tools. +As was outlined in the ["Changes to project.json" blog post](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/), we have started work to move away from project.json to csproj and MSBuild. All the new `latest` releases from this repo (from `rel/1.0.0` branch) are MSBuild-enabled tools. -The current official release of the csproj-enabled CLI tools is **CLI Preview 4**. +The current official release of the csproj-enabled CLI tools is **CLI RC 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 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. +* RC 4 CLI bits are still **in development** so some rough edges are to be expected. +* RC 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). +* RC 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. ### Download links diff --git a/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj b/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj index 56cee9233..59a2ee3db 100644 --- a/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj +++ b/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj @@ -14,7 +14,7 @@ - 1.0.3 + 1.0.4 diff --git a/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj b/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj index 241f2d9ce..95d254ef9 100644 --- a/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj +++ b/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj @@ -15,7 +15,7 @@ - 1.0.3 + 1.0.4 1.0.1-beta-000933 diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj index 61ab7e04f..3d7b4134e 100644 --- a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj +++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj @@ -7,6 +7,7 @@ dotnet-dependency-tool-invoker Exe $(PackageTargetFallback);portable-net45+win8;dnxcore50 + @@ -23,7 +24,7 @@ - 1.0.3 + 1.0.4 $(CLI_NuGet_Version) 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 b2d04e484..41da0203f 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 @@ -15,16 +15,10 @@ - 1.0.3 + 1.0.4 - - - - - diff --git a/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj b/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj index b341aac64..ae9f8d61b 100644 --- a/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj +++ b/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj @@ -1,8 +1,11 @@  + + netcoreapp1.0 dotnet-portable Exe + @@ -13,7 +16,7 @@ - 1.0.3 + 1.0.4 diff --git a/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj b/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj index 837602aad..5ee797803 100644 --- a/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj +++ b/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj @@ -1,7 +1,10 @@  + + netcoreapp1.0 Exe + diff --git a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj index a31d87934..a5eb7a585 100755 --- a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj +++ b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj @@ -13,6 +13,9 @@ 1.0.0 + + 1.0.0 + $(DefineConstants);RELEASE diff --git a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj index cf78cd7a8..6a76893df 100755 --- a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj +++ b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj @@ -18,11 +18,6 @@ 1.0.0-* - - - - $(DefineConstants);RELEASE;TRACE true diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/App.sln new file mode 100644 index 000000000..c8573d702 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/App.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}") = "App", "src\App\App.csproj", "{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{72BFCA87-B033-4721-8712-4D12166B4A39}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.ActiveCfg = Debug|x64 + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.Build.0 = Debug|x64 + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.ActiveCfg = Debug|x86 + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.Build.0 = Debug|x86 + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.Build.0 = Release|Any CPU + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.ActiveCfg = Release|x64 + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.Build.0 = Release|x64 + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.ActiveCfg = Release|x86 + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {DDF3765C-59FB-4AA6-BE83-779ED13AA64A} = {72BFCA87-B033-4721-8712-4D12166B4A39} + EndGlobalSection +EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj new file mode 100644 index 000000000..b38669c62 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj @@ -0,0 +1,15 @@ + + + Exe + netcoreapp1.0 + + + + + + + + + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/Program.cs new file mode 100644 index 000000000..abb853a4a --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/Program.cs @@ -0,0 +1,10 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + Console.WriteLine("Hello from the main app"); + Console.WriteLine(Lib.Library.GetMessage()); + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Lib.csproj new file mode 100644 index 000000000..9f8bcbb51 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Lib.csproj @@ -0,0 +1,11 @@ + + + + netstandard1.4 + + + + + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Library.cs new file mode 100644 index 000000000..205c42a01 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Library.cs @@ -0,0 +1,12 @@ +using System; + +namespace Lib +{ + public class Library + { + public static string GetMessage() + { + return "Message from Lib"; + } + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App.sln new file mode 100644 index 000000000..17cd062c5 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App.sln @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26006.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "Lib\\Lib.csproj", "{B38B1FA5-B4C9-456A-8B71-8FCD62ACF400}" +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 + {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 + {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 + {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 + {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 + {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU + {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 + {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 + {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 + {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj new file mode 100644 index 000000000..27e43f08e --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj @@ -0,0 +1,19 @@ + + + Exe + netcoreapp1.0 + + + + + + + + + + + + + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/Program.cs new file mode 100644 index 000000000..abb853a4a --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/Program.cs @@ -0,0 +1,10 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + Console.WriteLine("Hello from the main app"); + Console.WriteLine(Lib.Library.GetMessage()); + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Lib.csproj new file mode 100644 index 000000000..9f8bcbb51 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Lib.csproj @@ -0,0 +1,11 @@ + + + + netstandard1.4 + + + + + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Library.cs new file mode 100644 index 000000000..205c42a01 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Library.cs @@ -0,0 +1,12 @@ +using System; + +namespace Lib +{ + public class Library + { + public static string GetMessage() + { + return "Message from Lib"; + } + } +} diff --git a/build/Compile.targets b/build/Compile.targets index 6b6027af4..d82af9a49 100644 --- a/build/Compile.targets +++ b/build/Compile.targets @@ -63,36 +63,6 @@ VersionSuffix="$(CommitCount)" ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" /> - - - - - - u=rw,g=r,o=r - - - - - u=rwx,g=rx,o=rx - - - - - u=rwx,g=rx,o=rx - - - - - - - @@ -178,6 +148,32 @@ @(CompileStageSdkDirectories); $(SharedFrameworkNameVersionPath)" /> + + + + + + u=rw,g=r,o=r + + + + + u=rwx,g=rx,o=rx + + + + + u=rwx,g=rx,o=rx + + + + + diff --git a/build/Microsoft.DotNet.Cli.BundledRuntimes.props b/build/Microsoft.DotNet.Cli.BundledRuntimes.props index 449aaaf67..df527f812 100644 --- a/build/Microsoft.DotNet.Cli.BundledRuntimes.props +++ b/build/Microsoft.DotNet.Cli.BundledRuntimes.props @@ -17,7 +17,7 @@ preview - 1.0.3 + 1.0.4 1.0.1 1.0.1 diff --git a/build/Publish.targets b/build/Publish.targets index faca97224..72811e068 100644 --- a/build/Publish.targets +++ b/build/Publish.targets @@ -43,11 +43,12 @@ + - $(Product)/$(NugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) + $(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) @@ -62,7 +63,7 @@ - $(DotnetBlobRootUrl)/$(Product)/$(NugetVersion)/%(SdkInstallerFileItemGroup.Filename)%(SdkInstallerFileItemGroup.Extension) + $(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/%(SdkInstallerFileItemGroup.Filename)%(SdkInstallerFileItemGroup.Extension) $(SdkDebianIntermediateDirectory)/package_upload.json 1 @@ -89,7 +90,7 @@ - $(Product)/$(NugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) + $(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) diff --git a/build/Test.targets b/build/Test.targets index 5baf180e7..31dd9ea90 100644 --- a/build/Test.targets +++ b/build/Test.targets @@ -56,7 +56,6 @@ DependsOnTargets="Init; SetupTestProjectData"> - $(CommitCount) $(RepoRoot)/artifacts/testpackages/ $(TestOutputDir)/packagesBuild/ $(TestOutputDir)/packages/ diff --git a/build/Version.props b/build/Version.props index 11e41049f..402ae0858 100644 --- a/build/Version.props +++ b/build/Version.props @@ -6,11 +6,17 @@ alpha $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix) - $(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount) - $(ReleaseSuffix)-$(CommitCount) - $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(VersionSuffix) - + $(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount) + $(VersionMajor).$(VersionMinor).$(VersionPatch) + + $(ReleaseSuffix)-$(CommitCount) + + $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix)-$(CommitCount) + + $(FullNugetVersion) + $(VersionMajor).$(VersionMinor).$(VersionPatch) + $(NugetVersion) - $(SdkVersion) + $(NugetVersion) diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index fb733e0ea..583e1f240 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -23,9 +23,15 @@ $(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension) $(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension) $(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).nuspec - $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(NugetVersion).nupkg + $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(FullNugetVersion).nupkg + + + + + @@ -82,7 +88,9 @@ + Condition=" '$(OS)' == 'Windows_NT'" + Inputs="@(GenerateSdkMsiInputs)" + Outputs="$(SdkInstallerFile)"> diff --git a/build/package/Nupkg.targets b/build/package/Nupkg.targets index 0464b23a0..4e57d0c41 100644 --- a/build/package/Nupkg.targets +++ b/build/package/Nupkg.targets @@ -4,7 +4,6 @@ - $(CommitCount) $(RepoRoot)/src $(Stage2CompilationDirectory)/forPackaging $(PackagesDirectory) @@ -26,7 +25,7 @@ Output="$(NupkgOutputDirectory)" ProjectPath="%(ProjectsToPack.Identity)/%(ProjectsToPack.ProjectName).csproj" ToolPath="$(Stage0Directory)" - VersionSuffix="$(ReleaseSuffix)-$(NupkgVersionSuffix)" + VersionSuffix="$(VersionSuffix)" Configuration="$(Configuration)" /> diff --git a/build/publish/FinishBuild.targets b/build/publish/FinishBuild.targets index 307e23d30..206e131f2 100644 --- a/build/publish/FinishBuild.targets +++ b/build/publish/FinishBuild.targets @@ -8,7 +8,7 @@ + NugetVersion="$(FullNugetVersion)"> @@ -18,14 +18,14 @@ diff --git a/build/test/TestPackageProjects.targets b/build/test/TestPackageProjects.targets index 0263122fd..4b7c98c80 100644 --- a/build/test/TestPackageProjects.targets +++ b/build/test/TestPackageProjects.targets @@ -22,8 +22,8 @@ Microsoft.DotNet.Cli.Utils.csproj True True - $(CliVersionPrefix)- - rc4-$(TestPackageBuildVersionSuffix) + $(CliVersionPrefix) + $(VersionSuffix) False Microsoft.DotNet.Cli.Utils.csproj True True - $(CliVersionPrefix)- - $(ReleaseSuffix)-$(TestPackageBuildVersionSuffix) + $(CliVersionPrefix) + $(VersionSuffix) False /p:TargetFramework=netstandard1.5 @@ -42,8 +42,8 @@ Microsoft.DotNet.InternalAbstractions.csproj True True - 2.0.0-beta- - beta-$(TestPackageBuildVersionSuffix) + 2.0.0 + $(VersionSuffix) False dotnet-dependency-context-test.csproj True True - 1.0.0-rc- - rc-$(TestPackageBuildVersionSuffix) + $(CliVersionPrefix) + $(VersionSuffix) True @@ -71,8 +71,8 @@ dotnet-dependency-tool-invoker.csproj True True - 1.0.0-rc- - rc-$(TestPackageBuildVersionSuffix) + $(CliVersionPrefix) + $(VersionSuffix) True dotnet-desktop-and-portable.csproj True True - 1.0.0-rc- - rc-$(TestPackageBuildVersionSuffix) + $(CliVersionPrefix) + $(VersionSuffix) True /p:RuntimeIdentifier=$(CoreCLRRid) @@ -93,8 +93,8 @@ True True $(DesktopAvailable) - 1.0.0-rc- - rc-$(TestPackageBuildVersionSuffix) + $(CliVersionPrefix) + $(VersionSuffix) True /p:RuntimeIdentifier=$(CoreCLRRid) diff --git a/build_projects/shared-build-targets-utils/Utils/Version.cs b/build_projects/shared-build-targets-utils/Utils/Version.cs index 7bade35d6..def18eda2 100644 --- a/build_projects/shared-build-targets-utils/Utils/Version.cs +++ b/build_projects/shared-build-targets-utils/Utils/Version.cs @@ -1,8 +1,6 @@ -using System.Collections.Generic; - namespace Microsoft.DotNet.Cli.Build { - public abstract class Version + public class Version { public virtual int Major { get; set; } public virtual int Minor { get; set; } diff --git a/scripts/dockerrun.sh b/scripts/dockerrun.sh index b478a2a10..d5caeb312 100755 --- a/scripts/dockerrun.sh +++ b/scripts/dockerrun.sh @@ -133,6 +133,8 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \ -e CHECKSUM_STORAGE_ACCOUNT \ -e CHECKSUM_STORAGE_CONTAINER \ -e CLIBUILD_SKIP_TESTS \ - -e CommitCount \ + -e COMMITCOUNT \ + -e DROPSUFFIX \ + -e RELEASESUFFIX \ $DOTNET_BUILD_CONTAINER_TAG \ $BUILD_COMMAND "$@" diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs index 7eda0d91e..93df94b85 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs @@ -274,7 +274,8 @@ namespace Microsoft.DotNet.Cli.Sln.Internal } set { - _filePath = PathUtility.GetPathWithDirectorySeparator(value); + _filePath = PathUtility.RemoveExtraPathSeparators( + PathUtility.GetPathWithDirectorySeparator(value)); } } diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs index ac598c37e..603f1b0dc 100644 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs +++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs @@ -150,10 +150,9 @@ namespace Microsoft.DotNet.Cli.Utils toolLockFile.Path)); var toolLibrary = toolLockFile.Targets - .FirstOrDefault( - t => t.TargetFramework.GetShortFolderName().Equals(s_toolPackageFramework.GetShortFolderName())) - ?.Libraries.FirstOrDefault(l => l.Name == toolLibraryRange.Name); - + .FirstOrDefault(t => s_toolPackageFramework == t.TargetFramework) + ?.Libraries.FirstOrDefault( + l => StringComparer.OrdinalIgnoreCase.Equals(l.Name, toolLibraryRange.Name)); if (toolLibrary == null) { Reporter.Verbose.WriteLine(string.Format( 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 53f8615de..95539171e 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.1.0 + $(PlatformAbstractionsVersion) $(CLI_NuGet_Version) diff --git a/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs b/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs index 2f2353cbe..895257d28 100644 --- a/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs +++ b/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs @@ -261,6 +261,32 @@ namespace Microsoft.DotNet.Tools.Common } } + public static string RemoveExtraPathSeparators(string path) + { + if (string.IsNullOrEmpty(path)) + { + return path; + } + + var components = path.Split(Path.DirectorySeparatorChar); + var result = string.Empty; + + foreach (var component in components) + { + if (!string.IsNullOrEmpty(component)) + { + result = Path.Combine(result, component); + } + } + + if (path[path.Length-1] == Path.DirectorySeparatorChar) + { + result += Path.DirectorySeparatorChar; + } + + return result; + } + public static bool HasExtension(string filePath, string extension) { var comparison = StringComparison.Ordinal; diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageVersions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageVersions.cs index 9928d0e67..bb86cd1c3 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageVersions.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageVersions.cs @@ -5,8 +5,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration { internal class ConstantPackageVersions { - public const string AspNetToolsVersion = "1.0.0-msbuild3-final"; - public const string AspNet110ToolsVersion = "1.1.0-msbuild3-final"; + public const string AspNetToolsVersion = "1.0.0"; + public const string AspNet110ToolsVersion = "1.1.0"; public const string AspNetLTSPackagesVersion = "1.0.2"; public const string EntityFrameworkLTSPackagesVersion = "1.0.2"; public const string TestSdkPackageVersion = "15.0.0-preview-20170106-08"; @@ -15,6 +15,5 @@ namespace Microsoft.DotNet.ProjectJsonMigration public const string MstestTestAdapterVersion = "1.1.8-rc"; public const string MstestTestFrameworkVersion = "1.0.8-rc"; public const string BundleMinifierToolVersion = "2.2.301"; - public const string WebSdkPackageVersion = "1.0.0-alpha-20161205-1-154" ; } } \ No newline at end of file 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 7a2778d9c..298766d64 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs @@ -591,25 +591,10 @@ namespace Microsoft.DotNet.Internal.ProjectModel var rawOptions = rawObject.Value("buildOptions") as JObject; if (rawOptions == null) { - rawOptions = rawObject.Value("compilationOptions") as JObject; - if (rawOptions == null) + return new CommonCompilerOptions { - return new CommonCompilerOptions - { - CompilerName = compilerName ?? "csc" - }; - } - - var lineInfo = (IJsonLineInfo)rawOptions; - - project.Diagnostics.Add( - new DiagnosticMessage( - ErrorCodes.DOTNET1015, - $"The 'compilationOptions' option is deprecated. Use 'buildOptions' instead.", - project.ProjectFilePath, - DiagnosticMessageSeverity.Warning, - lineInfo.LineNumber, - lineInfo.LinePosition)); + CompilerName = compilerName ?? "csc" + }; } var analyzerOptionsJson = rawOptions.Value("analyzerOptions") as JObject; @@ -814,6 +799,9 @@ namespace Microsoft.DotNet.Internal.ProjectModel private static void AddProjectFilesDeprecationDiagnostics(JObject rawProject, Project project) { + var compilationOptionsWarning = "'buildOptions'"; + AddDeprecatedDiagnosticMessage(rawProject, project, "compilationOptions", compilationOptionsWarning); + var compileWarning = "'compile' in 'buildOptions'"; AddDeprecatedDiagnosticMessage(rawProject, project, "compile", compileWarning); AddDeprecatedDiagnosticMessage(rawProject, project, "compileExclude", compileWarning); @@ -870,6 +858,7 @@ namespace Microsoft.DotNet.Internal.ProjectModel private static void ConvertDeprecatedToSupportedFormat(JObject rawProject) { + ConvertToBuildOptions(rawProject); ConvertToBuildOptionsCompile(rawProject); ConvertToBuildOptionsEmbed(rawProject); ConvertToBuildOptionsCopyToOutput(rawProject); @@ -877,6 +866,21 @@ namespace Microsoft.DotNet.Internal.ProjectModel ConvertToPublishOptions(rawProject); } + private static void ConvertToBuildOptions(JObject rawProject) + { + var jpath = "buildOptions"; + if (AreDeprecatedOptionsIgnored(rawProject, jpath)) + { + return; + } + + var deprecatedValue = rawProject.Value("compilationOptions"); + if (deprecatedValue != null) + { + rawProject["buildOptions"] = deprecatedValue.DeepClone(); + } + } + private static void ConvertToBuildOptionsCompile(JObject rawProject) { var jpath = "buildOptions.compile"; diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/SupportedPackageVersions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/SupportedPackageVersions.cs index f1feedeb0..511763603 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/SupportedPackageVersions.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/SupportedPackageVersions.cs @@ -53,6 +53,17 @@ namespace Microsoft.DotNet.ProjectJsonMigration Version = ConstantPackageVersions.AspNetToolsVersion } }, + { + new PackageDependencyInfo + { + Name = "Microsoft.EntityFrameworkCore.Tools.DotNet", + Version = "[1.0.0-*,)" + }, + new PackageDependencyInfo { + Name = "Microsoft.EntityFrameworkCore.Tools.DotNet", + Version = ConstantPackageVersions.AspNetToolsVersion + } + }, { new PackageDependencyInfo { diff --git a/src/dotnet/ProjectInstanceExtensions.cs b/src/dotnet/ProjectInstanceExtensions.cs index 4bbcb5247..f437572c5 100644 --- a/src/dotnet/ProjectInstanceExtensions.cs +++ b/src/dotnet/ProjectInstanceExtensions.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Build.Execution; +using Microsoft.DotNet.Cli.Sln.Internal; using System; using System.Linq; @@ -37,9 +38,9 @@ namespace Microsoft.DotNet.Tools.Common //ISSUE: https://github.com/dotnet/sdk/issues/522 //The real behavior we want (once DefaultProjectTypeGuid support is in) is to throw //when we cannot find ProjectTypeGuid or DefaultProjectTypeGuid. But for now we - //need the same behavior we had before this change. + //need to default to the C# one. //throw new GracefulException(CommonLocalizableStrings.UnsupportedProjectType); - projectTypeGuid = "{13B669BE-BB05-4DDF-9536-439F39A36129}"; // CPS guid + projectTypeGuid = ProjectTypeGuids.CSharpProjectTypeGuid; } return projectTypeGuid; diff --git a/src/dotnet/README.md b/src/dotnet/README.md index d947deb10..5729f3039 100644 --- a/src/dotnet/README.md +++ b/src/dotnet/README.md @@ -39,19 +39,19 @@ Prints out a short help and a list of current commands. The following commands exist for dotnet: -* [dotnet-new](commands/dotnet-new/README.md) +* [dotnet-new](https://aka.ms/dotnet-new) * Initializes a C# or F# console application project. -* [dotnet-restore](commands/dotnet-restore/README.md) +* [dotnet-restore](https://aka.ms/dotnet-restore) * Restores the dependencies for a given application. -* [dotnet-build](commands/dotnet-build/README.md) +* [dotnet-build](https://aka.ms/dotnet-build) * Builds a .NET Core application. -* [dotnet-publish](commands/dotnet-publish/README.md) +* [dotnet-publish](https://aka.ms/dotnet-publish) * Publishes a .NET portable or self-contained application. -* [dotnet-run](commands/dotnet-run/README.md) +* [dotnet-run](https://aka.ms/dotnet-run) * Runs the application from source. -* [dotnet-test](commands/dotnet-test/README.md) +* [dotnet-test](https://aka.ms/dotnet-test) * Runs tests using a test runner specified in the project.json. -* [dotnet-pack](commands/dotnet-pack/README.md) +* [dotnet-pack](https://aka.ms/dotnet-pack) * Creates a NuGet package of your code. ## EXAMPLES diff --git a/src/dotnet/SlnFileExtensions.cs b/src/dotnet/SlnFileExtensions.cs index 7fbf0fb70..39e34a806 100644 --- a/src/dotnet/SlnFileExtensions.cs +++ b/src/dotnet/SlnFileExtensions.cs @@ -172,7 +172,7 @@ namespace Microsoft.DotNet.Tools.Common this SlnFile slnFile, SlnPropertySet nestedProjects) { - var solutionFolderPaths = new Dictionary(); + var solutionFolderPaths = new Dictionary(StringComparer.OrdinalIgnoreCase); var solutionFolderProjects = slnFile.Projects.GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid); foreach (var slnProject in solutionFolderProjects) diff --git a/src/dotnet/dotnet.csproj b/src/dotnet/dotnet.csproj index 0e706a3c5..243d7b027 100644 --- a/src/dotnet/dotnet.csproj +++ b/src/dotnet/dotnet.csproj @@ -60,7 +60,7 @@ $(CLI_MSBuild_Version) - 1.1.0 + $(PlatformAbstractionsVersion) diff --git a/src/tool_roslyn/tool_roslyn.csproj b/src/tool_roslyn/tool_roslyn.csproj index 16ed1e8bf..75a94c454 100644 --- a/src/tool_roslyn/tool_roslyn.csproj +++ b/src/tool_roslyn/tool_roslyn.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj index 9f6fcc539..5d64b79f3 100644 --- a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj +++ b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj @@ -37,7 +37,7 @@ 2.2.0-beta4-build3444 - 1.1.0 + $(PlatformAbstractionsVersion) diff --git a/test/EndToEnd/EndToEnd.csproj b/test/EndToEnd/EndToEnd.csproj index bd792b4e3..d7689c82e 100644 --- a/test/EndToEnd/EndToEnd.csproj +++ b/test/EndToEnd/EndToEnd.csproj @@ -41,7 +41,7 @@ 1.0.0-prerelease-00206 - 1.1.0 + $(PlatformAbstractionsVersion) diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs index 8adeb2e92..1405c3e9a 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs @@ -23,7 +23,7 @@ namespace Microsoft.DotNet.Tests private const string TestProjectName = "AppWithToolDependency"; [Fact] - public void It_returns_null_when_CommandName_is_null() + public void ItReturnsNullWhenCommandNameIsNull() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -40,7 +40,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_returns_null_when_ProjectDirectory_is_null() + public void ItReturnsNullWhenProjectDirectoryIsNull() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -57,7 +57,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_returns_null_when_ProjectDirectory_does_not_contain_a_project_file() + public void ItReturnsNullWhenProjectDirectoryDoesNotContainAProjectFile() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -76,7 +76,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_returns_null_when_CommandName_does_not_exist_in_ProjectTools() + public void ItReturnsNullWhenCommandNameDoesNotExistInProjectTools() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -98,7 +98,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_returns_a_CommandSpec_with_DOTNET_as_FileName_and_CommandName_in_Args_when_CommandName_exists_in_ProjectTools() + public void ItReturnsACommandSpecWithDOTNETAsFileNameAndCommandNameInArgsWhenCommandNameExistsInProjectTools() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -126,7 +126,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_escapes_CommandArguments_when_returning_a_CommandSpec() + public void ItEscapesCommandArgumentsWhenReturningACommandSpec() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -149,7 +149,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_returns_a_CommandSpec_with_Args_containing_CommandPath_when_returning_a_CommandSpec_and_CommandArguments_are_null() + public void ItReturnsACommandSpecWithArgsContainingCommandPathWhenReturningACommandSpecAndCommandArgumentsAreNull() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -174,7 +174,32 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_writes_a_deps_json_file_next_to_the_lockfile() + public void ItReturnsACommandSpecWithArgsContainingCommandPathWhenInvokingAToolReferencedWithADifferentCasing() + { + var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); + + var testInstance = TestAssets.Get(TestProjectName) + .CreateInstance() + .WithSourceFiles() + .WithRestoreFiles(); + + var commandResolverArguments = new CommandResolverArguments() + { + CommandName = "dotnet-prefercliruntime", + CommandArguments = null, + ProjectDirectory = testInstance.Root.FullName + }; + + var result = projectToolsCommandResolver.Resolve(commandResolverArguments); + + result.Should().NotBeNull(); + + var commandPath = result.Args.Trim('"'); + commandPath.Should().Contain("dotnet-prefercliruntime.dll"); + } + + [Fact] + public void ItWritesADepsJsonFileNextToTheLockfile() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -221,7 +246,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void Generate_deps_json_method_doesnt_overwrite_when_deps_file_already_exists() + public void GenerateDepsJsonMethodDoesntOverwriteWhenDepsFileAlreadyExists() { var testInstance = TestAssets.Get(TestProjectName) .CreateInstance() @@ -262,7 +287,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_adds_fx_version_as_a_param_when_the_tool_has_the_prefercliruntime_file() + public void ItAddsFxVersionAsAParamWhenTheToolHasThePrefercliruntimeFile() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); @@ -286,7 +311,7 @@ namespace Microsoft.DotNet.Tests } [Fact] - public void It_does_not_add_fx_version_as_a_param_when_the_tool_does_not_have_the_prefercliruntime_file() + public void ItDoesNotAddFxVersionAsAParamWhenTheToolDoesNotHaveThePrefercliruntimeFile() { var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); 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 838c38319..6565df694 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 @@ -61,7 +61,7 @@ 2.2.0-beta4-build3444 - 1.1.0 + $(PlatformAbstractionsVersion) $(CLI_MSBuild_Version) diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs index 30215b61a..cdf24ddaa 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs @@ -16,6 +16,37 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests { public class GivenThatIWantToMigrateBuildOptions : TestBase { + [Fact] + public void MigratingDeprecatedCompilationOptionsWithEmitEntryPointPopulatesOutputTypeField() + { + var mockProj = RunBuildOptionsRuleOnPj(@" + { + ""compilationOptions"": { + ""emitEntryPoint"": ""true"" + }, + ""exclude"": [ + ""node_modules"" + ] + }"); + + mockProj.Properties.Count(p => p.Name == "OutputType").Should().Be(1); + mockProj.Properties.First(p => p.Name == "OutputType").Value.Should().Be("Exe"); + + mockProj.Items.Count(i => i.ItemType.Equals("Compile", StringComparison.Ordinal)) + .Should().Be(1); + mockProj.Items.Count(i => + i.ItemType.Equals("Compile", StringComparison.Ordinal) && + i.Remove.Equals("node_modules")) + .Should().Be(1); + + mockProj.Items.Count(i => i.ItemType.Equals("EmbeddedResource", StringComparison.Ordinal)) + .Should().Be(1); + mockProj.Items.Count(i => + i.ItemType.Equals("EmbeddedResource", StringComparison.Ordinal) && + i.Remove.Equals("node_modules")) + .Should().Be(1); + } + [Fact] public void SpecifiedDefaultPropertiesAreRemovedWhenTheyExistInTheCsprojTemplate() { diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTools.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTools.cs index a014ac163..afcede957 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTools.cs +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTools.cs @@ -59,6 +59,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests } [Theory] + [InlineData("Microsoft.EntityFrameworkCore.Tools.DotNet", "Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion)] [InlineData("Microsoft.EntityFrameworkCore.Tools", "Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion)] [InlineData("Microsoft.VisualStudio.Web.CodeGeneration.Tools", "Microsoft.VisualStudio.Web.CodeGeneration.Tools", ConstantPackageVersions.AspNetToolsVersion)] [InlineData("Microsoft.DotNet.Watcher.Tools", "Microsoft.DotNet.Watcher.Tools", ConstantPackageVersions.AspNetToolsVersion)] @@ -90,5 +91,13 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests var packageRef = mockProj.Items.Where(i => i.ItemType == "DotNetCliToolReference").Should().BeEmpty(); } + + [Fact] + public void ItMergesEntityFrameworkCoreToolsAndEntityFrameworkCoreToolsDotNet() + { + var mockProj = RunPackageDependenciesRuleOnPj("{ \"tools\": { \"Microsoft.EntityFrameworkCore.Tools\": \"1.0.0-preview4-final\", \"Microsoft.EntityFrameworkCore.Tools.DotNet\": \"1.0.0-preview4-final\" } }"); + + EmitsToolReferences(mockProj, Tuple.Create("Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion)); + } } } \ No newline at end of file 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 132648280..9ee038a76 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 @@ -26,7 +26,7 @@ 2.2.0-beta4-build3444 - 1.1.0 + $(PlatformAbstractionsVersion) \ No newline at end of file diff --git a/test/Performance/Performance.csproj b/test/Performance/Performance.csproj index 7c295a2be..db7cf67c3 100644 --- a/test/Performance/Performance.csproj +++ b/test/Performance/Performance.csproj @@ -33,7 +33,7 @@ 2.2.0-beta4-build1194 - 1.1.0 + $(CLI_SharedFrameworkVersion) 4.3.0 diff --git a/test/binding-redirects.Tests/binding-redirects.Tests.csproj b/test/binding-redirects.Tests/binding-redirects.Tests.csproj index 6c60db847..36c2d6553 100644 --- a/test/binding-redirects.Tests/binding-redirects.Tests.csproj +++ b/test/binding-redirects.Tests/binding-redirects.Tests.csproj @@ -17,6 +17,6 @@ - + diff --git a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj index efc26fc0c..455f9e57e 100644 --- a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj +++ b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj @@ -47,7 +47,7 @@ 2.2.0-beta4-build3444 - 1.1.0 + $(PlatformAbstractionsVersion) 4.18.0 diff --git a/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs index ffe79ee75..78a11d09d 100644 --- a/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs +++ b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs @@ -42,7 +42,7 @@ VisualStudioVersion = 15.0.26006.2 MinimumVisualStudioVersion = 10.0.40219.1 Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App\App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" EndProject -Project(""{13B669BE-BB05-4DDF-9536-439F39A36129}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" +Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -90,7 +90,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26006.2 MinimumVisualStudioVersion = 10.0.40219.1 -Project(""{13B669BE-BB05-4DDF-9536-439F39A36129}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" +Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -127,7 +127,7 @@ Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App.csproj"", " EndProject Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""src"", ""src"", ""__SRC_FOLDER_GUID__"" EndProject -Project(""{13B669BE-BB05-4DDF-9536-439F39A36129}"") = ""Lib"", ""src\Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" +Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""src\Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -515,11 +515,13 @@ EndGlobal .Count().Should().Be(1, $"Lib {reasonString}"); } - [Fact] - public void WhenSolutionAlreadyContainsProjectItDoesntDuplicate() + [Theory] + [InlineData("TestAppWithSlnAndExistingCsprojReferences")] + [InlineData("TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep")] + public void WhenSolutionAlreadyContainsProjectItDoesntDuplicate(string testAsset) { var projectDirectory = TestAssets - .Get("TestAppWithSlnAndExistingCsprojReferences") + .Get(testAsset) .CreateInstance() .WithSourceFiles() .Root @@ -619,6 +621,28 @@ EndGlobal nonSolutionFolderProjects.Single().TypeGuid.Should().Be(expectedTypeGuid); } + [Fact] + private void WhenSlnContainsSolutionFolderWithDifferentCasingItDoesNotCreateDuplicate() + { + var projectDirectory = TestAssets + .Get("TestAppWithSlnAndCaseSensitiveSolutionFolders") + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .Execute($"sln App.sln add {projectToAdd}"); + cmd.Should().Pass(); + + var slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); + var solutionFolderProjects = slnFile.Projects.Where( + p => p.TypeGuid == ProjectTypeGuids.SolutionFolderGuid); + solutionFolderProjects.Count().Should().Be(1); + } + private string GetExpectedSlnContents( string slnPath, string slnTemplate, diff --git a/test/dotnet.Tests/VersionTest.cs b/test/dotnet.Tests/VersionTest.cs index bff9afd10..0192f5fd8 100644 --- a/test/dotnet.Tests/VersionTest.cs +++ b/test/dotnet.Tests/VersionTest.cs @@ -4,7 +4,6 @@ using System; using System.IO; using System.Collections.Generic; -using System.Text.RegularExpressions; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli; using Microsoft.DotNet.Tools.Test.Utilities; @@ -18,14 +17,28 @@ namespace Microsoft.DotNet.Tests [Fact] public void VersionCommandDisplaysCorrectVersion() { + var versionFilePath = Path.Combine(AppContext.BaseDirectory, ".version"); + var version = GetVersionFromFile(versionFilePath); + CommandResult result = new DotnetCommand() .ExecuteWithCapturedOutput("--version"); result.Should().Pass(); - - Regex.IsMatch(result.StdOut.Trim(), @"[0-9]{1}\.[0-9]{1}\.[0-9]{1}-[a-zA-Z0-9]+-[0-9]{6}$").Should() - .BeTrue($"Unexpected dotnet sdk version - {result.StdOut}"); + result.StdOut.Trim().Should().Be(version); + } + private string GetVersionFromFile(string versionFilePath) + { + using (var reader = new StreamReader(File.OpenRead(versionFilePath))) + { + SkipCommit(reader); + return reader.ReadLine(); + } + } + + private void SkipCommit(StreamReader reader) + { + reader.ReadLine(); } } } diff --git a/test/dotnet.Tests/dotnet.Tests.csproj b/test/dotnet.Tests/dotnet.Tests.csproj index 8caf0bf79..76c285159 100644 --- a/test/dotnet.Tests/dotnet.Tests.csproj +++ b/test/dotnet.Tests/dotnet.Tests.csproj @@ -23,6 +23,10 @@ PreserveNewest PreserveNewest + + .version + PreserveNewest + @@ -61,7 +65,7 @@ 1.0.0-prerelease-00206 - 1.1.0 + $(PlatformAbstractionsVersion)