diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 257c7565e5..a4967c64be 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -1,21 +1,18 @@ - 2.2.0-preview3-35364 + 2.2.0-preview3-35497 $(MicrosoftAspNetCoreAllPackageVersion) - 2.2.0-preview3-35364 - 2.2.0-preview3-35364 - 2.2.0-preview3-35364 - 2.2.0-preview3-35364 - 2.2.0-preview3-35364 - 2.2.0-preview3-35364 - 2.2.0-preview3-35364 - 2.2.0-preview3-27001-02 - - - 3.0.0-preview1-26816-04 - - 15.9.0-preview-000008 + 2.2.0-preview3-35497 + 2.2.0-preview3-35497 + 2.2.0-preview3-35497 + 2.2.0-preview3-35497 + 2.2.0-preview3-35497 + 2.2.0-preview3-35497 + 2.2.0-preview3-35497 + 2.2.0-preview3-27014-02 + $(MicrosoftNETCoreAppPackageVersion) + 15.9.19 $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) @@ -28,14 +25,14 @@ $(MicrosoftCodeAnalysisCSharpPackageVersion) 2.2.200-preview-63410-06 $(MicrosoftNETSdkPackageVersion) - 2.2.0-preview3-35364 - 2.2.100-preview3-20180930-2076033 + 2.2.0-preview3-35497 + 2.2.100-preview3-20181013-2115910 $(MicrosoftNETSdkWebPackageVersion) $(MicrosoftNETSdkWebPackageVersion) - 1.0.2-beta4-20180930-2076037 + 1.0.2-beta4-20181013-2115911 $(MicrosoftDotNetCommonItemTemplatesPackageVersion) - 1.0.2-beta4-20180821-1966911 - 1.0.2-beta4-20180930-2076037 + 1.0.2-beta4-20181009-2100240 + 1.0.2-beta4-20181013-2115911 $(MicrosoftTemplateEngineCliPackageVersion) $(MicrosoftTemplateEngineCliPackageVersion) $(MicrosoftTemplateEngineCliPackageVersion) @@ -56,14 +53,14 @@ $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) - 15.9.0-preview-20180807-05 + 15.9.0 $(MicrosoftNETTestSdkPackageVersion) $(MicrosoftNETTestSdkPackageVersion) 0.2.0-beta-000042 0.2.0 1.3.2 2.3.1 - 1.5.1 + 1.5.2 @@ -79,7 +76,7 @@ - 2.1.0-prerelease-02430-04 + 2.1.0-rc1-03130-05 $(BuildTasksFeedToolVersion) 2.0.0 diff --git a/build/Version.props b/build/Version.props index 6007ac4210..a07869fb1f 100644 --- a/build/Version.props +++ b/build/Version.props @@ -15,12 +15,16 @@ $(ReleaseSuffix)-$(CommitCount) - $(CliVersionNoSuffix)-$(ReleaseSuffix)-$(CommitCount) + $(CliVersionNoSuffix)-$(ReleaseSuffix)-$(CommitCount) + $(SuffixedNugetVersion) $(FullNugetVersion) $(CliVersionNoSuffix) $(NugetVersion) $(NugetVersion) + + $(NugetVersion) + diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index 503e588893..a2289c259b 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -21,10 +21,13 @@ $(RepoRoot)/packaging/windows/msbuildextensions/generatemsi.ps1 $(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).nuspec - $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(FullNugetVersion).nupkg + $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(SuffixedNugetVersion).nupkg + $(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).2.1.nuspec + $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).2.1.$(SuffixedNugetVersion).nupkg + $(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.nuspec - $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.$(FullNugetVersion).nupkg + $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.$(SuffixedNugetVersion).nupkg $(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr @@ -167,14 +170,22 @@ Condition=" '$(OS)' == 'Windows_NT'" Inputs="$(CombinedFrameworkSdkHostInstallerFile); $(SdkInstallerNuspecFile); + $(SdkInstallerNuspec21File); $(SdkGenerateNupkgPowershellScript)" - Outputs="$(SdkInstallerNupkgFile)"> + Outputs="$(SdkInstallerNupkgFile); + $(SdkInstallerNupkg21File)"> + + $(SharedFxRpmPackageName.ToLower()) dotnet-runtime-$(SharedFxRpmPackageFileVersion) $(SharedFxRpmPackageFileName.ToLower()) - $(HostFxrVersion) - dotnet-hostfxr-$(HostFxrRpmPackageVersion) - $(HostFxrRpmPackageName.ToLower()) - dotnet-host aspnetcore-runtime-$(AspNetCoreMajorMinorVersion) $(AspNetCoreSharedFxRpmPackageName.ToLower()) aspnetcore-runtime-$(AspNetCoreVersion) @@ -225,14 +221,13 @@ Outputs="$(RpmTestResultsXmlFile)" > - - - - + + + + - - + - - - - - - + + + + + + + + + + + diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index bd7badca8f..84f20ab4d1 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -28,5 +28,7 @@ + + diff --git a/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.x64.2.1.nuspec b/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.x64.2.1.nuspec new file mode 100644 index 0000000000..d844dbef1a --- /dev/null +++ b/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.x64.2.1.nuspec @@ -0,0 +1,18 @@ + + + + VS.Redist.Common.Net.Core.SDK.x64.2.1 + 1.0.0 + VS.Redist.Common.Net.Core.SDK.x64.2.1 + Microsoft + Microsoft + https://www.microsoft.com/net/dotnet_library_license.htm + https://github.com/dotnet/cli + true + Windows Installers (x64) for .Net Core SDK + © Microsoft Corporation. All rights reserved. + + + + + \ No newline at end of file diff --git a/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.x86.2.1.nuspec b/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.x86.2.1.nuspec new file mode 100644 index 0000000000..b631a29650 --- /dev/null +++ b/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.x86.2.1.nuspec @@ -0,0 +1,18 @@ + + + + VS.Redist.Common.Net.Core.SDK.x86.2.1 + 1.0.0 + VS.Redist.Common.Net.Core.SDK.x86.2.1 + Microsoft + Microsoft + https://www.microsoft.com/net/dotnet_library_license.htm + https://github.com/dotnet/cli + true + Windows Installer (x86) for .Net Core SDK + © Microsoft Corporation. All rights reserved. + + + + + \ No newline at end of file diff --git a/resources/MSBuildImports/15.0/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets b/resources/MSBuildImports/15.0/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets index 0b4916558d..251c09a7ae 100644 --- a/resources/MSBuildImports/15.0/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets +++ b/resources/MSBuildImports/15.0/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets @@ -14,7 +14,7 @@ Copyright (c) .NET Foundation. All rights reserved. $(MSBuildExtensionsPath)\Microsoft.TestPlatform.Build.dll $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - + - net461 - $(MicrosoftNETCoreAppPackageVersion) Exe ../../tools/Key.snk @@ -27,9 +19,9 @@ - - - + + + @@ -39,11 +31,4 @@ - - - - - diff --git a/test/Microsoft.DotNet.ToolPackage.Tests/Microsoft.DotNet.ToolPackage.Tests.csproj b/test/Microsoft.DotNet.ToolPackage.Tests/Microsoft.DotNet.ToolPackage.Tests.csproj index d60eb79a7f..3f55fd37af 100644 --- a/test/Microsoft.DotNet.ToolPackage.Tests/Microsoft.DotNet.ToolPackage.Tests.csproj +++ b/test/Microsoft.DotNet.ToolPackage.Tests/Microsoft.DotNet.ToolPackage.Tests.csproj @@ -50,6 +50,11 @@ + + + + + @@ -67,6 +72,19 @@ + + + $(BaseOutputPath)/TestAsset/SampleGlobalToolWithDifferentCasing + + + + + + + + + + $(BaseOutputPath)/TestAsset/SampleGlobalToolWithShim diff --git a/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/ConsoleDemoWithCasing.csproj b/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/ConsoleDemoWithCasing.csproj new file mode 100644 index 0000000000..ffd96353d9 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/ConsoleDemoWithCasing.csproj @@ -0,0 +1,7 @@ + + + Exe + netcoreapp2.1 + ConsoleDemoWithCasing + + diff --git a/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/DotnetToolSettings.xml b/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/DotnetToolSettings.xml new file mode 100644 index 0000000000..98734a9d56 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/DotnetToolSettings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/Program.cs b/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/Program.cs new file mode 100644 index 0000000000..f0da2f2350 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/Program.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +namespace ConsoleDemoWithCasing +{ + class Program + { + static void Main(string[] args) + { + var greeting = "Hello World from Global Tool"; + Console.WriteLine(greeting); + } + } +} diff --git a/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/includepublish.nuspec b/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/includepublish.nuspec new file mode 100644 index 0000000000..db3b0787c0 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackage.Tests/SampleGlobalToolWithDifferentCasing/includepublish.nuspec @@ -0,0 +1,16 @@ + + + + Global.Tool.Console.Demo.With.Casing + 2.0.4 + test app + testauthor + + + + + + + + + diff --git a/test/Microsoft.DotNet.ToolPackage.Tests/ToolPackageInstallerTests.cs b/test/Microsoft.DotNet.ToolPackage.Tests/ToolPackageInstallerTests.cs index d2742812dd..f0eb1e9227 100644 --- a/test/Microsoft.DotNet.ToolPackage.Tests/ToolPackageInstallerTests.cs +++ b/test/Microsoft.DotNet.ToolPackage.Tests/ToolPackageInstallerTests.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Reflection; using System.Transactions; +using System.Threading; using FluentAssertions; using Microsoft.DotNet.Tools.Test.Utilities; using Microsoft.DotNet.Cli; @@ -651,6 +652,61 @@ public void GivenAComplexVersionRangeInstallSucceeds(bool testMockBehaviorIsInSy package.Uninstall(); } + [NonWindowsOnlyTheory] + [InlineData(false)] + [InlineData(true)] + // repro https://github.com/dotnet/cli/issues/10101 + public void GivenAPackageWithCasingAndenUSPOSIXInstallSucceeds(bool testMockBehaviorIsInSync) + { + var nugetConfigPath = WriteNugetConfigFileToPointToTheFeed(); + var emptySource = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(emptySource); + + var packageId = new PackageId("Global.Tool.Console.Demo.With.Casing"); + var packageVersion = "2.0.4"; + var feed = new MockFeed + { + Type = MockFeedType.ImplicitAdditionalFeed, + Uri = nugetConfigPath.Value, + Packages = new List + { + new MockFeedPackage + { + PackageId = packageId.ToString(), + Version = packageVersion, + } + } + }; + + var (store, installer, reporter, fileSystem) = Setup( + useMock: testMockBehaviorIsInSync, + feeds: new[] { feed }); + + CultureInfo currentCultureBefore = CultureInfo.CurrentCulture; + try + { + CultureInfo.CurrentCulture = new CultureInfo("en-US-POSIX"); + IToolPackage package = null; + Action action = () => package = installer.InstallPackage( + new PackageLocation( + nugetConfig: nugetConfigPath, + additionalFeeds: new[] { emptySource }), + packageId: packageId, + versionRange: VersionRange.Parse(packageVersion), + targetFramework: _testTargetframework); + + action.ShouldNotThrow(); + + fileSystem.File.Exists(package.Commands[0].Executable.Value).Should().BeTrue($"{package.Commands[0].Executable.Value} should exist"); + + package.Uninstall(); + } + finally + { + CultureInfo.CurrentCulture = currentCultureBefore; + } + } + private static void AssertPackageInstall( BufferedReporter reporter, IFileSystem fileSystem, diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs index b8f3ca9cca..e44668917c 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs @@ -230,6 +230,8 @@ private void RemoveCliGeneratedEnvironmentVariablesFrom(ProcessStartInfo psi) private void AddEnvironmentVariablesTo(ProcessStartInfo psi) { + AddDotnetToolPathToAvoidSettingPermanentEnvInBuildMachineOnWindows(); + foreach (var item in Environment) { #if NET451 @@ -243,6 +245,31 @@ private void AddEnvironmentVariablesTo(ProcessStartInfo psi) psi.Environment["TEST_PACKAGES"] = System.Environment.GetEnvironmentVariable("TEST_PACKAGES"); } + private void AddDotnetToolPathToAvoidSettingPermanentEnvInBuildMachineOnWindows() + { + string home = string.Empty; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + if (!Environment.TryGetValue("DOTNET_CLI_HOME", out home) || string.IsNullOrEmpty(home)) + { + Environment.TryGetValue("USERPROFILE", out home); + } + } + + if (!string.IsNullOrEmpty(home)) + { + var dotnetToolPath = Path.Combine(home, ".dotnet", "tools"); + if (Environment.ContainsKey("PATH")) + { + Environment["PATH"] = Environment["PATH"] + ";" + dotnetToolPath; + } + else + { + Environment["PATH"] = dotnetToolPath; + } + } + } + private void AddWorkingDirectoryTo(ProcessStartInfo psi) { if (!string.IsNullOrWhiteSpace(WorkingDirectory)) diff --git a/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs index e4ae267414..a623c5d82a 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs @@ -29,6 +29,10 @@ public class GivenDotnetRestoreInvocation [InlineData(new string[] { "--no-dependencies" }, "-property:RestoreRecursive=false")] [InlineData(new string[] { "-v", "minimal" }, @"-verbosity:minimal")] [InlineData(new string[] { "--verbosity", "minimal" }, @"-verbosity:minimal")] + [InlineData(new string[] { "--use-lock-file" }, "-property:RestorePackagesWithLockFile=true")] + [InlineData(new string[] { "--locked-mode" }, "-property:RestoreLockedMode=true")] + [InlineData(new string[] { "--force-evaluate" }, "-property:RestoreForceEvaluate=true")] + [InlineData(new string[] { "--lock-file-path", "" }, "-property:NuGetLockFilePath=")] public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) { expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index 46188a7a48..145146ffed 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -72,11 +72,28 @@ public void ItDoesNotImplicitlyRestoreAProjectWhenTestingWithTheNoRestoreOption( new DotnetTestCommand() .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore") + .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore /p:IsTestProject=true") .Should().Fail() .And.HaveStdOutContaining("project.assets.json"); } + [Fact] + public void ItDoesNotRunTestsIfThereIsNoIsTestProject() + { + string testAppName = "VSTestCore"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var testProjectDirectory = testInstance.Root.FullName; + + new DotnetTestCommand() + .WithWorkingDirectory(testProjectDirectory) + .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore") + .Should().Pass() + .And.HaveStdOutContaining("Skipping running test for project"); + } + [Fact] public void XunitSingleTFM() {