diff --git a/src/Cli/dotnet/commands/dotnet-pack/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-pack/LocalizableStrings.resx index 8d89c15444ec..d95bb761caf6 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-pack/LocalizableStrings.resx @@ -148,9 +148,9 @@ The project to pack, defaults to the project file in the current directory. Can be a path to any project file - The configuration to use for building the package. The default for most projects is 'Debug'. + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. Do not display the startup banner or the copyright message. - \ No newline at end of file + diff --git a/src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs b/src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs index d76d4a1ed74a..7a25e1d4d381 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-pack/PackCommand.cs @@ -33,7 +33,8 @@ public static PackCommand FromParseResult(ParseResult parseResult, string msbuil var msbuildArgs = new List() { - "-target:pack" + "-target:pack", + "-property:_IsPacking=true" }; msbuildArgs.AddRange(parseResult.OptionValuesToBeForwarded(PackCommandParser.GetCommand())); diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf index a3202c7c49f8..5ddb6a595eab 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - Konfigurace použitá k sestavení balíčku. Výchozí možností pro většinu projektů je Debug. + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + Konfigurace použitá k sestavení balíčku. Výchozí možností pro většinu projektů je Debug. diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf index 99cd28d81325..876c29a61853 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - Die für die Paketerstellung zu verwendende Konfiguration. Standard für die meisten Projekte ist "Debug". + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + Die für die Paketerstellung zu verwendende Konfiguration. Standard für die meisten Projekte ist "Debug". diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf index c3fe6fdc96b9..8f96b2acd9b0 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - La configuración que se usará para compilar el paquete. El valor predeterminado para la mayoría de los proyectos es "Debug". + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + La configuración que se usará para compilar el paquete. El valor predeterminado para la mayoría de los proyectos es "Debug". diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf index 3953a22340f3..24cf809df216 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - Configuration à utiliser pour la génération du package. La valeur par défaut pour la plupart des projets est 'Debug'. + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + Configuration à utiliser pour la génération du package. La valeur par défaut pour la plupart des projets est 'Debug'. diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf index c966c74c8df0..d214b600f846 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - Configurazione da usare per compilare il pacchetto. L'impostazione predefinita per la maggior parte dei progetti è 'Debug'. + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + Configurazione da usare per compilare il pacchetto. L'impostazione predefinita per la maggior parte dei progetti è 'Debug'. diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf index e5be3cc05019..800528e01c64 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - パッケージのビルドに使用する構成。ほとんどのプロジェクトで既定は 'Debug' です。 + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + パッケージのビルドに使用する構成。ほとんどのプロジェクトで既定は 'Debug' です。 diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf index de9106903963..71551ec02051 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - 패키지 빌드에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 'Debug'입니다. + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + 패키지 빌드에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 'Debug'입니다. diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf index 5932aec99bc3..a3b3877a593d 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - Konfiguracja do użycia na potrzeby kompilacji pakietu. W przypadku większości projektów ustawienie domyślne to „Debugowanie”. + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + Konfiguracja do użycia na potrzeby kompilacji pakietu. W przypadku większości projektów ustawienie domyślne to „Debugowanie”. diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf index c3039db56ca4..e29d3eb8c0ab 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - A configuração a ser usada para compilar o pacote. O padrão para a maioria dos projetos é 'Debug'. + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + A configuração a ser usada para compilar o pacote. O padrão para a maioria dos projetos é 'Debug'. diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf index 95721065c41e..ed5c1601202c 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - Конфигурация, используемая для сборки пакета. По умолчанию для большинства проектов используется "Debug". + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + Конфигурация, используемая для сборки пакета. По умолчанию для большинства проектов используется "Debug". diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf index af268b9c0049..bdaa626419c6 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - Paketi derlemek için kullanılacak yapılandırma. Çoğu proje için varsayılan, ‘Hata Ayıklama’ seçeneğidir. + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + Paketi derlemek için kullanılacak yapılandırma. Çoğu proje için varsayılan, ‘Hata Ayıklama’ seçeneğidir. diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf index a364d4020ffd..8b7a9f08786c 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - 用于生成包的配置。大多数项目的默认值是 "Debug"。 + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + 用于生成包的配置。大多数项目的默认值是 "Debug"。 diff --git a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf index a9a1bc1170ca..253aecba0b91 100644 --- a/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf @@ -58,8 +58,8 @@ - The configuration to use for building the package. The default for most projects is 'Debug'. - 要用於建置套件的組態。大部分的專案預設為「偵錯」。 + The configuration to use for building the package. The default is 'Debug'. Use the `PackRelease` property to make 'Release' the default for this command. + 要用於建置套件的組態。大部分的專案預設為「偵錯」。 diff --git a/src/Cli/dotnet/commands/dotnet-publish/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-publish/LocalizableStrings.resx index 4cf239b7dde9..e7bc19d0ade8 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-publish/LocalizableStrings.resx @@ -146,7 +146,7 @@ The default is to publish a framework-dependent application. - The configuration to publish for. The default for most projects is 'Debug'. + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. Do not display the startup banner or the copyright message. diff --git a/src/Cli/dotnet/commands/dotnet-publish/Program.cs b/src/Cli/dotnet/commands/dotnet-publish/Program.cs index 03e2230eb414..fcb3b035a92e 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-publish/Program.cs @@ -30,12 +30,13 @@ public static PublishCommand FromArgs(string[] args, string msbuildPath = null) public static PublishCommand FromParseResult(ParseResult parseResult, string msbuildPath = null) { parseResult.HandleDebugSwitch(); - - var msbuildArgs = new List(); - parseResult.ShowHelpOrErrorIfAppropriate(); - msbuildArgs.Add("-target:Publish"); + var msbuildArgs = new List() + { + "-target:Publish", + "-property:_IsPublishing=true" + }; CommonOptions.ValidateSelfContainedOptions(parseResult.HasOption(PublishCommandParser.SelfContainedOption), parseResult.HasOption(PublishCommandParser.NoSelfContainedOption)); diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf index 2f8acca4af7f..aa7e342d4c83 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf @@ -55,8 +55,8 @@ Ve výchozím nastavení je publikována aplikace závislá na architektuře. - The configuration to publish for. The default for most projects is 'Debug'. - Konfigurace pro publikování. Výchozí možností pro většinu projektů je Debug. + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + Konfigurace pro publikování. Výchozí možností pro většinu projektů je Debug. diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf index 3decb88fb67e..d5bc93de32f7 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf @@ -55,8 +55,8 @@ Standardmäßig wird eine Framework-abhängige Anwendung veröffentlicht. - The configuration to publish for. The default for most projects is 'Debug'. - Die Konfiguration für die Veröffentlichung. Der Standardwert für die meisten Projekte ist "Debug". + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + Die Konfiguration für die Veröffentlichung. Der Standardwert für die meisten Projekte ist "Debug". diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf index 1477c2b4d617..e5609df8b45a 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf @@ -55,8 +55,8 @@ El valor predeterminado es publicar una aplicación dependiente del marco. - The configuration to publish for. The default for most projects is 'Debug'. - La configuración para la que se publica. El valor predeterminado para la mayoría de los proyectos es "Debug". + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + La configuración para la que se publica. El valor predeterminado para la mayoría de los proyectos es "Debug". diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf index 2d4bcda7a532..d9452e23bfa8 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf @@ -55,8 +55,8 @@ La valeur par défaut est de publier une application dépendante du framework. - The configuration to publish for. The default for most projects is 'Debug'. - Configuration pour laquelle la publication est effectuée. La valeur par défaut pour la plupart des projets est 'Debug'. + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + Configuration pour laquelle la publication est effectuée. La valeur par défaut pour la plupart des projets est 'Debug'. diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf index 92a894296033..ef7fb3635f1b 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf @@ -55,8 +55,8 @@ Per impostazione predefinita, viene generato un pacchetto dipendente dal framewo - The configuration to publish for. The default for most projects is 'Debug'. - Configurazione per cui eseguire la pubblicazione. L'impostazione predefinita per la maggior parte dei progetti è 'Debug'. + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + Configurazione per cui eseguire la pubblicazione. L'impostazione predefinita per la maggior parte dei progetti è 'Debug'. diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf index c652700f20fe..e3cf85a593bd 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf @@ -55,8 +55,8 @@ The default is to publish a framework-dependent application. - The configuration to publish for. The default for most projects is 'Debug'. - 公開する対象の構成。大部分のプロジェクトで、既定値は 'Debug' です。 + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + 公開する対象の構成。大部分のプロジェクトで、既定値は 'Debug' です。 diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf index f55e0bf59313..e80922ce0509 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf @@ -55,8 +55,8 @@ The default is to publish a framework-dependent application. - The configuration to publish for. The default for most projects is 'Debug'. - 게시할 구성입니다. 대부분의 프로젝트에서 기본값은 'Debug'입니다. + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + 게시할 구성입니다. 대부분의 프로젝트에서 기본값은 'Debug'입니다. diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf index 7a139a9f64e0..7ad29c958054 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf @@ -55,8 +55,8 @@ Domyślnie publikowana jest aplikacja zależna od struktury. - The configuration to publish for. The default for most projects is 'Debug'. - Konfiguracja, dla której ma być wykonane publikowanie. W przypadku większości projektów ustawienie domyślne to „Debugowanie”. + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + Konfiguracja, dla której ma być wykonane publikowanie. W przypadku większości projektów ustawienie domyślne to „Debugowanie”. diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf index 12a432daaf7b..38f08632a99f 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf @@ -55,8 +55,8 @@ O padrão é publicar uma aplicação dependente de framework. - The configuration to publish for. The default for most projects is 'Debug'. - A configuração para a qual a publicação ocorrerá. O padrão para a maioria dos projetos é 'Debug'. + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + A configuração para a qual a publicação ocorrerá. O padrão para a maioria dos projetos é 'Debug'. diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf index ed1a697e75c5..b82e68479c97 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf @@ -55,8 +55,8 @@ The default is to publish a framework-dependent application. - The configuration to publish for. The default for most projects is 'Debug'. - Конфигурация для публикации. По умолчанию для большинства проектов используется "Debug". + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + Конфигурация для публикации. По умолчанию для большинства проектов используется "Debug". diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf index 6f7f23cf8209..e50749568230 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf @@ -55,8 +55,8 @@ Varsayılan durum, çerçeveye bağımlı bir uygulama yayımlamaktır. - The configuration to publish for. The default for most projects is 'Debug'. - Yayımlanacak yapılandırma. Çoğu proje için varsayılan, ‘Hata Ayıklama’ seçeneğidir. + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + Yayımlanacak yapılandırma. Çoğu proje için varsayılan, ‘Hata Ayıklama’ seçeneğidir. diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf index 87d6b7d341b4..e00d237d981b 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf @@ -55,8 +55,8 @@ The default is to publish a framework-dependent application. - The configuration to publish for. The default for most projects is 'Debug'. - 要发布的配置。大多数项目的默认值是 "Debug"。 + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + 要发布的配置。大多数项目的默认值是 "Debug"。 diff --git a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf index 0174c85c9804..2461cb1919f8 100644 --- a/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf @@ -55,8 +55,8 @@ The default is to publish a framework-dependent application. - The configuration to publish for. The default for most projects is 'Debug'. - 要為其進行發佈的組態。大部分的專案預設為「偵錯」。 + The configuration to publish for. The default is 'Debug'. Use the `PublishRelease` property to make 'Release' the default for this command. + 要為其進行發佈的組態。大部分的專案預設為「偵錯」。 diff --git a/src/Cli/dotnet/commands/dotnet-tool/update/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-tool/update/xlf/LocalizableStrings.de.xlf index 5fa8f2f581ae..0aed08ad4569 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/update/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-tool/update/xlf/LocalizableStrings.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props index 5c53e2358ca1..f92f45f8bfc2 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props @@ -20,7 +20,9 @@ Copyright (c) .NET Foundation. All rights reserved. Debug;Release AnyCPU - Debug + Release + Release + Debug AnyCPU diff --git a/src/Tests/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackAHelloWorldProject.cs b/src/Tests/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackAHelloWorldProject.cs index c08f95d5099f..ac9bc16047dc 100644 --- a/src/Tests/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackAHelloWorldProject.cs +++ b/src/Tests/Microsoft.NET.Pack.Tests/GivenThatWeWantToPackAHelloWorldProject.cs @@ -84,5 +84,57 @@ public void It_fails_if_nobuild_was_requested_but_build_was_invoked() .And .HaveStdOutContaining("NETSDK1085"); } + + [Fact] + public void It_packs_with_release_if_PackRelease_property_set() + { + var helloWorldAsset = _testAssetsManager + .CopyTestAsset("HelloWorld", "PackReleaseHelloWorld") + .WithSource(); + + System.IO.File.WriteAllText(helloWorldAsset.Path + "/Directory.Build.props", "true"); + + new BuildCommand(helloWorldAsset) + .Execute() + .Should() + .Pass(); + + var packCommand = new DotnetPackCommand(Log, helloWorldAsset.TestRoot); + + packCommand + .Execute() + .Should() + .Pass(); + + var expectedAssetPath = System.IO.Path.Combine(helloWorldAsset.Path, "bin", "Release", "HelloWorld.1.0.0.nupkg"); + Assert.True(File.Exists(expectedAssetPath)); + } + + [Fact] + public void A_PackRelease_property_does_not_override_other_command_configuration() + { + var helloWorldAsset = _testAssetsManager + .CopyTestAsset("HelloWorld", "PackPropertiesHelloWorld") + .WithSource() + .WithTargetFramework("net7.0"); + + System.IO.File.WriteAllText(helloWorldAsset.Path + "/Directory.Build.props", "true"); + + new BuildCommand(helloWorldAsset) + .Execute() + .Should() + .Pass(); + + // Another command, which should not be affected by PackRelease + var publishCommand = new DotnetPublishCommand(Log, helloWorldAsset.TestRoot); + + publishCommand + .Execute() + .Should() + .Pass(); + + var expectedAssetPath = System.IO.Path.Combine(helloWorldAsset.Path, "bin", "Release", "net7.0", "HelloWorld.dll"); + Assert.False(File.Exists(expectedAssetPath)); + } } } diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs index 3c4727732acb..034c4e58c38a 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs @@ -139,7 +139,7 @@ public void Publish_self_contained_app_with_dot_in_the_name() RuntimeIdentifier = rid, IsExe = true, }; - + testProject.AdditionalProperties["CopyLocalLockFileAssemblies"] = "true"; testProject.SourceFiles["Program.cs"] = $@" using System; @@ -162,7 +162,7 @@ public static void Main() publishDirectory.Should().HaveFile($"Hello.World{Constants.ExeSuffix}"); } - + [Theory] [InlineData("win-arm")] [InlineData("win8-arm")] @@ -206,14 +206,14 @@ public static void Main() targetFramework: targetFramework, runtimeIdentifier: runtimeIdentifier); var outputDirectory = publishDirectory.Parent; - + // The name of the self contained executable depends on the runtime identifier. // For Windows family ARM publishing, it'll always be Hello.exe. // We shouldn't use "Constants.ExeSuffix" for the suffix here because that changes // depending on the RuntimeInformation var selfContainedExecutable = "Hello.exe"; - var filesPublished = new [] { + var filesPublished = new[] { selfContainedExecutable, "Hello.dll", "Hello.pdb", @@ -423,6 +423,32 @@ public void It_fails_for_unsupported_rid() publishResult.Should().Fail(); } + [Fact] + public void It_publishes_on_release_if_PublishRelease_property_set() + { + var helloWorldAsset = _testAssetsManager + .CopyTestAsset("HelloWorld", "PublishReleaseHelloWorld") + .WithSource() + .WithTargetFramework("net7.0"); + + System.IO.File.WriteAllText(helloWorldAsset.Path + "/Directory.Build.props", "true"); + + new BuildCommand(helloWorldAsset) + .Execute() + .Should() + .Pass(); + + var publishCommand = new DotnetPublishCommand(Log, helloWorldAsset.TestRoot); + + publishCommand + .Execute() + .Should() + .Pass(); + + var expectedAssetPath = System.IO.Path.Combine(helloWorldAsset.Path, "bin", "Release", "net7.0", "HelloWorld.dll"); + Assert.True(File.Exists(expectedAssetPath)); + } + [Fact] public void It_allows_unsupported_rid_with_override() { @@ -522,7 +548,7 @@ public void It_contains_no_duplicates_in_resolved_publish_assets(string type) testProject.AdditionalProperties.Add("UseWpf", "true"); testProject.AdditionalProperties.Add("UseWindowsForms", "true"); break; - case "console": + case "console": break; case "web": testProject.ProjectSdk = "Microsoft.NET.Sdk.Web"; diff --git a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index 33c26c162735..6f166254055d 100644 --- a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -18,6 +18,9 @@ namespace Microsoft.DotNet.Cli.Publish.Tests { public class GivenDotnetPublishPublishesProjects : SdkTest { + + private static string _defaultConfiguration = "Debug"; + public GivenDotnetPublishPublishesProjects(ITestOutputHelper log) : base(log) { } @@ -40,7 +43,7 @@ public void ItPublishesARunnablePortableApp() .Execute("--framework", ToolsetInfo.CurrentTargetFramework) .Should().Pass(); - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? _defaultConfiguration; var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, ToolsetInfo.CurrentTargetFramework, "publish", $"{testAppName}.dll"); new DotnetCommand(Log) @@ -204,7 +207,7 @@ private DirectoryInfo PublishApp(string testAppName, string rid, string args = n .Execute(args?.Split() ?? Array.Empty()) .Should().Pass(); - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? _defaultConfiguration; return new DirectoryInfo(Path.Combine(testProjectDirectory, "bin", configuration, ToolsetInfo.CurrentTargetFramework, rid ?? "", "publish")); } @@ -225,7 +228,7 @@ public void ItPublishesAppWhenRestoringToSpecificPackageDirectory() .Execute("--no-restore") .Should().Pass(); - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? _defaultConfiguration; var outputProgram = Path.Combine(rootDir, "bin", configuration, ToolsetInfo.CurrentTargetFramework, "publish", $"TestAppSimple.dll"); @@ -276,7 +279,7 @@ public void ItPublishesSuccessfullyWithNoBuildIfPreviouslyBuilt(bool selfContain .Should() .Pass(); - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? _defaultConfiguration; var outputProgram = Path.Combine(rootPath, "bin", configuration, ToolsetInfo.CurrentTargetFramework, rid, "publish", $"TestAppSimple.dll"); @@ -340,5 +343,32 @@ public void DotnetPublishAllowsPublishOutputDir() .Should() .Pass(); } + + + [Fact] + public void A_PublishRelease_property_does_not_override_other_command_configuration() + { + var helloWorldAsset = _testAssetsManager + .CopyTestAsset("HelloWorld", "PublishPropertiesHelloWorld") + .WithSource(); + + System.IO.File.WriteAllText(helloWorldAsset.Path + "/Directory.Build.props", "true"); + + new BuildCommand(helloWorldAsset) + .Execute() + .Should() + .Pass(); + + // Another command, which should not be affected by PublishRelease + var packCommand = new DotnetPackCommand(Log, helloWorldAsset.TestRoot); + + packCommand + .Execute() + .Should() + .Pass(); + + var expectedAssetPath = System.IO.Path.Combine(helloWorldAsset.Path, "bin", "Release", "HelloWorld.1.0.0.nupkg"); + Assert.False(File.Exists(expectedAssetPath)); + } } } diff --git a/src/Tests/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs b/src/Tests/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs index f599142f1a3b..611b1e06cb3e 100644 --- a/src/Tests/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs +++ b/src/Tests/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs @@ -17,6 +17,7 @@ public class GivenDotnetStoresAndPublishesProjects : SdkTest { private static string _tfm = "netcoreapp3.1"; private static string _arch = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); + private static string _defaultConfiguration = "Debug"; public GivenDotnetStoresAndPublishesProjects(ITestOutputHelper log) : base(log) { @@ -51,7 +52,7 @@ public void ItPublishesARunnablePortableApp() .Execute() .Should().Pass(); - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? _defaultConfiguration; var profileFilter = Path.Combine(localAssemblyCache, _arch, _tfm, "artifact.xml"); new DotnetPublishCommand(Log, @@ -89,7 +90,7 @@ public void AppFailsDueToMissingCache() .Execute() .Should().Pass(); - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? _defaultConfiguration; new DotnetPublishCommand(Log, "-f", _tfm, @@ -147,7 +148,7 @@ public void ItPublishesAnAppWithMultipleProfiles() .Execute() .Should().Pass(); - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? _defaultConfiguration; new DotnetPublishCommand(Log, "-f", _tfm, diff --git a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPackInvocation.cs b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPackInvocation.cs index b4c5dffa4a15..d4726e1ace94 100644 --- a/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPackInvocation.cs +++ b/src/Tests/dotnet.Tests/dotnet-msbuild/GivenDotnetPackInvocation.cs @@ -17,8 +17,9 @@ public class GivenDotnetPackInvocation : IClassFixture