From 52dfbb66919bd96093bcbf84e9d2b8fbf545c5e0 Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Sat, 10 Oct 2020 19:26:12 +0300 Subject: [PATCH 1/4] Add --use-current-runtime option --- src/Cli/dotnet/CommonOptions.cs | 17 +++++- .../dotnet-restore/LocalizableStrings.resx | 57 +++++++++--------- .../dotnet-restore/RestoreCommandParser.cs | 6 ++ .../xlf/LocalizableStrings.cs.xlf | 5 ++ .../xlf/LocalizableStrings.de.xlf | 5 ++ .../xlf/LocalizableStrings.es.xlf | 5 ++ .../xlf/LocalizableStrings.fr.xlf | 5 ++ .../xlf/LocalizableStrings.it.xlf | 5 ++ .../xlf/LocalizableStrings.ja.xlf | 5 ++ .../xlf/LocalizableStrings.ko.xlf | 5 ++ .../xlf/LocalizableStrings.pl.xlf | 5 ++ .../xlf/LocalizableStrings.pt-BR.xlf | 5 ++ .../xlf/LocalizableStrings.ru.xlf | 5 ++ .../xlf/LocalizableStrings.tr.xlf | 5 ++ .../xlf/LocalizableStrings.zh-Hans.xlf | 5 ++ .../xlf/LocalizableStrings.zh-Hant.xlf | 5 ++ .../dotnet-store/LocalizableStrings.resx | 59 ++++++++++--------- .../dotnet-store/StoreCommandParser.cs | 1 + .../xlf/LocalizableStrings.cs.xlf | 5 ++ .../xlf/LocalizableStrings.de.xlf | 5 ++ .../xlf/LocalizableStrings.es.xlf | 5 ++ .../xlf/LocalizableStrings.fr.xlf | 5 ++ .../xlf/LocalizableStrings.it.xlf | 5 ++ .../xlf/LocalizableStrings.ja.xlf | 5 ++ .../xlf/LocalizableStrings.ko.xlf | 5 ++ .../xlf/LocalizableStrings.pl.xlf | 5 ++ .../xlf/LocalizableStrings.pt-BR.xlf | 5 ++ .../xlf/LocalizableStrings.ru.xlf | 5 ++ .../xlf/LocalizableStrings.tr.xlf | 5 ++ .../xlf/LocalizableStrings.zh-Hans.xlf | 5 ++ .../xlf/LocalizableStrings.zh-Hant.xlf | 5 ++ ...oft.NET.RuntimeIdentifierInference.targets | 24 ++++---- .../RuntimeIdentifiersTests.cs | 55 ++++++++++++++++- .../GivenDotnetBuildInvocation.cs | 9 +-- .../GivenDotnetPublishInvocation.cs | 9 ++- .../GivenDotnetStoreInvocation.cs | 5 +- 36 files changed, 294 insertions(+), 78 deletions(-) diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index 3be20c211c1f..79c8c90f8576 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -1,6 +1,10 @@ +// 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 System.Linq; +using System.Runtime.InteropServices; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Tools.Common; using Microsoft.DotNet.Tools; @@ -30,7 +34,7 @@ public static Option VerbosityOption(Func format) => "diag", "diagnostic") .With(name: CommonLocalizableStrings.LevelArgumentName) .ForwardAsSingle(format)); - + public static Option FrameworkOption(string description) => Create.Option( "-f|--framework", @@ -39,7 +43,7 @@ public static Option FrameworkOption(string description) => .WithSuggestionsFrom(_ => Suggest.TargetFrameworksFromProjectFile()) .With(name: CommonLocalizableStrings.FrameworkArgumentName) .ForwardAsSingle(o => $"-property:TargetFramework={o.Arguments.Single()}")); - + public static Option RuntimeOption(string description, bool withShortOption = true) => Create.Option( withShortOption ? "-r|--runtime" : "--runtime", @@ -48,7 +52,14 @@ public static Option RuntimeOption(string description, bool withShortOption = tr .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) .With(name: CommonLocalizableStrings.RuntimeIdentifierArgumentName) .ForwardAsSingle(o => $"-property:RuntimeIdentifier={o.Arguments.Single()}")); - + + public static Option CurrentRuntimeOption(string description, bool withShortOption = true) => + Create.Option( + "--use-current-runtime", + description, + Accept.NoArguments() + .ForwardAs("-property:UseCurrentRuntimeIdentifier=True")); + public static Option ConfigurationOption(string description) => Create.Option( "-c|--configuration", diff --git a/src/Cli/dotnet/commands/dotnet-restore/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-restore/LocalizableStrings.resx index c798b6ab7efd..bff3dbf675f0 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-restore/LocalizableStrings.resx @@ -1,17 +1,17 @@  - @@ -141,6 +141,9 @@ The target runtime to restore packages for. + + Use host runtime to build the target. + PACKAGES_DIR diff --git a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs index 1c0b36b4b30b..e66008623290 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata; +using System.Runtime.InteropServices; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings; @@ -83,6 +84,11 @@ private static Option[] ImplicitRestoreOptions(bool showHelp = false, bool useSh .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) .With(name: LocalizableStrings.CmdRuntimeOption) .ForwardAsSingle(o => $"-property:RuntimeIdentifiers={string.Join("%3B", o.Arguments)}")), + Create.Option( + "--use-current-runtime", + LocalizableStrings.CmdCurrentRuntimeOptionDescription, + Accept.NoArguments() + .ForwardAs("-property:UseCurrentRuntimeIdentifier=True")), Create.Option( "--packages", showHelp ? LocalizableStrings.CmdPackagesOptionDescription : string.Empty, diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf index 072ffcee1ab2..8eb310f453de 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf @@ -22,6 +22,11 @@ Volitelná cesta k souboru projektu nebo k argumentům MSBuildu + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf index 22e633cb3e42..ea5ae024c8cd 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf @@ -22,6 +22,11 @@ Optionaler Pfad zu einer Projektdatei oder MSBuild-Argumente. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf index 1b6d8f93920b..552925fe729c 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf @@ -22,6 +22,11 @@ Ruta de acceso opcional a un archivo de proyecto o argumentos de MSBuild. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE ORIGEN diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf index 0e4abbcc07b2..20023890df5f 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf @@ -22,6 +22,11 @@ Chemin facultatif vers un fichier projet ou des arguments MSBuild. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf index ed65e02e51a3..94a03474411e 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf @@ -22,6 +22,11 @@ Percorso facoltativo di un file di progetto o di argomenti di MSBuild. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE ORIGINE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf index 14cf3e27f33f..94abcbfaea89 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf @@ -22,6 +22,11 @@ プロジェクト ファイルまたは MSBuild 引数へのオプションのパス。 + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf index ffb48372fb51..1518d0111169 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf @@ -22,6 +22,11 @@ 프로젝트 파일의 선택적 경로 또는 MSBuild 인수입니다. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf index c9f2065f4db2..806ac1a0cd03 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf @@ -22,6 +22,11 @@ Opcjonalna ścieżka do pliku projektu lub argumentów programu MSBuild. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE ŹRÓDŁO diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf index c88e390a1f2a..b16b6b353c52 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf @@ -22,6 +22,11 @@ Caminho opcional para um arquivo de projeto ou argumentos do MSBuild. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE ORIGEM diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf index cf029469d9ce..4eac388accd2 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf @@ -22,6 +22,11 @@ Дополнительный путь к файлу проекта или аргументам MSBuild. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf index 9dcd63eb2d8f..972a566fb1ec 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf @@ -22,6 +22,11 @@ Proje dosyasının veya MSBuild bağımsız değişkenlerinin isteğe bağlı yolu. + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf index eebc5721c835..1e2b937fea8d 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf @@ -22,6 +22,11 @@ 项目文件或 MSBuild 参数的可选路径。 + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf index 14fdc8930925..0777d5975354 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf @@ -22,6 +22,11 @@ 專案檔或 MSBuild 引數的選擇性路徑。 + + Use host runtime to build the target. + Use host runtime to build the target. + + SOURCE SOURCE diff --git a/src/Cli/dotnet/commands/dotnet-store/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-store/LocalizableStrings.resx index d5ba610aced7..a40aa213af6a 100644 --- a/src/Cli/dotnet/commands/dotnet-store/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-store/LocalizableStrings.resx @@ -1,17 +1,17 @@  - @@ -162,4 +162,7 @@ The target runtime to store packages for. - \ No newline at end of file + + Use host runtime to build the target. + + diff --git a/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs index ca47c26b6388..c966d816d23d 100644 --- a/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-store/StoreCommandParser.cs @@ -50,6 +50,7 @@ public static Command Store() => .With(name: LocalizableStrings.FrameworkVersionOption) .ForwardAsSingle(o => $"-property:RuntimeFrameworkVersion={o.Arguments.Single()}")), CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription), + CommonOptions.CurrentRuntimeOption(LocalizableStrings.CurrentRuntimeOptionDescription), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf index 5694cdb1e7e8..dc211b767d35 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf @@ -7,6 +7,11 @@ Uloží určená sestavení pro platformu .NET. Standardně se optimalizují pro cílový modul runtime a architekturu. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf index 074ce426fdbe..ffd974339c4b 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf @@ -7,6 +7,11 @@ Speichert die angegebenen Assemblys für die .NET-Plattform. Standardmäßig werden diese für die Zielruntime und das Framework optimiert. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf index 30516f5444f7..758a2b6dde1a 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf @@ -7,6 +7,11 @@ Almacena los ensamblados especificados para la plataforma .NET. De forma predeterminada, estos se optimizarán para el tiempo de ejecución y la plataforma de destino. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR DIRECTORIO_DE_SALIDA diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf index b6c92caa3fe5..c81ea0a972e3 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf @@ -7,6 +7,11 @@ Stocke les assemblys spécifiés pour la plateforme .NET. Par défaut, ceux-ci sont optimisés pour le runtime et le framework cible. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf index b5d1a893b19c..f430d3d9b302 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf @@ -7,6 +7,11 @@ Consente di archiviare gli assembly specificati per la piattaforma .NET. Per impostazione predefinita, gli assembly verranno ottimizzati per il framework e il runtime di destinazione. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR DIR_OUTPUT diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf index 4bdc8f7a4dd6..42d1909bbc76 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf @@ -7,6 +7,11 @@ .NET Platform の指定されたアセンブリを格納します。既定では、これらはターゲットのランタイムとフレームワーク用に最適化されます。 + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf index 410ea9fcaa34..ed0d79659e17 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf @@ -7,6 +7,11 @@ .NET 플랫폼에 대해 지정된 어셈블리를 저장합니다. 기본적으로 대상 런타임 및 프레임워크에 대해 최적화됩니다. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf index 2260d96218df..983355e8be29 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf @@ -7,6 +7,11 @@ Przechowuje określone zestawy platformy .NET. Domyślnie są one optymalizowane pod kątem docelowego środowiska uruchomieniowego i platformy docelowej. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR KATALOG_WYJŚCIOWY diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf index e51aed761ecd..e20c3a232580 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf @@ -7,6 +7,11 @@ Armazena os assemblies especificados para a Plataforma .NET. Por padrão, serão otimizados para o runtime e a estrutura de destino. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf index 489a1bfbb944..f54563630356 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf @@ -7,6 +7,11 @@ Хранит указанные сборки для платформы .NET. По умолчанию они оптимизируются для целевой среды выполнения и платформы. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf index d62064e3ccc4..c23029a0ebe4 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf @@ -7,6 +7,11 @@ .NET Platformu için belirtilen bütünleştirilmiş kodları depolar. Varsayılan olarak, bunlar hedef çalışma zamanı ve çerçeve için iyileştirilir. + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR ÇIKIŞ_DİZİNİ diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf index f0dd99ee6fdb..9ddf62a09cc5 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf @@ -7,6 +7,11 @@ 存储为 .NET 平台指定的程序集。默认情况下,这些程序集将针对目标运行时和框架进行优化。 + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf index 3566305b6611..ee9d69f4bcdb 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf @@ -7,6 +7,11 @@ 儲存為 .NET 平台所指定的組件。根據預設,會為目標執行階段與架構,最佳化這些組件。 + + Use host runtime to build the target. + Use host runtime to build the target. + + OUTPUT_DIR OUTPUT_DIR diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index 5d479840d2b3..508f1ab65308 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -6,7 +6,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and created a backup copy. Incorrect changes to this file will make it impossible to load or build your projects from the command-line or the IDE. -Copyright (c) .NET Foundation. All rights reserved. +Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> @@ -52,8 +52,8 @@ Copyright (c) .NET Foundation. All rights reserved. work without user intervention. The current static evaluation requirement limits us. --> - <_UsingDefaultRuntimeIdentifier>true @@ -61,6 +61,10 @@ Copyright (c) .NET Foundation. All rights reserved. win7-x86 + + $(NETCoreSdkRuntimeIdentifier) + + <_UsingDefaultPlatformTarget>true @@ -96,7 +100,7 @@ Copyright (c) .NET Foundation. All rights reserved. @@ -224,9 +228,9 @@ Copyright (c) .NET Foundation. All rights reserved. AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> - - + diff --git a/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs b/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs index d35097478a9f..fb91cd47f66f 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs @@ -1,6 +1,10 @@ -using System; +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using FluentAssertions; using Microsoft.DotNet.Cli.Utils; @@ -79,6 +83,55 @@ public void BuildWithRuntimeIdentifier() } } + // Run on core MSBuild only as using a local packages folder hits long path issues on full MSBuild + [CoreMSBuildOnlyFact] + public void BuildWithUseCurrentRuntimeIdentifier() + { + var testProject = new TestProject() + { + Name = "BuildWithUseCurrentRuntimeIdentifier", + TargetFrameworks = "netcoreapp3.0", + IsSdkProject = true, + IsExe = true + }; + + var compatibleRid = EnvironmentInfo.GetCompatibleRid(testProject.TargetFrameworks); + + testProject.AdditionalProperties["UseCurrentRuntimeIdentifier"] = "True"; + + // Use a test-specific packages folder + testProject.AdditionalProperties["RestorePackagesPath"] = @"$(MSBuildProjectDirectory)\..\pkg"; + + var testAsset = _testAssetsManager.CreateTestProject(testProject); + var restoreCommand = new RestoreCommand(testAsset); + + restoreCommand + .Execute() + .Should() + .Pass(); + + var buildCommand = new BuildCommand(testAsset); + + buildCommand + .ExecuteWithoutRestore() + .Should() + .Pass(); + + string sdkDirectory = Path.Combine(buildCommand.GetNonSDKOutputDirectory().FullName, testProject.TargetFrameworks); + string outputDirectoryFullName = Directory.EnumerateDirectories(sdkDirectory, "*", SearchOption.AllDirectories).FirstOrDefault(); + outputDirectoryFullName.Should().NotBeNullOrWhiteSpace(); + + var selfContainedExecutable = $"{testProject.Name}{Constants.ExeSuffix}"; + string selfContainedExecutableFullPath = Path.Combine(outputDirectoryFullName, selfContainedExecutable); + + new RunExeCommand(Log, selfContainedExecutableFullPath) + .Execute() + .Should() + .Pass() + .And + .HaveStdOutContaining("Hello World!"); + } + // Run on core MSBuild only as using a local packages folder hits long path issues on full MSBuild [CoreMSBuildOnlyTheory] [InlineData(false)] diff --git a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetBuildInvocation.cs b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetBuildInvocation.cs index f574af8d00c8..33ea76a3eb98 100644 --- a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetBuildInvocation.cs +++ b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetBuildInvocation.cs @@ -1,4 +1,4 @@ -// 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.IO; @@ -13,7 +13,7 @@ public class GivenDotnetBuildInvocation : IClassFixturemyoutput -verbosity:diag /ArbitrarySwitchForMSBuild", "-property:OutputPath=myoutput -property:TargetFramework=tfm -verbosity:diag /ArbitrarySwitchForMSBuild")] public void MsbuildInvocationIsCorrectForSeparateRestore( - string[] args, - string expectedAdditionalArgsForRestore, + string[] args, + string expectedAdditionalArgsForRestore, string expectedAdditionalArgs) { CommandDirectoryContext.PerformActionWithBasePath(WorkingDirectory, () => diff --git a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPublishInvocation.cs b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPublishInvocation.cs index 2efb34136b26..035e59891ae0 100644 --- a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPublishInvocation.cs +++ b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPublishInvocation.cs @@ -1,10 +1,11 @@ -// 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.IO; -using FluentAssertions; using System.Linq; +using System.Runtime.InteropServices; +using FluentAssertions; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Tools.Publish; using Xunit; @@ -14,7 +15,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { public class GivenDotnetPublishInvocation : IClassFixture { - private static readonly string WorkingDirectory = + private static readonly string WorkingDirectory = TestPathUtilities.FormatAbsolutePath(nameof(GivenDotnetPublishInvocation)); private readonly ITestOutputHelper output; @@ -29,6 +30,7 @@ public GivenDotnetPublishInvocation(ITestOutputHelper output) [InlineData(new string[] { }, "")] [InlineData(new string[] { "-r", "" }, "-property:RuntimeIdentifier=")] [InlineData(new string[] { "--runtime", "" }, "-property:RuntimeIdentifier=")] + [InlineData(new string[] { "--use-current-runtime" }, "-property:UseCurrentRuntimeIdentifier=True")] [InlineData(new string[] { "-o", "" }, "-property:PublishDir=")] [InlineData(new string[] { "--output", "" }, "-property:PublishDir=")] [InlineData(new string[] { "-c", "" }, "-property:Configuration=")] @@ -103,6 +105,7 @@ public void MsbuildInvocationIsCorrectForNoBuild() [InlineData(new string[] { "--framework", "" }, "-property:TargetFramework=")] [InlineData(new string[] { "-r", "" }, "-property:RuntimeIdentifier=")] [InlineData(new string[] { "--runtime", "" }, "-property:RuntimeIdentifier=")] + [InlineData(new string[] { "--use-current-runtime" }, "-property:UseCurrentRuntimeIdentifier=True")] [InlineData(new string[] { "-o", "" }, "-property:PublishDir=")] [InlineData(new string[] { "--output", "" }, "-property:PublishDir=")] [InlineData(new string[] { "-c", "" }, "-property:Configuration=")] diff --git a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetStoreInvocation.cs b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetStoreInvocation.cs index 6512e0edcb6a..3d0af3f96baa 100644 --- a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetStoreInvocation.cs +++ b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetStoreInvocation.cs @@ -1,4 +1,4 @@ -// 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 FluentAssertions; @@ -14,7 +14,7 @@ public class GivenDotnetStoreInvocation : IClassFixture" }; - private static readonly string WorkingDirectory = + private static readonly string WorkingDirectory = TestPathUtilities.FormatAbsolutePath(nameof(GivenDotnetStoreInvocation)); [Theory] @@ -33,6 +33,7 @@ public void ItAddsProjectToMsbuildInvocation(string optionName) [InlineData(new string[] { "--framework", "" }, @"-property:TargetFramework=")] [InlineData(new string[] { "-r", "" }, @"-property:RuntimeIdentifier=")] [InlineData(new string[] { "--runtime", "" }, @"-property:RuntimeIdentifier=")] + [InlineData(new string[] { "--use-current-runtime" }, "-property:UseCurrentRuntimeIdentifier=True")] [InlineData(new string[] { "--manifest", "one.xml", "--manifest", "two.xml", "--manifest", "three.xml" }, @"-property:AdditionalProjects=one.xml%3Btwo.xml%3Bthree.xml")] public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) { From a60f4193f854adfba4c7cb86dd0a156186ec0e9c Mon Sep 17 00:00:00 2001 From: root <3840695+am11@users.noreply.github.com> Date: Wed, 14 Oct 2020 06:25:06 +0300 Subject: [PATCH 2/4] Use CommonOption in RestoreCommandParser as well --- .../dotnet/commands/dotnet-restore/RestoreCommandParser.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs index e66008623290..04e7e8f8c5c7 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs @@ -84,11 +84,7 @@ private static Option[] ImplicitRestoreOptions(bool showHelp = false, bool useSh .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) .With(name: LocalizableStrings.CmdRuntimeOption) .ForwardAsSingle(o => $"-property:RuntimeIdentifiers={string.Join("%3B", o.Arguments)}")), - Create.Option( - "--use-current-runtime", - LocalizableStrings.CmdCurrentRuntimeOptionDescription, - Accept.NoArguments() - .ForwardAs("-property:UseCurrentRuntimeIdentifier=True")), + CommonOptions.CurrentRuntimeOption(LocalizableStrings.CmdCurrentRuntimeOptionDescription), Create.Option( "--packages", showHelp ? LocalizableStrings.CmdPackagesOptionDescription : string.Empty, From d44027c4203b15b3cec5dfa148ef79c1eccaf68a Mon Sep 17 00:00:00 2001 From: root <3840695+am11@users.noreply.github.com> Date: Wed, 14 Oct 2020 06:29:06 +0300 Subject: [PATCH 3/4] Delete unused using --- src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs index 04e7e8f8c5c7..dba4306963d5 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-restore/RestoreCommandParser.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata; -using System.Runtime.InteropServices; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Tools; using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings; From f346c3d650cf8137b6e5953cd53217853e426434 Mon Sep 17 00:00:00 2001 From: root <3840695+am11@users.noreply.github.com> Date: Wed, 14 Oct 2020 14:35:32 +0300 Subject: [PATCH 4/4] Address PR feedback --- src/Cli/dotnet/CommonOptions.cs | 1 - .../dotnet-restore/LocalizableStrings.resx | 2 +- .../xlf/LocalizableStrings.cs.xlf | 4 ++-- .../xlf/LocalizableStrings.de.xlf | 4 ++-- .../xlf/LocalizableStrings.es.xlf | 4 ++-- .../xlf/LocalizableStrings.fr.xlf | 4 ++-- .../xlf/LocalizableStrings.it.xlf | 4 ++-- .../xlf/LocalizableStrings.ja.xlf | 4 ++-- .../xlf/LocalizableStrings.ko.xlf | 4 ++-- .../xlf/LocalizableStrings.pl.xlf | 4 ++-- .../xlf/LocalizableStrings.pt-BR.xlf | 4 ++-- .../xlf/LocalizableStrings.ru.xlf | 4 ++-- .../xlf/LocalizableStrings.tr.xlf | 4 ++-- .../xlf/LocalizableStrings.zh-Hans.xlf | 4 ++-- .../xlf/LocalizableStrings.zh-Hant.xlf | 4 ++-- .../dotnet-store/LocalizableStrings.resx | 2 +- .../xlf/LocalizableStrings.cs.xlf | 4 ++-- .../xlf/LocalizableStrings.de.xlf | 4 ++-- .../xlf/LocalizableStrings.es.xlf | 4 ++-- .../xlf/LocalizableStrings.fr.xlf | 4 ++-- .../xlf/LocalizableStrings.it.xlf | 4 ++-- .../xlf/LocalizableStrings.ja.xlf | 4 ++-- .../xlf/LocalizableStrings.ko.xlf | 4 ++-- .../xlf/LocalizableStrings.pl.xlf | 4 ++-- .../xlf/LocalizableStrings.pt-BR.xlf | 4 ++-- .../xlf/LocalizableStrings.ru.xlf | 4 ++-- .../xlf/LocalizableStrings.tr.xlf | 4 ++-- .../xlf/LocalizableStrings.zh-Hans.xlf | 4 ++-- .../xlf/LocalizableStrings.zh-Hant.xlf | 4 ++-- .../RuntimeIdentifiersTests.cs | 20 ++++++------------- .../GivenDotnetPublishInvocation.cs | 1 - 31 files changed, 60 insertions(+), 70 deletions(-) diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index 79c8c90f8576..9f148234b460 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -4,7 +4,6 @@ using System; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Tools.Common; using Microsoft.DotNet.Tools; diff --git a/src/Cli/dotnet/commands/dotnet-restore/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-restore/LocalizableStrings.resx index bff3dbf675f0..fb7bb2df4926 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-restore/LocalizableStrings.resx @@ -142,7 +142,7 @@ The target runtime to restore packages for. - Use host runtime to build the target. + Use current runtime as the target runtime. PACKAGES_DIR diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf index 8eb310f453de..1081a3085552 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf index ea5ae024c8cd..d7c035765fa2 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf index 552925fe729c..0124b0bbb1ce 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf index 20023890df5f..ffc82f70ad14 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf index 94a03474411e..636654b6e08d 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf index 94abcbfaea89..f86483e8db88 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf index 1518d0111169..f98b929c7c0e 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf index 806ac1a0cd03..0f82ecb00986 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf index b16b6b353c52..6fadea8d742e 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf index 4eac388accd2..2a20a0400ab1 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf index 972a566fb1ec..49aa5f38affa 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf index 1e2b937fea8d..44f79d334a21 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf index 0777d5975354..b749ee21391a 100644 --- a/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf @@ -23,8 +23,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-store/LocalizableStrings.resx index a40aa213af6a..5962d22437e1 100644 --- a/src/Cli/dotnet/commands/dotnet-store/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-store/LocalizableStrings.resx @@ -163,6 +163,6 @@ The target runtime to store packages for. - Use host runtime to build the target. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf index dc211b767d35..52deb7dc814e 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf index ffd974339c4b..ecbdb818ff54 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf index 758a2b6dde1a..ff9c2cdca213 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf index c81ea0a972e3..825b0cf68e58 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf index f430d3d9b302..65183b33753f 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf index 42d1909bbc76..33bbf67f3c85 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf index ed0d79659e17..3900b7239040 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf index 983355e8be29..69f4567a52ef 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf index e20c3a232580..fe0a56cde0d2 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf index f54563630356..bc2a8ca94e47 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf index c23029a0ebe4..70c27b0be9eb 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf index 9ddf62a09cc5..9bce22cf4f84 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf index ee9d69f4bcdb..24d291de39ce 100644 --- a/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf @@ -8,8 +8,8 @@ - Use host runtime to build the target. - Use host runtime to build the target. + Use current runtime as the target runtime. + Use current runtime as the target runtime. diff --git a/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs b/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs index fb91cd47f66f..37fb41607a53 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/RuntimeIdentifiersTests.cs @@ -83,8 +83,7 @@ public void BuildWithRuntimeIdentifier() } } - // Run on core MSBuild only as using a local packages folder hits long path issues on full MSBuild - [CoreMSBuildOnlyFact] + [Fact] public void BuildWithUseCurrentRuntimeIdentifier() { var testProject = new TestProject() @@ -103,26 +102,19 @@ public void BuildWithUseCurrentRuntimeIdentifier() testProject.AdditionalProperties["RestorePackagesPath"] = @"$(MSBuildProjectDirectory)\..\pkg"; var testAsset = _testAssetsManager.CreateTestProject(testProject); - var restoreCommand = new RestoreCommand(testAsset); - - restoreCommand - .Execute() - .Should() - .Pass(); - var buildCommand = new BuildCommand(testAsset); buildCommand - .ExecuteWithoutRestore() + .Execute() .Should() .Pass(); - string sdkDirectory = Path.Combine(buildCommand.GetNonSDKOutputDirectory().FullName, testProject.TargetFrameworks); - string outputDirectoryFullName = Directory.EnumerateDirectories(sdkDirectory, "*", SearchOption.AllDirectories).FirstOrDefault(); - outputDirectoryFullName.Should().NotBeNullOrWhiteSpace(); + string targetFrameworkOutputDirectory = Path.Combine(buildCommand.GetNonSDKOutputDirectory().FullName, testProject.TargetFrameworks); + string outputDirectoryWithRuntimeIdentifier = Directory.EnumerateDirectories(targetFrameworkOutputDirectory, "*", SearchOption.AllDirectories).FirstOrDefault(); + outputDirectoryWithRuntimeIdentifier.Should().NotBeNullOrWhiteSpace(); var selfContainedExecutable = $"{testProject.Name}{Constants.ExeSuffix}"; - string selfContainedExecutableFullPath = Path.Combine(outputDirectoryFullName, selfContainedExecutable); + string selfContainedExecutableFullPath = Path.Combine(outputDirectoryWithRuntimeIdentifier, selfContainedExecutable); new RunExeCommand(Log, selfContainedExecutableFullPath) .Execute() diff --git a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPublishInvocation.cs b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPublishInvocation.cs index 035e59891ae0..47576546968e 100644 --- a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPublishInvocation.cs +++ b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPublishInvocation.cs @@ -4,7 +4,6 @@ using System; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using FluentAssertions; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Tools.Publish;