diff --git a/TestAssets/TestProjects/TestRazorApp/TestRazorApp.csproj b/TestAssets/TestProjects/TestRazorApp/TestRazorApp.csproj index 59cfc871f..611bb08eb 100644 --- a/TestAssets/TestProjects/TestRazorApp/TestRazorApp.csproj +++ b/TestAssets/TestProjects/TestRazorApp/TestRazorApp.csproj @@ -6,6 +6,6 @@ - + diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index 757d6ec36..d574b1789 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -10,7 +10,7 @@ ($(Rid.StartsWith('rhel.6')) OR $(Rid.StartsWith('linux-musl')) OR $(Rid.StartsWith('fedora.27')) - OR $(Rid.StartsWith('opensuse.43.2')) + OR $(Rid.StartsWith('opensuse.42.3')) OR $(Rid.StartsWith('ubuntu.18.04')))">true false true @@ -19,16 +19,18 @@ AND '$(Rid)' != 'rhel.6-x64' AND '$(Rid)' != 'linux-musl-x64' AND '$(Rid)' != 'fedora.27-x64' - AND '$(Rid)' != 'opensuse.43.2-x64' + AND '$(Rid)' != 'opensuse.42.3-x64' AND '$(Rid)' != 'ubuntu.18.04-x64'">true true true - + - NU1701 + + + NU1701;NU5104 true diff --git a/build/BundledDotnetTools.proj b/build/BundledDotnetTools.proj index 3c07a51f0..57837ea01 100644 --- a/build/BundledDotnetTools.proj +++ b/build/BundledDotnetTools.proj @@ -13,12 +13,11 @@ Condition="!Exists('$(DotnetToolsNuPkgPath)/$(TemplateFillInPackageName.ToLower())')"> - --runtime any + --runtime any /p:RestoreProjectStyle=DotnetToolReference $(DotnetToolsRestoreAdditionalParameters) /p:TargetFramework=$(CliTargetFramework) $(DotnetToolsRestoreAdditionalParameters) /p:TemplateFillInPackageName=$(TemplateFillInPackageName) $(DotnetToolsRestoreAdditionalParameters) /p:TemplateFillInPackageVersion=$(TemplateFillInPackageVersion) $(DotnetToolsRestoreAdditionalParameters) /p:RestorePackagesPath=$(DotnetToolsLayoutDirectory) - $(DotnetToolsRestoreAdditionalParameters) /p:RestoreProjectStyle=$(DotnetToolsRestoreProjectStyle) - - - - - + + + + + diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index 40003b788..45234b98b 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -6,24 +6,21 @@ -internal - - -upgrade - - dotnet-runtime-deps-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerEndSuffix)$(InstallerExtension) + dotnet-runtime-deps-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedRuntimeDepsInstallerFileName) $(CoreSetupRid) x64 - dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerEndSuffix)$(InstallerExtension) + dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedSharedHostInstallerFileName) - dotnet-hostfxr$(InstallerStartSuffix)-$(HostFxrVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerEndSuffix)$(InstallerExtension) + dotnet-hostfxr$(InstallerStartSuffix)-$(HostFxrVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedHostFxrInstallerFileName) - dotnet-runtime$(InstallerStartSuffix)-$(MicrosoftNETCoreAppPackageVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerEndSuffix)$(InstallerExtension) + dotnet-runtime$(InstallerStartSuffix)-$(MicrosoftNETCoreAppPackageVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedSharedFrameworkInstallerFileName) @@ -37,7 +34,7 @@ $(AspNetCoreSharedFxInstallerRid) x64 - aspnetcore-runtime-$(AspNetCoreVersion)-$(AspNetCoreSharedFxInstallerRid)$(InstallerEndSuffix)$(InstallerExtension) + aspnetcore-runtime-$(AspNetCoreVersion)-$(AspNetCoreSharedFxInstallerRid)$(InstallerExtension) aspnetcore-runtime-internal-$(AspNetCoreVersion)-$(AspNetCoreSharedFxInstallerRid).wixlib $(PackagesDirectory)/$(DownloadedAspNetCoreSharedFxInstallerFileName) diff --git a/build/BundledTemplates.props b/build/BundledTemplates.props index e1cb85a8f..108e19f92 100644 --- a/build/BundledTemplates.props +++ b/build/BundledTemplates.props @@ -7,5 +7,7 @@ + + diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 232f93285..49bfc555a 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -3,14 +3,21 @@ 2.2.0-preview1-34355 $(MicrosoftAspNetCoreAllPackageVersion) + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 2.2.0-preview1-26609-02 $(MicrosoftNETCoreAppPackageVersion) - 15.8.0-preview-000078 + 15.8.0-preview-000138 $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) - 10.1.4-rtm-180515-0 + 10.2.0-rtm-180620-0 2.8.3-beta6-62923-07 $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) @@ -19,12 +26,12 @@ 1.0.0-preview1-62924-06 $(MicrosoftNETSdkPackageVersion) $(MicrosoftAspNetCoreAppPackageVersion) - 2.1.300 + 2.1.400-preview1-20180614-1774926 $(MicrosoftNETSdkWebPackageVersion) $(MicrosoftNETSdkWebPackageVersion) 1.0.2-beta3 $(MicrosoftDotNetCommonItemTemplatesPackageVersion) - 1.0.2-beta3 + 1.0.2-beta3-20180614-1775839 1.0.2-beta3 $(MicrosoftTemplateEngineCliPackageVersion) $(MicrosoftTemplateEngineCliPackageVersion) @@ -36,7 +43,7 @@ 1.3.1 $(MicrosoftDotNetProjectJsonMigrationPackageVersion) 0.2.0-beta-62628-01 - 4.8.0-preview3.5244 + 4.8.0-preview3.5278 $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) @@ -46,11 +53,12 @@ $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) - 15.8.0-preview-20180510-03 + 15.8.0-preview-20180605-02 $(MicrosoftNETTestSdkPackageVersion) $(MicrosoftNETTestSdkPackageVersion) 0.2.0-beta-000042 0.2.0 + 1.5.1 diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets index 1ada841ca..f5365724a 100644 --- a/build/MSBuildExtensions.targets +++ b/build/MSBuildExtensions.targets @@ -116,6 +116,13 @@ <_AspNetCoreAllPackageVersion>$(MicrosoftAspNetCoreAllPackageVersion) <_AspNetCoreAppPackageVersion>$(MicrosoftAspNetCoreAppPackageVersion) + + <_DefaultPatchVersionForAspNetCoreAll2_1>2.1.1 + <_DefaultPatchVersionForAspNetCoreApp2_1>$(_DefaultPatchVersionForAspNetCoreAll2_1) + + <_DefaultPatchVersionForAspNetCoreAll2_1 Condition="$(_AspNetCoreAllPackageVersion.StartsWith('$(_DefaultPatchVersionForAspNetCoreAll2_1)-'))">$(_AspNetCoreAllPackageVersion) + <_DefaultPatchVersionForAspNetCoreApp2_1 Condition="$(_AspNetCoreAppPackageVersion.StartsWith('$(_DefaultPatchVersionForAspNetCoreApp2_1)-'))">$(_AspNetCoreAppPackageVersion) + <_NETCoreAppTargetFrameworkVersion>$(_NETCoreAppPackageVersion.Split('.')[0]).$(_NETCoreAppPackageVersion.Split('.')[1]) <_NETStandardTargetFrameworkVersion>$(_NETStandardLibraryPackageVersion.Split('.')[0]).$(_NETStandardLibraryPackageVersion.Split('.')[1]) @@ -125,6 +132,16 @@ <_NETCoreSdkIsPreview Condition=" '$(DropSuffix)' != 'true' ">true + + + + + @@ -163,6 +180,7 @@ Copyright (c) .NET Foundation. All rights reserved. $(_NETCoreAppTargetFrameworkVersion) $(_NETCoreAppPackageVersion) + $(_UseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion) $(_NETStandardTargetFrameworkVersion) $(_NETStandardLibraryPackageVersion) $(_NETCorePlatformsPackageVersion) @@ -170,10 +188,14 @@ Copyright (c) .NET Foundation. All rights reserved. $(SdkVersion) <_NETCoreSdkIsPreview>$(_NETCoreSdkIsPreview) + + $(_DefaultPatchVersionForAspNetCoreAll2_1) + $(_DefaultPatchVersionForAspNetCoreApp2_1) + - 1.0.11 - 1.1.8 - 2.0.7 + 1.0.12 + 1.1.9 + 2.0.9 ]]> diff --git a/build/Microsoft.DotNet.Cli.tasks b/build/Microsoft.DotNet.Cli.tasks index 901a48f84..812c04925 100644 --- a/build/Microsoft.DotNet.Cli.tasks +++ b/build/Microsoft.DotNet.Cli.tasks @@ -23,6 +23,7 @@ + diff --git a/build/NugetConfigFile.targets b/build/NugetConfigFile.targets index 894278c1f..adb6c3529 100644 --- a/build/NugetConfigFile.targets +++ b/build/NugetConfigFile.targets @@ -22,6 +22,8 @@ + + diff --git a/build/Publish.targets b/build/Publish.targets index 70819a6b1..58d6057c1 100644 --- a/build/Publish.targets +++ b/build/Publish.targets @@ -54,6 +54,8 @@ Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "/> + diff --git a/build/Test.targets b/build/Test.targets index 39cc79f83..9f4ce8778 100644 --- a/build/Test.targets +++ b/build/Test.targets @@ -89,7 +89,7 @@ - diff --git a/build/compile/LzmaArchive.targets b/build/compile/LzmaArchive.targets index a1fa07e91..2d55fd502 100644 --- a/build/compile/LzmaArchive.targets +++ b/build/compile/LzmaArchive.targets @@ -3,6 +3,7 @@ $(SdkOutputDirectory)/nuGetPackagesArchive.lzma + $(PackagesDirectory)/nuGetPackagesArchive.lzma nuGetPackagesArchive-$(AspNetCoreVersion).lzma $(IntermediateDirectory)/$(NugetPackagesArchiveName) $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(NugetPackagesArchiveName) @@ -17,5 +18,6 @@ ContinueOnError="WarnAndContinue" /> + diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index 0e516f440..68390e2d7 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -94,12 +94,12 @@ UseHardlinksIfPossible="False" /> - - - - - - + + + + + + - - - - - - + + + + + + diff --git a/build/package/Installer.DEB.targets b/build/package/Installer.DEB.targets index 349089d86..f6f9abfa9 100644 --- a/build/package/Installer.DEB.targets +++ b/build/package/Installer.DEB.targets @@ -30,7 +30,11 @@ $(MicrosoftNETCoreAppMajorMinorVersion) dotnet-runtime-$(SharedFxDebianPackageFileVersion) $(SharedFxDebianPackageFileName.ToLower()) - dotnet-runtime-$(SharedFxDebianPackageVersion) + + + dotnet-runtime-$(SharedFxDebianPackageFileVersion) + $(SharedFxDebianPackageName.ToLower()) $(HostFxrMajorMinorVersion) dotnet-hostfxr-$(HostFxrDebianPackageVersion) @@ -38,7 +42,11 @@ dotnet-host aspnetcore-runtime-$(AspNetCoreVersion) $(AspNetCoreSharedFxDebianPackageFileName.ToLower()) - aspnetcore-runtime-$(AspNetCoreMajorMinorVersion) + + + aspnetcore-runtime-$(AspNetCoreVersion) + $(AspNetCoreSharedFxDebianPackageName.ToLower()) diff --git a/build_projects/dotnet-cli-build/GetUseBundledVersionAsDefaultVersion.cs b/build_projects/dotnet-cli-build/GetUseBundledVersionAsDefaultVersion.cs new file mode 100644 index 000000000..91d10694a --- /dev/null +++ b/build_projects/dotnet-cli-build/GetUseBundledVersionAsDefaultVersion.cs @@ -0,0 +1,30 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.IO; +using Microsoft.Build.Utilities; +using Microsoft.Build.Framework; +using Microsoft.DotNet.Cli.Build.Framework; +using NuGet.Versioning; + +namespace Microsoft.DotNet.Cli.Build +{ + public class GetUseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion : Task + { + [Required] + public string BundledNETCoreAppPackageVersion { get; set; } + + [Output] + public string UseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion { get; set; } + + public override bool Execute() + { + var parsedVersion = NuGetVersion.Parse(BundledNETCoreAppPackageVersion); + UseBundledNETCoreAppPackageVersionAsDefaultNetCorePatchVersion = + (parsedVersion.Patch == 0) && parsedVersion.IsPrerelease ? "true" : "false"; + + return true; + } + } +} diff --git a/netci.groovy b/netci.groovy index c2283cd23..3d49daada 100644 --- a/netci.groovy +++ b/netci.groovy @@ -18,7 +18,9 @@ def platformList = [ 'Linux:arm64:Debug', 'Linux-musl:x64:Debug', 'Linux:x64:Release', - 'opensuse.43.2:x64:Debug', + 'Linux_NoSuffix:arm:Release', + 'Linux_NoSuffix:x64:Release', + 'opensuse.42.3:x64:Debug', 'OSX10.12:x64:Release', 'RHEL6:x64:Debug', 'RHEL7.2:x64:Release', @@ -27,7 +29,8 @@ def platformList = [ 'ubuntu.18.04:x64:Debug', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', - 'Windows_NT_ES:x64:Debug' + 'Windows_NT_ES:x64:Debug', + 'Windows_NT_NoSuffix:x64:Release' ] def static getBuildJobName(def configuration, def os, def architecture) { @@ -42,50 +45,62 @@ platformList.each { platform -> // Calculate job name def jobName = getBuildJobName(configuration, os, architecture) - def buildCommand = ''; + def baseBatchBuildCommand = ".\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -Targets Default"; + def baseShellBuildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --targets Default"; // Calculate the build command - if (os == 'Windows_NT') { - buildCommand = ".\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -Targets Default" + if (os.startsWith("Windows_NT")) { + osUsedForMachineAffinity = 'Windows_NT' + buildCommand = "${baseBatchBuildCommand}" + if (os == 'Windows_NT_ES') { + buildCommand = """ +set DOTNET_CLI_UI_LANGUAGE=es +${buildCommand} +""" + } + else if (os == 'Windows_NT_NoSuffix') { + buildCommand = """ +set DropSuffix=true +${buildCommand} +""" + } } else if (os == 'Windows_2016') { - buildCommand = ".\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -RunInstallerTestsInDocker -Targets Default" + buildCommand = "${baseBatchBuildCommand} -RunInstallerTestsInDocker" } - else if (os == 'Windows_NT_ES') { - osUsedForMachineAffinity = 'Windows_NT' - buildCommand = """ -set DOTNET_CLI_UI_LANGUAGE=es -.\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -Targets Default + else if (os.startsWith("Linux")) { + osUsedForMachineAffinity = 'Ubuntu16.04'; + if (os == 'Linux-musl') { + buildCommand = "${baseShellBuildCommand} --runtime-id linux-musl-x64 --docker alpine.3.6" + } + else + { + buildCommand = "${baseShellBuildCommand} --linux-portable" + if ((architecture == 'arm') || (architecture == 'arm64')) { + buildCommand = "${buildCommand} --architecture ${architecture} /p:CLIBUILD_SKIP_TESTS=true" + } + if (os == 'Linux_NoSuffix') { + buildCommand = """ +export DropSuffix=true +${buildCommand} """ + } + } } else if (os == 'Ubuntu') { - buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --docker ubuntu.14.04 --targets Default" - } - else if (os == 'Linux') { - osUsedForMachineAffinity = 'Ubuntu16.04'; - if ((architecture == 'arm') || (architecture == 'arm64')) { - buildCommand = "./build.sh --linux-portable --skip-prereqs --architecture ${architecture} --configuration ${configuration} --targets Default /p:CLIBUILD_SKIP_TESTS=true" - } - else { - buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --targets Default" - } + buildCommand = "${baseShellBuildCommand} --docker ubuntu.14.04" } else if (os == 'RHEL6') { osUsedForMachineAffinity = 'Ubuntu16.04'; - buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --runtime-id rhel.6-x64 --docker rhel.6 --targets Default" + buildCommand = "${baseShellBuildCommand} --runtime-id rhel.6-x64 --docker rhel.6" } - else if (os == 'Linux-musl') { - osUsedForMachineAffinity = 'Ubuntu16.04'; - buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --runtime-id linux-musl-x64 --docker alpine.3.6 --targets Default" - } - else if (os == 'ubuntu.18.04' || os == 'fedora.27' || os == 'opensuse.43.2') { + else if (os == 'ubuntu.18.04' || os == 'fedora.27' || os == 'opensuse.42.3') { osUsedForMachineAffinity = 'Ubuntu16.04' osVersionUsedForMachineAffinity = 'latest-docker' - buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --docker ${os} --targets Default" + buildCommand = "${baseShellBuildCommand} --docker ${os} --linux-portable" } else { - // Jenkins non-Ubuntu CI machines don't have docker - buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --targets Default" + buildCommand = "${baseShellBuildCommand}" } def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { @@ -110,10 +125,10 @@ set DOTNET_CLI_UI_LANGUAGE=es } Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${architecture} ${configuration} Build") - def archiveSettings = new ArchivalSettings() - archiveSettings.addFiles("test/**/*.trx") - archiveSettings.setFailIfNothingArchived() - archiveSettings.setArchiveOnFailure() + def archiveSettings = new ArchivalSettings() + archiveSettings.addFiles("test/**/*.trx") + archiveSettings.setFailIfNothingArchived() + archiveSettings.setArchiveOnFailure() Utilities.addArchival(newJob, archiveSettings) } diff --git a/run-build.ps1 b/run-build.ps1 index 30e495d03..344cf4374 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -89,8 +89,8 @@ if($Architecture.StartsWith("arm", [StringComparison]::OrdinalIgnoreCase)) $InstallArchitecture = "x64" } -Write-Output "$dotnetInstallPath -version ""2.2.0-preview1-007799"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$InstallArchitecture""" -Invoke-Expression "$dotnetInstallPath -version ""2.2.0-preview1-007799"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$InstallArchitecture""" +Write-Output "$dotnetInstallPath -version ""2.1.300"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$InstallArchitecture""" +Invoke-Expression "$dotnetInstallPath -version ""2.1.300"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$InstallArchitecture""" if ($LastExitCode -ne 0) { diff --git a/run-build.sh b/run-build.sh index b22d4d1fc..1f2ed25a9 100755 --- a/run-build.sh +++ b/run-build.sh @@ -162,7 +162,7 @@ if [[ $archlower == 'arm'* ]]; then fi if [ "$STAGE0_SOURCE_DIR" == "" ]; then - (set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --version "2.2.0-preview1-007799" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$INSTALL_ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) + (set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --version "2.1.300" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$INSTALL_ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) else echo "Copying bootstrap cli from $STAGE0_SOURCE_DIR" cp -r $STAGE0_SOURCE_DIR/* "$DOTNET_INSTALL_DIR" diff --git a/scripts/docker/alpine.3.6/Dockerfile b/scripts/docker/alpine.3.6/Dockerfile index 746f1bd4b..2dc797963 100644 --- a/scripts/docker/alpine.3.6/Dockerfile +++ b/scripts/docker/alpine.3.6/Dockerfile @@ -9,6 +9,15 @@ FROM microsoft/dotnet-buildtools-prereqs:alpine-3.6-3148f11-20171119021156 # This Dockerfile doesn't use the USER_ID, but the parameter needs to be declared to prevent docker # from issuing a warning ARG USER_ID=0 +RUN adduser code_executor -u ${USER_ID} -G root -D +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permssions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home + +# Set user to the one we just created +USER ${USER_ID} # Set working directory WORKDIR /opt/code diff --git a/scripts/docker/opensuse.43.2/Dockerfile b/scripts/docker/opensuse.42.3/Dockerfile similarity index 100% rename from scripts/docker/opensuse.43.2/Dockerfile rename to scripts/docker/opensuse.42.3/Dockerfile diff --git a/src/Microsoft.DotNet.InternalAbstractions/DirectoryPath.cs b/src/Microsoft.DotNet.InternalAbstractions/DirectoryPath.cs index 3d578432e..c05177f61 100644 --- a/src/Microsoft.DotNet.InternalAbstractions/DirectoryPath.cs +++ b/src/Microsoft.DotNet.InternalAbstractions/DirectoryPath.cs @@ -10,8 +10,17 @@ namespace Microsoft.Extensions.EnvironmentAbstractions { public string Value { get; } + /// + /// Create DirectoryPath to repesent a absolute directory path. Note it may not exist. + /// + /// If the value is not rooted. Path.GetFullPath will be called during the consturctor. public DirectoryPath(string value) { + if (!Path.IsPathRooted(value)) + { + value = Path.GetFullPath(value); + } + Value = value; } @@ -46,7 +55,7 @@ namespace Microsoft.Extensions.EnvironmentAbstractions public DirectoryPath GetParentPath() { - return new DirectoryPath(Directory.GetParent(Path.GetFullPath(Value)).FullName); + return new DirectoryPath(Path.GetDirectoryName(Value)); } } } diff --git a/src/Microsoft.DotNet.InternalAbstractions/FilePath.cs b/src/Microsoft.DotNet.InternalAbstractions/FilePath.cs index 9dbbf8c83..7b7caee28 100644 --- a/src/Microsoft.DotNet.InternalAbstractions/FilePath.cs +++ b/src/Microsoft.DotNet.InternalAbstractions/FilePath.cs @@ -9,8 +9,17 @@ namespace Microsoft.Extensions.EnvironmentAbstractions { public string Value { get; } + /// + /// Create FilePath to repesent a absolute file path. Note it may not exist. + /// + /// If the value is not rooted. Path.GetFullPath will be called during the consturctor. public FilePath(string value) { + if (!Path.IsPathRooted(value)) + { + value = Path.GetFullPath(value); + } + Value = value; } diff --git a/src/dotnet/Properties/AssemblyInfo.cs b/src/dotnet/Properties/AssemblyInfo.cs index b5f0b8fe0..8b1c62cd5 100644 --- a/src/dotnet/Properties/AssemblyInfo.cs +++ b/src/dotnet/Properties/AssemblyInfo.cs @@ -9,6 +9,7 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("dotnet-add-package.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-add-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-help.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("dotnet-publish.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-list-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-remove-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-remove-package.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/dotnet/ToolPackage/ToolPackageInstaller.cs b/src/dotnet/ToolPackage/ToolPackageInstaller.cs index aa63ae8c7..1903d2f84 100644 --- a/src/dotnet/ToolPackage/ToolPackageInstaller.cs +++ b/src/dotnet/ToolPackage/ToolPackageInstaller.cs @@ -135,6 +135,7 @@ namespace Microsoft.DotNet.ToolPackage var tempProjectContent = new XDocument( new XElement("Project", new XElement("PropertyGroup", + // due to https://github.com/Microsoft/msbuild/issues/1603 -- import SDK after setting MsBuildProjectExtensionsPath new XElement("MsBuildProjectExtensionsPath", assetJsonOutputDirectory.Value)), // change the output directory of asset.json new XElement(("Import"), new XAttribute("Project", "Sdk.props"), @@ -154,7 +155,7 @@ namespace Microsoft.DotNet.ToolPackage new XElement("PackageReference", new XAttribute("Include", packageId.ToString()), new XAttribute("Version", - versionRange?.ToString("S", new VersionRangeFormatter()) ?? "*"))), // nuget will restore latest stable for * + versionRange?.ToString("N", new VersionRangeFormatter()) ?? "*"))), // nuget will restore latest stable for * and format N is the normalization format new XElement(("Import"), new XAttribute("Project", "Sdk.targets"), new XAttribute("Sdk", "Microsoft.NET.Sdk")))); diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs b/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs index 734892649..1f4dbfb35 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs @@ -47,7 +47,11 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.CmdPackageDirectoryDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdPackageDirectory) - .ForwardAsSingle(o => $"--package-directory {o.Arguments.Single()}"))); + .ForwardAsSingle(o => $"--package-directory {o.Arguments.Single()}")), + Create.Option("--interactive", + LocalizableStrings.CmdInteractiveRestoreDescription, + Accept.NoArguments() + .ForwardAs("--interactive"))); } public static IEnumerable QueryNuGet(string match) diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx index 36320b010..ec8af6d18 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx @@ -165,4 +165,7 @@ Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf index d5c54d45c..baa0876b0 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf @@ -82,6 +82,11 @@ Nejde generovat dočasný soubor pro projekt {0}. Není možné přidat odkaz na balíček. Vyprázdněte prosím dočasný adresář a zkuste to znovu. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf index e31bd2209..069dddf4a 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf @@ -82,6 +82,11 @@ Für das Projekt "{0}" kann keine temporäre Datei generiert werden. Ein Paketverweis kann nicht hinzugefügt werden. Löschen Sie das temporäre Verzeichnis, und versuchen Sie es noch mal. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf index 017b2c38c..0d85afed0 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf @@ -82,6 +82,11 @@ No se puede generar un archivo temporal para el proyecto "{0}". No se puede agregar la referencia del paquete. Borre el directorio temporal e inténtelo de nuevo. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf index 8978faa6b..645d9cff3 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf @@ -82,6 +82,11 @@ Impossible de générer un fichier temporaire pour le projet '{0}'. Impossible d'ajouter une référence de package. Effacez le répertoire temporaire et réessayez. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf index 4c5ac6175..6ed433437 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf @@ -82,6 +82,11 @@ Non è possibile generare un file temporaneo per il progetto '{0}'. Non è possibile aggiungere il riferimento al pacchetto. Cancellare la directory temp e riprovare. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf index b10482a0b..109ce52fe 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf @@ -82,6 +82,11 @@ プロジェクト '{0}' の一時ファイルを生成できません。パッケージ参照を追加できません。一時ディレクトリをクリアして、もう一度お試しください。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf index 6a9b7e488..45cbbc8b6 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf @@ -82,6 +82,11 @@ '{0}' 프로젝트에 대한 임시 파일을 생성할 수 없습니다. 패키지 참조를 추가할 수 없습니다. 임시 디렉터리를 지우고 다시 시도하세요. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf index 979a2eb13..5152594e8 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf @@ -82,6 +82,11 @@ Nie można wygenerować pliku tymczasowego dla projektu „{0}”. Nie można dodać odwołania do pakietu. Wyczyść katalog tymczasowy i spróbuj ponownie. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf index 5e1fac842..691abe9b4 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf @@ -82,6 +82,11 @@ Não é possível gerar um arquivo temporário para o projeto '{0}'. Não é possível adicionar a referência do pacote. Limpe i diretório temporário e tente novamente. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf index 1ec2aa0b4..945f8b997 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf @@ -82,6 +82,11 @@ Не удалось создать временный файл для проекта "{0}". Невозможно добавить ссылку на пакет. Очистите временный каталог и повторите попытку. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf index bc0d1b922..c5b60009f 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf @@ -82,6 +82,11 @@ '{0}' projesi için bir geçici dosya oluşturulamıyor. Paket başvurusu eklenemiyor. Lütfen geçici dizini temizleyin ve yeniden deneyin. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf index 66b78fa46..ff758631e 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf @@ -82,6 +82,11 @@ 未能为项目“{0}”生成临时文件。无法添加包引用。请清除临时目录,再重试。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf index 889ffe5a1..89cc23439 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf @@ -82,6 +82,11 @@ 無法產生專案 '{0}' 的暫存檔案。無法新增套件參考。請清除暫存目錄並再試一次。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-nuget/Program.cs b/src/dotnet/commands/dotnet-nuget/Program.cs index 8e6378b41..1871da2cb 100644 --- a/src/dotnet/commands/dotnet-nuget/Program.cs +++ b/src/dotnet/commands/dotnet-nuget/Program.cs @@ -35,9 +35,14 @@ namespace Microsoft.DotNet.Tools.NuGet public int Run(string[] args) { var nugetApp = new NuGetForwardingApp(args); - + nugetApp.WithEnvironmentVariable("DOTNET_HOST_PATH", GetDotnetPath()); return nugetApp.Execute(); } } + + private static string GetDotnetPath() + { + return new Muxer().MuxerPath; + } } } diff --git a/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx b/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx index ebdf1fe0a..59c01c3af 100644 --- a/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx @@ -135,9 +135,16 @@ The path to a target manifest file that contains the list of packages to be excluded from the publish step. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + MODE Do not build the project before publishing. Implies --no-restore. @@ -146,10 +153,16 @@ The default is 'true' if a runtime identifier is specified. The target framework to publish for. The target framework has to be specified in the project file. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. The configuration to publish for. The default for most projects is 'Debug'. + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + The specified publish mode '{0}' is not supported. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/Program.cs b/src/dotnet/commands/dotnet-publish/Program.cs index ed8f3260c..631416b82 100644 --- a/src/dotnet/commands/dotnet-publish/Program.cs +++ b/src/dotnet/commands/dotnet-publish/Program.cs @@ -39,6 +39,37 @@ namespace Microsoft.DotNet.Tools.Publish var appliedPublishOption = result["dotnet"]["publish"]; + if (appliedPublishOption.HasOption("mode") && appliedPublishOption.HasOption("self-contained")) + { + throw new GracefulException(LocalizableStrings.PublishModeAndSelfContainedOptionsConflict); + } + + var mode = appliedPublishOption.ValueOrDefault("mode"); + switch (mode) + { + case null: + break; + + case PublishCommandParser.SelfContainedMode: + msbuildArgs.Add("-p:SelfContained=true"); + break; + + case PublishCommandParser.FxDependentMode: + msbuildArgs.Add("-p:SelfContained=false"); + break; + + case PublishCommandParser.FxDependentNoExeMode: + msbuildArgs.Add("-p:SelfContained=false"); + msbuildArgs.Add("-p:UseAppHost=false"); + break; + + default: + throw new GracefulException( + string.Format( + LocalizableStrings.UnsupportedPublishMode, + mode)); + } + msbuildArgs.AddRange(appliedPublishOption.OptionValuesToBeForwarded()); msbuildArgs.AddRange(appliedPublishOption.Arguments); diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs index 19ee3ec12..96519680f 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -10,6 +10,10 @@ namespace Microsoft.DotNet.Cli { internal static class PublishCommandParser { + public const string SelfContainedMode = "self-contained"; + public const string FxDependentMode = "fx-dependent"; + public const string FxDependentNoExeMode = "fx-dependent-no-exe"; + public static Command Publish() => CreateWithRestoreOptions.Command( "publish", @@ -40,7 +44,7 @@ namespace Microsoft.DotNet.Cli Accept.NoArguments().ForwardAs("-property:NoBuild=true")), Create.Option( "--self-contained", - LocalizableStrings.SelfContainedOptionDescription, + "", // Hidden option for backwards-compatibility (now '--mode self-contained'). Accept.ZeroOrOneArgument() .WithSuggestionsFrom("true", "false") .ForwardAsSingle(o => @@ -48,6 +52,14 @@ namespace Microsoft.DotNet.Cli string value = o.Arguments.Any() ? o.Arguments.Single() : "true"; return $"-property:SelfContained={value}"; })), + Create.Option( + "--mode", + LocalizableStrings.ModeOptionDescription, + Accept.AnyOneOf( + SelfContainedMode, + FxDependentMode, + FxDependentNoExeMode) + .With(name: LocalizableStrings.ModeOptionName)), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); } diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf index 43f2f3c18..33ddc6820 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf @@ -37,22 +37,15 @@ Cesta k cílovému souboru manifestu obsahujícímu seznam balíčků, které se mají vyloučit z kroku publikování - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Publikuje spolu s aplikací modul runtime .NET Core, aby se tento modul nemusel instalovat na cílový počítač. -Výchozí hodnota je True, pokud je zadaný identifikátor modulu runtime. - - Do not build the project before publishing. Implies --no-restore. Nesestavujte projekt, dokud ho nepublikujete. Implikuje možnost --no-restore. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - Cílový modul runtime pro publikování. Používá se při vytváření nezávislého nasazení. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + Cílový modul runtime pro publikování. Používá se při vytváření nezávislého nasazení. Ve výchozím nastavení se publikuje aplikace závislá na architektuře. @@ -61,6 +54,36 @@ Ve výchozím nastavení se publikuje aplikace závislá na architektuře.Konfigurace pro publikování. Výchozí možností pro většinu projektů je Debug. + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf index de95ecb9a..7f2b370ec 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf @@ -37,22 +37,15 @@ Der Pfad zu einer Zielmanifestdatei, die die Liste der von der Veröffentlichung auszuschließenden Pakete enthält. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Veröffentlichen Sie die .NET Core-Runtime mit Ihrer Anwendung, damit die Runtime nicht auf dem Zielcomputer installiert werden muss. -Der Standardwert ist "true", wenn ein Runtimebezeichner angegeben ist. - - Do not build the project before publishing. Implies --no-restore. Erstellt das Projekt nicht vor dem Veröffentlichen. Impliziert "--no-restore". - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - Die Zielruntime für die Veröffentlichung. Diese wird zum Erstellen einer eigenständigen Bereitstellung verwendet. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + Die Zielruntime für die Veröffentlichung. Diese wird zum Erstellen einer eigenständigen Bereitstellung verwendet. Standardmäßig wird eine frameworkabhängige Anwendung veröffentlicht. @@ -61,6 +54,36 @@ Standardmäßig wird eine frameworkabhängige Anwendung veröffentlicht.Die Konfiguration für die Veröffentlichung. Der Standardwert für die meisten Projekte ist "Debug". + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf index fe398e90b..ed152e303 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf @@ -37,22 +37,15 @@ La ruta de acceso a un archivo de manifiesto de destino que contiene la lista de paquetes que se excluirán del paso de publicación. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Publica el tiempo de ejecución de .NET Core con su aplicación para que no sea necesario instalarlo en la máquina de destino. -Si se especifica un identificador de tiempo de ejecución, se toma como predeterminado el valor "true". - - Do not build the project before publishing. Implies --no-restore. No compile el proyecto antes de publicarlo. Implica --no-restore. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - El tiempo de ejecución de destino para el que se publica. Se usa cuando se crea una implementación autocontenida. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + El tiempo de ejecución de destino para el que se publica. Se usa cuando se crea una implementación autocontenida. El valor predeterminado es publicar una aplicación dependiente de la plataforma. @@ -61,6 +54,36 @@ El valor predeterminado es publicar una aplicación dependiente de la plataforma La configuración para la que se publica. El valor predeterminado para la mayoría de los proyectos es "Debug". + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf index f96a50e54..1f5cb582f 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf @@ -37,22 +37,15 @@ Chemin d'un fichier manifeste cible contenant la liste des packages à exclure de l'étape de publication. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Publiez le runtime .NET Core avec votre application pour éviter à l'utilisateur de l'installer sur la machine cible. -La valeur par défaut est 'true' si un identificateur de runtime est spécifié. - - Do not build the project before publishing. Implies --no-restore. Ne pas générer le projet avant la publication. Implique --no-restore. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - Runtime cible pour lequel la publication est effectuée. S'utilise pour la création d'un déploiement autonome. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + Runtime cible pour lequel la publication est effectuée. S'utilise pour la création d'un déploiement autonome. L'action par défaut consiste à publier une application qui dépend d'un framework. @@ -61,6 +54,36 @@ L'action par défaut consiste à publier une application qui dépend d'un framew Configuration pour laquelle la publication est effectuée. La valeur par défaut pour la plupart des projets est 'Debug'. + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf index 3e8eddac1..cf87a03ae 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf @@ -37,22 +37,15 @@ Percorso di un file manifesto di destinazione che contiene l'elenco di pacchetti da escludere dal passaggio di pubblicazione. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Pubblica il runtime di .NET Core con l'applicazione in modo che non sia necessario installarlo nel computer di destinazione. -Se si specifica un identificatore di runtime, l'impostazione predefinita è 'true'. - - Do not build the project before publishing. Implies --no-restore. Non compila il progetto prima della pubblicazione. Implica --no-restore. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - Runtime di destinazione per cui eseguire la pubblicazione. Viene usata durante la creazione della distribuzione indipendente. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + Runtime di destinazione per cui eseguire la pubblicazione. Viene usata durante la creazione della distribuzione indipendente. Per impostazione predefinita, viene pubblicata un'applicazione dipendente dal framework. @@ -61,6 +54,36 @@ Per impostazione predefinita, viene pubblicata un'applicazione dipendente dal fr Configurazione per cui eseguire la pubblicazione. L'impostazione predefinita per la maggior parte dei progetti è 'Debug'. + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf index 43149d7d4..c3ddfd748 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf @@ -37,22 +37,15 @@ 発行ステップから除外されるパッケージのリストを含むターゲット マニフェスト ファイルへのパス。 - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - ランタイムをターゲット マシンにインストールしなくてもよいよう、.NET Core ランタイムをアプリケーションと一緒に発行します。 -ランタイム ID が指定された場合、既定値は 'true' です。 - - Do not build the project before publishing. Implies --no-restore. 発行する前にプロジェクトをビルドしないでください。--no-restore を意味します。 - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - 発行する対象のターゲット ランタイム。これは、自己完結型の配置を作成する際に使用します。 + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + 発行する対象のターゲット ランタイム。これは、自己完結型の配置を作成する際に使用します。 既定では、フレームワーク依存アプリケーションを発行します。 @@ -61,6 +54,36 @@ The default is to publish a framework-dependent application. 発行する対象の構成。大部分のプロジェクトで、既定値は 'Debug' です。 + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf index ddeb725c3..03b88afc2 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf @@ -37,22 +37,15 @@ 게시 단계에서 제외할 패키지 목록이 들어 있는 대상 매니페스트 파일의 경로입니다. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - 런타임은 대상 컴퓨터에 설치할 필요가 없으므로 응용 프로그램과 함께 .NET Core 런타임을 게시합니다. -런타임 식별자가 지정된 경우 기본값은 'true'입니다. - - Do not build the project before publishing. Implies --no-restore. 게시하기 전에 프로젝트를 빌드하지 않습니다. 복원 없음을 의미합니다. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - 게시할 대상 런타임입니다. 자체 포함 배포를 만들 때 사용됩니다. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + 게시할 대상 런타임입니다. 자체 포함 배포를 만들 때 사용됩니다. 기본값은 프레임워크 종속 응용 프로그램을 게시하는 것입니다. @@ -61,6 +54,36 @@ The default is to publish a framework-dependent application. 게시할 구성입니다. 대부분의 프로젝트에서 기본값은 'Debug'입니다. + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf index a289a2172..caacebc07 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf @@ -37,22 +37,15 @@ Ścieżka do docelowego pliku manifestu zawierającego listę pakietów, które mają zostać wykluczone z kroku publikowania. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Opublikuj środowisko uruchomieniowe programu .NET Core z aplikacją, aby nie trzeba było go instalować na maszynie docelowej. -Ustawieniem domyślnym jest wartość „true” w przypadku określenia identyfikatora środowiska uruchomieniowego. - - Do not build the project before publishing. Implies --no-restore. Nie kompiluj tego projektu przed opublikowaniem. Powoduje przyjęcie, że podano parametr --no-restore. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - Docelowe środowisko uruchomieniowe na potrzeby publikacji. Ustawienie stosowane w przypadku tworzenia wdrożenia autonomicznego. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + Docelowe środowisko uruchomieniowe na potrzeby publikacji. Ustawienie stosowane w przypadku tworzenia wdrożenia autonomicznego. Ustawieniem domyślnym jest opublikowanie aplikacji zależnej od platformy. @@ -61,6 +54,36 @@ Ustawieniem domyślnym jest opublikowanie aplikacji zależnej od platformy.Konfiguracja, dla której ma być wykonane publikowanie. W przypadku większości projektów ustawienie domyślne to „Debugowanie”. + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf index e687c0375..a332416cf 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf @@ -37,22 +37,15 @@ O caminho para um arquivo de manifesto de destino que contém a lista de pacotes a serem excluídos da etapa de publicação. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Publique o tempo de execução do .NET Core com seu aplicativo para que o tempo de execução não precise ser instalado no computador de destino. -O padrão será 'true' se um identificador de tempo de execução for especificado. - - Do not build the project before publishing. Implies --no-restore. Não compile o projeto antes de publicar. Implica em --no-restore. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - O tempo de execução de destino da publicação. Ele é usado ao criar uma implantação autossuficiente. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + O tempo de execução de destino da publicação. Ele é usado ao criar uma implantação autossuficiente. O padrão é publicar um aplicativo dependente da estrutura. @@ -61,6 +54,36 @@ O padrão é publicar um aplicativo dependente da estrutura. A configuração para a qual a publicação ocorrerá. O padrão para a maioria dos projetos é 'Debug'. + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf index bda967938..34d488ed8 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf @@ -37,22 +37,15 @@ Путь к целевому файлу манифеста, содержащему список пакетов, исключаемых из публикации. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Опубликуйте среду выполнения .NET Core вместе с приложением, чтобы ее не нужно было устанавливать на целевом компьютере. -Если указан идентификатор среды выполнения, этот параметр по умолчанию имеет значение "true" (истина). - - Do not build the project before publishing. Implies --no-restore. Сборка проекта перед публикацией не выполняется. Подразумевает --no-restore. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - Целевая среда выполнения публикации. Используется при создании автономного развертывания. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + Целевая среда выполнения публикации. Используется при создании автономного развертывания. По умолчанию публикуется платформозависимое приложение. @@ -61,6 +54,36 @@ The default is to publish a framework-dependent application. Конфигурация для публикации. По умолчанию для большинства проектов используется "Debug". + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf index eedc627e9..6aed67f27 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf @@ -37,22 +37,15 @@ Yayımlama adımının dışında tutulacak paketlerin listesini içeren bir hedef bildirim dosyasının yolu. - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - Çalışma zamanının hedef makineye yüklenmesine gerek kalmaması için, .NET Core çalışma zamanını uygulamanızla birlikte yayımlayın. -Bir çalışma zamanı tanımlayıcısı belirtilmişse, varsayılan olarak 'true' değerine ayarlanır. - - Do not build the project before publishing. Implies --no-restore. Yayımlamadan önce projeyi derlemeyin. --no-restore anlamına gelir. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - Yayımlamanın yapılacağı hedef çalışma zamanı. Kendi içinde dağıtımlar oluşturulurken kullanılır. + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + Yayımlamanın yapılacağı hedef çalışma zamanı. Kendi içinde dağıtımlar oluşturulurken kullanılır. Varsayılan seçenek, çerçeveye bağımlı bir proje yayımlamaktır. @@ -61,6 +54,36 @@ Varsayılan seçenek, çerçeveye bağımlı bir proje yayımlamaktır. Yayımlanacak yapılandırma. Çoğu proje için varsayılan, ‘Hata Ayıklama’ seçeneğidir. + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf index 14fbea58e..95ca67dce 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf @@ -37,22 +37,15 @@ 指向目标清单文件的路径,该文件包含要通过发布步骤执行的包的列表。 - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - 随附应用程序发布 .NET Core 运行时,免除在目标计算机上安装运行时的需求。 -如果指定了运行时标识符,则默认为 "true"。 - - Do not build the project before publishing. Implies --no-restore. 发布之前不要生成项目。Implies --no-restore. - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - 要发布的目标运行时。创建自包含部署时使用此项。 + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + 要发布的目标运行时。创建自包含部署时使用此项。 默认操作为发布依赖框架的应用程序。 @@ -61,6 +54,36 @@ The default is to publish a framework-dependent application. 要发布的配置。大多数项目的默认值是 "Debug"。 + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf index 54fc8435f..7339114f2 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf @@ -37,22 +37,15 @@ 目標資訊清單檔案的路徑,其包含要從發行步驟中排除的套件清單。 - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. -The default is 'true' if a runtime identifier is specified. - 隨著應用程式一併發行 .NET Core 執行階段,因而不需要在目標電腦上安裝此執行階段。 -若指定了執行階段識別碼,則預設為 'true'。 - - Do not build the project before publishing. Implies --no-restore. 請勿在執行之前建置專案。提示:-no-restore。 - The target runtime to publish for. This is used when creating self-contained deployment. -The default is to publish a framework-dependent application. - 對其進行發行的目標執行階段。建立獨立的部署時,將會使用。 + The target runtime to publish the application for. +The default is to publish a framework-dependent application without an executable. + 對其進行發行的目標執行階段。建立獨立的部署時,將會使用。 預設會發行與架構相依的應用程式。 @@ -61,6 +54,36 @@ The default is to publish a framework-dependent application. 要為其進行發行的組態。大部分的專案預設為「偵錯」。 + + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + The mode to use when publishing the application. +The 'self-contained' mode publishes the application with the .NET Core runtime. +The 'fx-dependent' mode publishes the application as framework-dependent. If a target runtime is specified, it is published with an executable. +The 'fx-dependent-no-exe' mode publishes the application as framework-dependent without an executable. +The default is 'fx-dependent-no-exe' when a target runtime is not specified. +The default is 'self-contained' when a target runtime is specified. + + + + MODE + MODE + + + + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + The '--mode' and '--self-contained' options cannot be used together. Specify only one of the options. + + + + The specified publish mode '{0}' is not supported. + The specified publish mode '{0}' is not supported. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx b/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx index 155845dc7..155b7b7d5 100644 --- a/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx @@ -169,4 +169,7 @@ Force all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting project.assets.json. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs index f6c566af3..71afaabb4 100644 --- a/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ b/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs @@ -24,7 +24,14 @@ namespace Microsoft.DotNet.Cli { var fullRestoreOptions = AddImplicitRestoreOptions(new Option[] { CommonOptions.HelpOption() }, true, true); - return fullRestoreOptions.Concat(new Option[] { CommonOptions.VerbosityOption() }).ToArray(); + return fullRestoreOptions.Concat( + new Option[] { + CommonOptions.VerbosityOption(), + Create.Option( + "--interactive", + LocalizableStrings.CmdInteractiveRestoreOptionDescription, + Accept.NoArguments() + .ForwardAs("-property:NuGetInteractive=true")) }).ToArray(); } public static Option[] AddImplicitRestoreOptions( @@ -98,4 +105,4 @@ namespace Microsoft.DotNet.Cli }; } } -} \ No newline at end of file +} diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf index d50ff98b8..26ee6652e 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. Jedná se o ekvivalent odstranění project.assets.json. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf index 265edb23a..6170d1d2e 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. Dies entspricht dem Löschen von "project.assets.json". + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf index 8313c4e1c..4e10717e3 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. Esta acción es equivalente a eliminar project.assets.json. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf index 5c753f6da..e0b31e814 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. Cela équivaut à supprimer project.assets.json. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf index 5325f76b6..82b3fab68 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. Equivale a eliminare project.assets.json. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf index 989f9ba89..2752bf8d7 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. これは、project.assets.json を削除することと同じです。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf index f82f732d6..54ae028a3 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. project.assets.json을 삭제하는 것과 동일합니다. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf index 39d4146f3..557a04ecc 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. Jest to równoważne usunięciu pliku project.assets.json. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf index cddb7e19e..126fb295e 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. Isso equivale a excluir o project.assets.json. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf index ce9103fd4..412a3a023 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. Эквивалентно удалению файла project.assets.json. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf index 3ebacddb8..a18493ec6 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. project.assets.json öğesini silmeyle eşdeğerdir. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf index 0f832f6c4..450f7834d 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. 这等效于删除 project.assets.json。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf index 54deeb371..98076e4bd 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf @@ -89,6 +89,11 @@ This is equivalent to deleting project.assets.json. 如此等同於刪除 project.assets.json。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/LocalizableStrings.resx b/src/dotnet/commands/dotnet-sln/LocalizableStrings.resx index 8bb6a42f7..33334746d 100644 --- a/src/dotnet/commands/dotnet-sln/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-sln/LocalizableStrings.resx @@ -145,7 +145,7 @@ PROJECT_PATH - The paths to the projects to from from the solution. + The paths to the projects to remove from the solution. Remove one or more projects from a solution file. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf index d6bc1cd3f..d48783d50 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Cesty k projektům, které se mají odebrat z řešení + The paths to the projects to remove from the solution. + Cesty k projektům, které se mají odebrat z řešení diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf index 7d2574213..b51848a9e 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Die Pfade zu den Projekten, die von der Projektmappe entfernt werden sollen. + The paths to the projects to remove from the solution. + Die Pfade zu den Projekten, die von der Projektmappe entfernt werden sollen. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf index c23133ff0..e408effa1 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Las rutas a los proyectos desde la solución. + The paths to the projects to remove from the solution. + Las rutas a los proyectos desde la solución. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf index 76d0f9334..51f990d60 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Chemins des projets à supprimer de la solution. + The paths to the projects to remove from the solution. + Chemins des projets à supprimer de la solution. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf index 65c6b6d12..617a4311b 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Percorsi dei progetti da rimuovere dalla soluzione. + The paths to the projects to remove from the solution. + Percorsi dei progetti da rimuovere dalla soluzione. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf index bf512ef2b..b276b5b96 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - ソリューションから削除するプロジェクトへのパス。 + The paths to the projects to remove from the solution. + ソリューションから削除するプロジェクトへのパス。 diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf index 3bbe7b32b..03cfb0ad3 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - 솔루션에서 제거할 프로젝트의 경로입니다. + The paths to the projects to remove from the solution. + 솔루션에서 제거할 프로젝트의 경로입니다. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf index 35df4088d..83af390ce 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Ścieżki do projektów, które mają zostać usunięte z rozwiązania. + The paths to the projects to remove from the solution. + Ścieżki do projektów, które mają zostać usunięte z rozwiązania. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf index bac552a74..408c168ea 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Os caminhos para os projetos da solução. + The paths to the projects to remove from the solution. + Os caminhos para os projetos da solução. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf index 9e3b246e5..665deb701 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Пути к проектам, которые необходимо удалить из решения. + The paths to the projects to remove from the solution. + Пути к проектам, которые необходимо удалить из решения. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf index 2e1a0c461..ede6ff040 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - Çözümden kaldırılacak projelerin yolları. + The paths to the projects to remove from the solution. + Çözümden kaldırılacak projelerin yolları. diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf index 93e765d98..8c1e4766f 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - 从解决方案到项目的路径。 + The paths to the projects to remove from the solution. + 从解决方案到项目的路径。 diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf index 995f6aa7b..1e314c136 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf @@ -68,8 +68,8 @@ - The paths to the projects to from from the solution. - 從解決方案到達要專案的路徑。 + The paths to the projects to remove from the solution. + 從解決方案到達要專案的路徑。 diff --git a/src/dotnet/dotnet.csproj b/src/dotnet/dotnet.csproj index 4dfed0189..df5e6fd7b 100644 --- a/src/dotnet/dotnet.csproj +++ b/src/dotnet/dotnet.csproj @@ -76,7 +76,7 @@ - + diff --git a/test/EndToEnd/GivenFrameworkDependentApps.cs b/test/EndToEnd/GivenFrameworkDependentApps.cs new file mode 100644 index 000000000..605e22bd2 --- /dev/null +++ b/test/EndToEnd/GivenFrameworkDependentApps.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Xml.Linq; +using FluentAssertions; +using Microsoft.DotNet.PlatformAbstractions; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using NuGet.ProjectModel; +using NuGet.Versioning; +using Xunit; + +namespace EndToEnd +{ + public class GivenFrameworkDependentApps : TestBase + { + [Theory] + [ClassData(typeof(SupportedNetCoreAppVersions))] + public void ItDoesNotRollForwardToTheLatestVersion(string minorVersion) + { + var _testInstance = TestAssets.Get("TestAppSimple") + .CreateInstance(identifier: minorVersion) + // scope the feed to only dotnet-core feed to avoid flaky when different feed has a newer / lower version + .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages) + .WithSourceFiles(); + + string projectDirectory = _testInstance.Root.FullName; + + string projectPath = Path.Combine(projectDirectory, "TestAppSimple.csproj"); + + var project = XDocument.Load(projectPath); + var ns = project.Root.Name.Namespace; + + // Update TargetFramework to the right version of .NET Core + project.Root.Element(ns + "PropertyGroup") + .Element(ns + "TargetFramework") + .Value = "netcoreapp" + minorVersion; + + project.Save(projectPath); + + // Get the resolved version of .NET Core + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); + var assetsFile = new LockFileFormat().Read(assetsFilePath); + + var versionInAssertsJson = GetNetCoreAppVersion(assetsFile); + versionInAssertsJson.Should().NotBeNull(); + + if (versionInAssertsJson.IsPrerelease && versionInAssertsJson.Patch == 0) + { + // if the bundled version is, for example, a prerelease of + // .NET Core 2.1.1, that we don't roll forward to that prerelease + // version for framework-dependent deployments. + return; + } + + versionInAssertsJson.ToNormalizedString().Should().BeEquivalentTo(GetExpectedVersion(minorVersion)); + } + + private NuGetVersion GetNetCoreAppVersion(LockFile lockFile) + { + return lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier == null) + ?.Libraries?.SingleOrDefault(l => + string.Compare(l.Name, "Microsoft.NETCore.App", StringComparison.CurrentCultureIgnoreCase) == 0) + ?.Version; + } + + public string GetExpectedVersion(string minorVersion) + { + if (minorVersion.StartsWith("1.0")) + { + return "1.0.5"; // special case for 1.0 + } + else if (minorVersion.StartsWith("1.1")) + { + return "1.1.2"; // special case for 1.1 + } + else + { + var parsed = NuGetVersion.Parse(minorVersion); + return new NuGetVersion(parsed.Major, parsed.Minor, 0).ToNormalizedString(); + } + } + } +} diff --git a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs index 080197472..8061e98d0 100644 --- a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs +++ b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -13,15 +12,22 @@ using Xunit; namespace EndToEnd { - public class GivenSelfContainedAppsRollForward : TestBase + public partial class GivenSelfContainedAppsRollForward : TestBase { - [Theory(Skip = "Runtime 1.1 support for openSUSE and Fedora 27 needed")] + [Theory] // MemberData is used instead of InlineData here so we can access it in another test to // verify that we are covering the latest release of .NET Core - [MemberData(nameof(SupportedNetCoreAppVersions))] + [ClassData(typeof(SupportedNetCoreAppVersions))] public void ItRollsForwardToTheLatestVersion(string minorVersion) { + // https://github.com/dotnet/cli/issues/9661: remove this once the ASP.NET version bump + // merges from 2.1.3xx -> 2.1.4xx -> 2.2.1xx + if (minorVersion == "2.1") + { + return; + } + var _testInstance = TestAssets.Get("TestAppSimple") .CreateInstance(identifier: minorVersion) .WithSourceFiles(); @@ -118,25 +124,11 @@ namespace EndToEnd .Element(ns + "TargetFramework") .Value; - SupportedNetCoreAppVersions.Select(v => $"netcoreapp{v[0]}") - .Should().Contain(targetFramework, $"the {nameof(SupportedNetCoreAppVersions)} property should include the default version " + + SupportedNetCoreAppVersions.Versions.Select(v => $"netcoreapp{v[0]}") + .Should().Contain(targetFramework, $"the {nameof(SupportedNetCoreAppVersions)}.{nameof(SupportedNetCoreAppVersions.Versions)} property should include the default version " + "of .NET Core created by \"dotnet new\""); } } - - public static IEnumerable SupportedNetCoreAppVersions - { - get - { - return new[] - { - "1.0", - "1.1", - "2.0", - "2.1" - }.Select(version => new object[] { version }); - } - } } } diff --git a/test/EndToEnd/SupportedNetCoreAppVersions.cs b/test/EndToEnd/SupportedNetCoreAppVersions.cs new file mode 100644 index 000000000..fe1eb44e2 --- /dev/null +++ b/test/EndToEnd/SupportedNetCoreAppVersions.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Xunit; + +namespace EndToEnd +{ + public class SupportedNetCoreAppVersions : IEnumerable + { + public IEnumerator GetEnumerator() => Versions.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + public static IEnumerable Versions + { + get + { + return new[] + { + "1.0", + "1.1", + "2.0", + "2.1" + }.Select(version => new object[] { version }); + } + } + } +} diff --git a/test/InsertionTests/InsertionTests.csproj b/test/InsertionTests/InsertionTests.csproj index e4ac93433..f07f2dae8 100644 --- a/test/InsertionTests/InsertionTests.csproj +++ b/test/InsertionTests/InsertionTests.csproj @@ -30,8 +30,7 @@ TemplateFillInPackageName=%(BundledDotnetTools.Identity); TemplateFillInPackageVersion=%(BundledDotnetTools.Version); PreviousStageDirectory=$(PreviousStageDirectory); - DotnetToolsLayoutDirectory=$(testAssetSourceRoot); - DotnetToolsRestoreProjectStyle=DotnetToolReference + DotnetToolsLayoutDirectory=$(testAssetSourceRoot) 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 222c14025..4d006484a 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 @@ -52,10 +52,9 @@ DotnetToolsLayoutDirectory=$(SdkOutputDirectory)/DotnetTools; TemplateFillInPackageName=dotnet-watch; - TemplateFillInPackageVersion=$(AspNetCoreVersion); + TemplateFillInPackageVersion=$(DotnetWatchPackageVersion); PreviousStageDirectory=$(PreviousStageDirectory); - DotnetToolsLayoutDirectory=$(testAssetSourceRoot); - DotnetToolsRestoreProjectStyle=DotnetToolReference + DotnetToolsLayoutDirectory=$(testAssetSourceRoot) diff --git a/test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs b/test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs index 4d27d0fe7..fca0c33c2 100644 --- a/test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs @@ -117,7 +117,7 @@ namespace Microsoft.DotNet.TestFramework var content = @" - + "; diff --git a/test/Microsoft.DotNet.ToolPackage.Tests/ToolPackageInstallerTests.cs b/test/Microsoft.DotNet.ToolPackage.Tests/ToolPackageInstallerTests.cs index 1b4dcadbd..226dcf69d 100644 --- a/test/Microsoft.DotNet.ToolPackage.Tests/ToolPackageInstallerTests.cs +++ b/test/Microsoft.DotNet.ToolPackage.Tests/ToolPackageInstallerTests.cs @@ -1,8 +1,9 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Reflection; @@ -16,8 +17,10 @@ using Microsoft.DotNet.Tools.Tool.Install; using Microsoft.DotNet.Tools.Tests.ComponentMocks; using Microsoft.Extensions.DependencyModel.Tests; using Microsoft.Extensions.EnvironmentAbstractions; +using Microsoft.TemplateEngine.Cli; using NuGet.Versioning; using Xunit; +using LocalizableStrings = Microsoft.DotNet.Tools.Tool.Install.LocalizableStrings; namespace Microsoft.DotNet.ToolPackage.Tests { @@ -598,7 +601,7 @@ namespace Microsoft.DotNet.ToolPackage.Tests var package = installer.InstallPackage( packageId: TestPackageId, - versionRange: VersionRange.Parse("1.0.*"), + versionRange: VersionRange.Parse("1.0.0"), targetFramework: _testTargetframework, nugetConfig: nugetConfigPath); @@ -612,6 +615,60 @@ namespace Microsoft.DotNet.ToolPackage.Tests package.Uninstall(); } + [Fact] + public void GivenARootWithNonAsciiCharactorInstallSucceeds() + { + var nugetConfigPath = WriteNugetConfigFileToPointToTheFeed(); + + var surrogate = char.ConvertFromUtf32(int.Parse("2A601", NumberStyles.HexNumber)); + string nonAscii = "ab Ṱ̺̺̕o 田中さん åä," + surrogate; + + var root = new DirectoryPath(Path.Combine(TempRoot.Root, nonAscii, Path.GetRandomFileName())); + var reporter = new BufferedReporter(); + var fileSystem = new FileSystemWrapper(); + var store = new ToolPackageStore(root); + var installer = new ToolPackageInstaller( + store: store, + projectRestorer: new ProjectRestorer(reporter), + tempProject: GetUniqueTempProjectPathEachTest(), + offlineFeed: new DirectoryPath("does not exist")); + + var package = installer.InstallPackage( + packageId: TestPackageId, + versionRange: VersionRange.Parse(TestPackageVersion), + targetFramework: _testTargetframework, + nugetConfig: nugetConfigPath); + + AssertPackageInstall(reporter, fileSystem, package, store); + + package.Uninstall(); + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + // repro https://github.com/dotnet/cli/issues/9409 + public void GivenAComplexVersionRangeInstallSucceeds(bool testMockBehaviorIsInSync) + { + var nugetConfigPath = WriteNugetConfigFileToPointToTheFeed(); + var emptySource = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(emptySource); + + var (store, installer, reporter, fileSystem) = Setup( + useMock: testMockBehaviorIsInSync, + feeds: GetMockFeedsForSource(emptySource)); + + var package = installer.InstallPackage( + packageId: TestPackageId, + versionRange: VersionRange.Parse("1.0.0-rc*"), + targetFramework: _testTargetframework, + nugetConfig: nugetConfigPath, additionalFeeds: new[] { emptySource }); + + AssertPackageInstall(reporter, fileSystem, package, store); + + package.Uninstall(); + } + private static void AssertPackageInstall( BufferedReporter reporter, IFileSystem fileSystem, diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/PublishCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/PublishCommand.cs index ada6a80be..a22b5acf7 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/PublishCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/PublishCommand.cs @@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities private string _output; private string _runtime; private List _targetManifests = new List(); - private bool? _selfContained; + private string _mode; public PublishCommand WithFramework(string framework) { @@ -44,9 +44,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return this; } - public PublishCommand WithSelfContained(bool value) + public PublishCommand WithMode(string value) { - _selfContained = value; + _mode = value; return this; } @@ -69,7 +69,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities OutputOption, TargetOption, RuntimeOption, - SelfContainedOption); + ModeOption); } private string FrameworkOption => string.IsNullOrEmpty(_framework) ? "" : $"-f {_framework}"; @@ -80,6 +80,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities private string TargetOption => string.Join(" ", _targetManifests); - private string SelfContainedOption => _selfContained.HasValue ? $"--self-contained:{_selfContained.Value}" : ""; + private string ModeOption => string.IsNullOrEmpty(_mode) ? "" : $"--mode {_mode}"; } } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/FileSystemMockBuilder.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/FileSystemMockBuilder.cs index 4320d0da6..7f3166bf2 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/FileSystemMockBuilder.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/FileSystemMockBuilder.cs @@ -39,6 +39,17 @@ namespace Microsoft.Extensions.DependencyModel.Tests return this; } + /// + /// Just a "home" means different path on Windows and Unix. + /// Create a platform dependent Temporary directory path and use it to avoid further mis interpretation in + /// later tests. Like "c:/home vs /home". Instead always use Path.Combine(TempraryDirectory, "home") + /// + internal FileSystemMockBuilder UseCurrentSystemTemporaryDirectory() + { + TemporaryFolder = Path.GetTempPath(); + return this; + } + internal IFileSystem Build() { return new FileSystemMock(_files, TemporaryFolder); diff --git a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs index 5a080e772..ca71bcabc 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs @@ -19,6 +19,7 @@ namespace Microsoft.DotNet.New.Tests [InlineData("C#", "console", false)] [InlineData("C#", "classlib", false)] [InlineData("C#", "mstest", false)] + [InlineData("C#", "nunit", false)] [InlineData("C#", "xunit", false)] [InlineData("C#", "web", false)] [InlineData("C#", "mvc", false)] @@ -30,11 +31,13 @@ namespace Microsoft.DotNet.New.Tests // re-enable when this bug is resolved: https://github.com/dotnet/cli/issues/7574 //[InlineData("F#", "classlib", false)] [InlineData("F#", "mstest", false)] + [InlineData("F#", "nunit", false)] [InlineData("F#", "xunit", false)] [InlineData("F#", "mvc", false)] [InlineData("VB", "console", false)] [InlineData("VB", "classlib", false)] [InlineData("VB", "mstest", false)] + [InlineData("VB", "nunit", false)] [InlineData("VB", "xunit", false)] public void TemplateRestoresAndBuildsWithoutWarnings( string language, diff --git a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index 6a29e4282..ba51449fe 100644 --- a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -11,6 +11,7 @@ using Microsoft.DotNet.PlatformAbstractions; using Microsoft.DotNet.TestFramework; using Microsoft.DotNet.Tools.Test.Utilities; using Xunit; +using LocalizableStrings = Microsoft.DotNet.Tools.Publish.LocalizableStrings; namespace Microsoft.DotNet.Cli.Publish.Tests { @@ -95,62 +96,54 @@ namespace Microsoft.DotNet.Cli.Publish.Tests .And.HaveStdOutContaining("project.assets.json"); } - [Fact] - public void ItPublishesARunnableSelfContainedApp() + [Theory] + [InlineData(null)] + [InlineData("--self-contained")] + [InlineData("--self-contained=true")] + public void ItPublishesSelfContainedWithRid(string args) { var testAppName = "MSBuildTestApp"; - - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var testProjectDirectory = testInstance.Root; - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - - new PublishCommand() - .WithFramework("netcoreapp2.2") - .WithRuntime(rid) - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - var outputProgram = testProjectDirectory - .GetDirectory("bin", configuration, "netcoreapp2.2", rid, "publish", $"{testAppName}{Constants.ExeSuffix}") - .FullName; - - EnsureProgramIsRunnable(outputProgram); - - new TestCommand(outputProgram) - .ExecuteWithCapturedOutput() - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - [Fact] - public void ItPublishesARidSpecificAppSettingSelfContainedToTrue() - { - var testAppName = "MSBuildTestApp"; - var outputDirectory = PublishAppWithSelfContained(testAppName, true); + var outputDirectory = PublishApp(testAppName, rid, args); var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); - EnsureProgramIsRunnable(outputProgram); - new TestCommand(outputProgram) .ExecuteWithCapturedOutput() .Should().Pass() .And.HaveStdOutContaining("Hello World"); } - [Fact] - public void ItPublishesARidSpecificAppSettingSelfContainedToFalse() + [Theory] + [InlineData("--self-contained=false")] + public void ItPublishesFrameworkDependentWithRid(string args) { var testAppName = "MSBuildTestApp"; - var outputDirectory = PublishAppWithSelfContained(testAppName, false); + var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); + var outputDirectory = PublishApp(testAppName, rid, args); + + outputDirectory.Should().OnlyHaveFiles(new[] { + $"{testAppName}.dll", + $"{testAppName}.pdb", + $"{testAppName}.deps.json", + $"{testAppName}.runtimeconfig.json", + }); + + var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); + + new DotnetCommand() + .ExecuteWithCapturedOutput(Path.Combine(outputDirectory.FullName, $"{testAppName}.dll")) + .Should().Pass() + .And.HaveStdOutContaining("Hello World"); + } + + [Theory] + [InlineData("--self-contained=false")] + [InlineData(null)] + public void ItPublishesFrameworkDependentWithoutRid(string args) + { + var testAppName = "MSBuildTestApp"; + var outputDirectory = PublishApp(testAppName, rid: null, args: args); outputDirectory.Should().OnlyHaveFiles(new[] { $"{testAppName}.dll", @@ -165,36 +158,24 @@ namespace Microsoft.DotNet.Cli.Publish.Tests .And.HaveStdOutContaining("Hello World"); } - private DirectoryInfo PublishAppWithSelfContained(string testAppName, bool selfContained) + private DirectoryInfo PublishApp(string testAppName, string rid, string args = null) { var testInstance = TestAssets.Get(testAppName) - .CreateInstance($"PublishesSelfContained{selfContained}") + .CreateInstance($"PublishApp_{rid ?? "none"}_{args ?? "none"}") .WithSourceFiles() .WithRestoreFiles(); var testProjectDirectory = testInstance.Root; - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - new PublishCommand() .WithRuntime(rid) - .WithSelfContained(selfContained) .WithWorkingDirectory(testProjectDirectory) - .Execute() + .Execute(args ?? "") .Should().Pass(); var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; return testProjectDirectory - .GetDirectory("bin", configuration, "netcoreapp2.2", rid, "publish"); - } - - private static void EnsureProgramIsRunnable(string path) - { - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - //Workaround for https://github.com/dotnet/corefx/issues/15516 - Process.Start("chmod", $"u+x {path}").WaitForExit(); - } + .GetDirectory("bin", configuration, "netcoreapp2.2", rid ?? "", "publish"); } [Fact] diff --git a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj index 77012ff8d..51c2ff924 100644 --- a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj +++ b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj @@ -4,6 +4,9 @@ $(MicrosoftNETCoreAppPackageVersion) true dotnet-publish.Tests + ../../tools/Key.snk + true + true $(AssetTargetFallback);dotnet5.4;portable-net451+win8 @@ -16,6 +19,7 @@ + diff --git a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs index 29ddd549b..0f25c6fd5 100644 --- a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs +++ b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs @@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Cli.Sln.Remove.Tests Arguments: The solution file to operate on. If not specified, the command will search the current directory for one. - The paths to the projects to from from the solution. + The paths to the projects to remove from the solution. Options: -h, --help Show command line help."; diff --git a/test/dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs b/test/dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs index 15f9a94ea..0c93cd041 100644 --- a/test/dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs +++ b/test/dotnet.Tests/BuildServerTests/BuildServerProviderTests.cs @@ -81,37 +81,39 @@ namespace Microsoft.DotNet.Tests.BuildServerTests [Fact] public void GivenEnvironmentVariableItUsesItForThePidDirectory() { - const string PidDirectory = "path/to/some/directory"; - + IFileSystem fileSystem = new FileSystemMockBuilder().UseCurrentSystemTemporaryDirectory().Build(); + var pidDirectory = Path.Combine(fileSystem.Directory.CreateTemporaryDirectory().DirectoryPath, "path/to/some/directory"); var provider = new BuildServerProvider( - new FileSystemMockBuilder().Build(), - CreateEnvironmentProviderMock(PidDirectory).Object); + fileSystem, + CreateEnvironmentProviderMock(pidDirectory).Object); provider .GetPidFileDirectory() .Value .Should() - .Be(PidDirectory); + .Be(pidDirectory); } [Fact] public void GivenARazorPidFileItReturnsARazorBuildServer() { const int ProcessId = 1234; - const string ServerPath = "/path/to/rzc.dll"; const string PipeName = "some-pipe-name"; string pidDirectory = Path.GetFullPath("var/pids/build"); string pidFilePath = Path.Combine(pidDirectory, $"{RazorPidFile.FilePrefix}{ProcessId}"); - var fileSystemMock = new FileSystemMockBuilder() - .AddFile( + var fileSystemMockBuilder = new FileSystemMockBuilder(); + fileSystemMockBuilder.UseCurrentSystemTemporaryDirectory(); + var serverPath = Path.Combine(fileSystemMockBuilder.TemporaryFolder, "path/to/rzc.dll"); + + IFileSystem fileSystemMock = fileSystemMockBuilder.AddFile( pidFilePath, - $"{ProcessId}{Environment.NewLine}{RazorPidFile.RazorServerType}{Environment.NewLine}{ServerPath}{Environment.NewLine}{PipeName}") + $"{ProcessId}{Environment.NewLine}{RazorPidFile.RazorServerType}{Environment.NewLine}{serverPath}{Environment.NewLine}{PipeName}") .AddFile( Path.Combine(pidDirectory, $"{RazorPidFile.FilePrefix}not-a-pid-file"), "not-a-pid-file") - .Build(); + .Build(); var provider = new BuildServerProvider( fileSystemMock, @@ -127,7 +129,7 @@ namespace Microsoft.DotNet.Tests.BuildServerTests razorServer.PidFile.Should().NotBeNull(); razorServer.PidFile.Path.Value.Should().Be(pidFilePath); razorServer.PidFile.ProcessId.Should().Be(ProcessId); - razorServer.PidFile.ServerPath.Value.Should().Be(ServerPath); + razorServer.PidFile.ServerPath.Value.Should().Be(serverPath); razorServer.PidFile.PipeName.Should().Be(PipeName); } diff --git a/test/dotnet.Tests/BuildServerTests/RazorServerTests.cs b/test/dotnet.Tests/BuildServerTests/RazorServerTests.cs index f9b1ea52f..3161c89c0 100644 --- a/test/dotnet.Tests/BuildServerTests/RazorServerTests.cs +++ b/test/dotnet.Tests/BuildServerTests/RazorServerTests.cs @@ -24,7 +24,6 @@ namespace Microsoft.DotNet.Tests.BuildServerTests public void GivenAFailedShutdownCommandItThrows() { const int ProcessId = 1234; - const string ServerPath = "path/to/rzc.dll"; const string PipeName = "some-pipe-name"; const string ErrorMessage = "error!"; @@ -33,17 +32,20 @@ namespace Microsoft.DotNet.Tests.BuildServerTests var fileSystemMock = new FileSystemMockBuilder() .AddFile(pidFilePath, "") + .UseCurrentSystemTemporaryDirectory() .Build(); fileSystemMock.File.Exists(pidFilePath).Should().BeTrue(); + var serverPath = Path.Combine(fileSystemMock.Directory.CreateTemporaryDirectory().DirectoryPath, "path/to/rzc.dll"); + var server = new RazorServer( pidFile: new RazorPidFile( path: new FilePath(pidFilePath), processId: ProcessId, - serverPath: new FilePath(ServerPath), + serverPath: new FilePath(serverPath), pipeName: PipeName), - commandFactory: CreateCommandFactoryMock(ServerPath, PipeName, exitCode: 1, stdErr: ErrorMessage).Object, + commandFactory: CreateCommandFactoryMock(serverPath, PipeName, exitCode: 1, stdErr: ErrorMessage).Object, fileSystem: fileSystemMock); Action a = () => server.Shutdown(); @@ -60,7 +62,6 @@ namespace Microsoft.DotNet.Tests.BuildServerTests public void GivenASuccessfulShutdownItDoesNotThrow() { const int ProcessId = 1234; - const string ServerPath = "path/to/rzc.dll"; const string PipeName = "some-pipe-name"; string pidDirectory = Path.GetFullPath("var/pids/build"); @@ -68,17 +69,20 @@ namespace Microsoft.DotNet.Tests.BuildServerTests var fileSystemMock = new FileSystemMockBuilder() .AddFile(pidFilePath, "") + .UseCurrentSystemTemporaryDirectory() .Build(); fileSystemMock.File.Exists(pidFilePath).Should().BeTrue(); + var serverPath = Path.Combine(fileSystemMock.Directory.CreateTemporaryDirectory().DirectoryPath, "path/to/rzc.dll"); + var server = new RazorServer( pidFile: new RazorPidFile( path: new FilePath(pidFilePath), processId: ProcessId, - serverPath: new FilePath(ServerPath), + serverPath: new FilePath(serverPath), pipeName: PipeName), - commandFactory: CreateCommandFactoryMock(ServerPath, PipeName).Object, + commandFactory: CreateCommandFactoryMock(serverPath, PipeName).Object, fileSystem: fileSystemMock); server.Shutdown(); diff --git a/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs index eb9914064..c111e6104 100644 --- a/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs @@ -35,24 +35,28 @@ namespace Microsoft.DotNet.Tests.Commands private readonly AppliedOption _appliedCommand; private readonly ParseResult _parseResult; private readonly BufferedReporter _reporter; - private const string PathToPlaceShim = "pathToPlace"; - private const string PathToPlacePackages = PathToPlaceShim + "pkg"; + private readonly string _temporaryDirectory; + private readonly string _pathToPlaceShim; + private readonly string _pathToPlacePackages; private const string PackageId = "global.tool.console.demo"; private const string PackageVersion = "1.0.4"; public ToolInstallCommandTests() { _reporter = new BufferedReporter(); - _fileSystem = new FileSystemMockBuilder().Build(); - _toolPackageStore = new ToolPackageStoreMock(new DirectoryPath(PathToPlacePackages), _fileSystem); + _fileSystem = new FileSystemMockBuilder().UseCurrentSystemTemporaryDirectory().Build(); + _temporaryDirectory = _fileSystem.Directory.CreateTemporaryDirectory().DirectoryPath; + _pathToPlaceShim = Path.Combine(_temporaryDirectory, "pathToPlace"); + _pathToPlacePackages = _pathToPlaceShim + "Packages"; + _toolPackageStore = new ToolPackageStoreMock(new DirectoryPath(_pathToPlacePackages), _fileSystem); _createShellShimRepository = (nonGlobalLocation) => new ShellShimRepository( - new DirectoryPath(PathToPlaceShim), + new DirectoryPath(_pathToPlaceShim), fileSystem: _fileSystem, appHostShellShimMaker: new AppHostShellShimMakerMock(_fileSystem), filePermissionSetter: new NoOpFilePermissionSetter()); _environmentPathInstructionMock = - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim); + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim); _createToolPackageStoreAndInstaller = (_) => (_toolPackageStore, CreateToolPackageInstaller()); ParseResult result = Parser.Instance.Parse($"dotnet tool install -g {PackageId}"); @@ -197,7 +201,7 @@ namespace Microsoft.DotNet.Tests.Commands Environment.NewLine + string.Format(LocalizableStrings.ToolInstallationFailedWithRestoreGuidance, PackageId)); - _fileSystem.Directory.Exists(Path.Combine(PathToPlacePackages, PackageId)).Should().BeFalse(); + _fileSystem.Directory.Exists(Path.Combine(_pathToPlacePackages, PackageId)).Should().BeFalse(); } [Fact] @@ -220,7 +224,7 @@ namespace Microsoft.DotNet.Tests.Commands CommonLocalizableStrings.ShellShimConflict, ProjectRestorerMock.FakeCommandName)); - _fileSystem.Directory.Exists(Path.Combine(PathToPlacePackages, PackageId)).Should().BeFalse(); + _fileSystem.Directory.Exists(Path.Combine(_pathToPlacePackages, PackageId)).Should().BeFalse(); } [Fact] @@ -257,7 +261,7 @@ namespace Microsoft.DotNet.Tests.Commands _parseResult, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim, true), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim, true), _reporter); installCommand.Execute().Should().Be(0); @@ -284,7 +288,7 @@ namespace Microsoft.DotNet.Tests.Commands result, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim, true), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim, true), _reporter); Action action = () => installCommand.Execute(); @@ -307,7 +311,7 @@ namespace Microsoft.DotNet.Tests.Commands result, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim, true), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim, true), _reporter); installCommand.Execute().Should().Be(0); @@ -333,7 +337,7 @@ namespace Microsoft.DotNet.Tests.Commands result, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim, true), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim, true), _reporter); installCommand.Execute().Should().Be(0); @@ -359,7 +363,7 @@ namespace Microsoft.DotNet.Tests.Commands result, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim, true), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim, true), _reporter); Action a = () => installCommand.Execute(); @@ -369,7 +373,7 @@ namespace Microsoft.DotNet.Tests.Commands LocalizableStrings.ToolInstallationRestoreFailed + Environment.NewLine + string.Format(LocalizableStrings.ToolInstallationFailedWithRestoreGuidance, PackageId)); - _fileSystem.Directory.Exists(Path.Combine(PathToPlacePackages, PackageId)).Should().BeFalse(); + _fileSystem.Directory.Exists(Path.Combine(_pathToPlacePackages, PackageId)).Should().BeFalse(); } [Fact] @@ -383,7 +387,7 @@ namespace Microsoft.DotNet.Tests.Commands result, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim, true), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim, true), _reporter); installCommand.Execute().Should().Be(0); @@ -411,7 +415,7 @@ namespace Microsoft.DotNet.Tests.Commands parseResult, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim, true), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim, true), _reporter); Action a = () => installCommand.Execute(); @@ -433,7 +437,7 @@ namespace Microsoft.DotNet.Tests.Commands parseResult, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim, true), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim, true), _reporter); Action a = () => installCommand.Execute(); @@ -454,7 +458,7 @@ namespace Microsoft.DotNet.Tests.Commands parseResult, _createToolPackageStoreAndInstaller, _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim), _reporter); installCommand.Execute().Should().Be(0); @@ -466,7 +470,7 @@ namespace Microsoft.DotNet.Tests.Commands public void AndPackagedShimIsProvidedWhenRunWithPackageIdItCreateShimUsingPackagedShim() { var extension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : string.Empty; - var prepackagedShimPath = "packagedShimDirectory/" + ProjectRestorerMock.FakeCommandName + extension; + var prepackagedShimPath = Path.Combine (_temporaryDirectory, ProjectRestorerMock.FakeCommandName + extension); var tokenToIdentifyPackagedShim = "packagedShim"; _fileSystem.File.WriteAllText(prepackagedShimPath, tokenToIdentifyPackagedShim); @@ -490,7 +494,7 @@ namespace Microsoft.DotNet.Tests.Commands fileSystem: _fileSystem, reporter: _reporter))), _createShellShimRepository, - new EnvironmentPathInstructionMock(_reporter, PathToPlaceShim), + new EnvironmentPathInstructionMock(_reporter, _pathToPlaceShim), _reporter); installCommand.Execute().Should().Be(0); @@ -512,11 +516,11 @@ namespace Microsoft.DotNet.Tests.Commands installCallback: installCallback); } - private static string ExpectedCommandPath() + private string ExpectedCommandPath() { var extension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : string.Empty; return Path.Combine( - "pathToPlace", + _pathToPlaceShim, ProjectRestorerMock.FakeCommandName + extension); } diff --git a/test/dotnet.Tests/CommandTests/ToolUninstallCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolUninstallCommandTests.cs index 902d4eb1d..516c2e26a 100644 --- a/test/dotnet.Tests/CommandTests/ToolUninstallCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolUninstallCommandTests.cs @@ -34,14 +34,17 @@ namespace Microsoft.DotNet.Tests.Commands private const string PackageId = "global.tool.console.demo"; private const string PackageVersion = "1.0.4"; - private const string ShimsDirectory = "shims"; - private const string ToolsDirectory = "tools"; + private readonly string _shimsDirectory; + private readonly string _toolsDirectory; public ToolUninstallCommandTests() { _reporter = new BufferedReporter(); - _fileSystem = new FileSystemMockBuilder().Build(); - _environmentPathInstructionMock = new EnvironmentPathInstructionMock(_reporter, ShimsDirectory); + _fileSystem = new FileSystemMockBuilder().UseCurrentSystemTemporaryDirectory().Build(); + var tempDirectory = _fileSystem.Directory.CreateTemporaryDirectory().DirectoryPath; + _shimsDirectory = Path.Combine(tempDirectory, "shims"); + _toolsDirectory = Path.Combine(tempDirectory, "tools"); + _environmentPathInstructionMock = new EnvironmentPathInstructionMock(_reporter, _shimsDirectory); } [Fact] @@ -74,10 +77,10 @@ namespace Microsoft.DotNet.Tests.Commands PackageId, PackageVersion)); - var packageDirectory = new DirectoryPath(Path.GetFullPath(ToolsDirectory)) + var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) .WithSubDirectories(PackageId, PackageVersion); var shimPath = Path.Combine( - ShimsDirectory, + _shimsDirectory, ProjectRestorerMock.FakeCommandName + (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : "")); @@ -116,10 +119,10 @@ namespace Microsoft.DotNet.Tests.Commands PackageId, PackageVersion)); - var packageDirectory = new DirectoryPath(Path.GetFullPath(ToolsDirectory)) + var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) .WithSubDirectories(PackageId, PackageVersion); var shimPath = Path.Combine( - ShimsDirectory, + _shimsDirectory, ProjectRestorerMock.FakeCommandName + (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : "")); @@ -192,7 +195,7 @@ namespace Microsoft.DotNet.Tests.Commands { ParseResult result = Parser.Instance.Parse("dotnet tool install " + options); - var store = new ToolPackageStoreMock(new DirectoryPath(ToolsDirectory), _fileSystem); + var store = new ToolPackageStoreMock(new DirectoryPath(_toolsDirectory), _fileSystem); var packageInstallerMock = new ToolPackageInstallerMock( _fileSystem, store, @@ -205,7 +208,7 @@ namespace Microsoft.DotNet.Tests.Commands result, (_) => (store, packageInstallerMock), (_) => new ShellShimRepository( - new DirectoryPath(ShimsDirectory), + new DirectoryPath(_shimsDirectory), fileSystem: _fileSystem, appHostShellShimMaker: new AppHostShellShimMakerMock(_fileSystem)), _environmentPathInstructionMock, @@ -220,11 +223,11 @@ namespace Microsoft.DotNet.Tests.Commands result["dotnet"]["tool"]["uninstall"], result, (_) => new ToolPackageStoreMock( - new DirectoryPath(ToolsDirectory), + new DirectoryPath(_toolsDirectory), _fileSystem, uninstallCallback), (_) => new ShellShimRepository( - new DirectoryPath(ShimsDirectory), + new DirectoryPath(_shimsDirectory), fileSystem: _fileSystem, appHostShellShimMaker: new AppHostShellShimMakerMock(_fileSystem)), _reporter); diff --git a/test/dotnet.Tests/CommandTests/ToolUpdateCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolUpdateCommandTests.cs index 32a64274f..17b969f8c 100644 --- a/test/dotnet.Tests/CommandTests/ToolUpdateCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolUpdateCommandTests.cs @@ -18,6 +18,7 @@ using Xunit; using Parser = Microsoft.DotNet.Cli.Parser; using LocalizableStrings = Microsoft.DotNet.Tools.Tool.Update.LocalizableStrings; using Microsoft.DotNet.ShellShim; +using System.IO; namespace Microsoft.DotNet.Tests.Commands { @@ -31,15 +32,18 @@ namespace Microsoft.DotNet.Tests.Commands private readonly List _mockFeeds; private const string LowerPackageVersion = "1.0.4"; private const string HigherPackageVersion = "1.0.5"; - private const string ShimsDirectory = "shims"; - private const string ToolsDirectory = "tools"; + private readonly string _shimsDirectory; + private readonly string _toolsDirectory; public ToolUpdateCommandTests() { _reporter = new BufferedReporter(); - _fileSystem = new FileSystemMockBuilder().Build(); - _environmentPathInstructionMock = new EnvironmentPathInstructionMock(_reporter, ShimsDirectory); - _store = new ToolPackageStoreMock(new DirectoryPath(ToolsDirectory), _fileSystem); + _fileSystem = new FileSystemMockBuilder().UseCurrentSystemTemporaryDirectory().Build(); + var tempDirectory = _fileSystem.Directory.CreateTemporaryDirectory().DirectoryPath; + _shimsDirectory = Path.Combine(tempDirectory, "shims"); + _toolsDirectory = Path.Combine(tempDirectory, "tools"); + _environmentPathInstructionMock = new EnvironmentPathInstructionMock(_reporter, _shimsDirectory); + _store = new ToolPackageStoreMock(new DirectoryPath(_toolsDirectory), _fileSystem); _mockFeeds = new List { new MockFeed @@ -244,7 +248,7 @@ namespace Microsoft.DotNet.Tests.Commands private ShellShimRepository GetMockedShellShimRepository() { return new ShellShimRepository( - new DirectoryPath(ShimsDirectory), + new DirectoryPath(_shimsDirectory), fileSystem: _fileSystem, appHostShellShimMaker: new AppHostShellShimMakerMock(_fileSystem)); }