Skip to content

Commit

Permalink
Add warning for invalid publishsc values
Browse files Browse the repository at this point in the history
  • Loading branch information
nagilson committed Nov 2, 2022
1 parent 91fc5b0 commit 0f8d4a7
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Tasks/Common/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -875,4 +875,8 @@ You may need to build the project on another operating system or architecture, o
<value>NETSDK1192: Targeting .NET 7.0 or higher in Visual Studio 2022 17.3 is not supported.</value>
<comment>{StrBegin="NETSDK1192: "}</comment>
</data>
<data name="PublishSelfContainedMustBeBool" xml:space="preserve">
<value>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</value>
<comment>{StrBegin="NETSDK1193: "}</comment>
</data>
</root>
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: Kompilace ReadyToRun se přeskočí, protože se podporuje jen pro architekturu .NET Core 3.0 a vyšší.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: Publikování aplikace do jednoho souboru vyžaduje architekturu .NET Core 3.0 nebo vyšší.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: Die ReadyToRun-Kompilierung wird übersprungen, weil sie nur für .NET Core 3.0 oder höher unterstützt wird.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: Zum Veröffentlichen einer Anwendung in einer einzelnen Datei ist .NET Core 3.0 oder höher erforderlich.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: Se omitirá la compilación de ReadyToRun porque solo se admite para .NET Core 3.0 o versiones posteriores.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: La publicación de una aplicación en un único archivo requiere .NET Core 3.0 o versiones posteriores.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: la compilation ReadyToRun va être ignorée, car elle est uniquement prise en charge pour .NET Core 3.0 ou une version ultérieure.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: la publication d'une application sur un seul fichier nécessite .NET Core 3.0 ou une version ultérieure.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: la compilazione eseguita con ReadyToRun verrà ignorata perché è supportata solo per .NET Core 3.0 o versioni successive.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: per la pubblicazione di un'applicazione in un file singolo è richiesto .NET Core 3.0 o versioni successive.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: ReadyToRun コンパイルは、.NET Core 3.0 以降でのみサポートされているため、スキップされます。</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: アプリケーションを 1 つのファイルに発行するには、.NET Core 3.0 以降が必要です。</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: ReadyToRun 컴파일은 .NET Core 3.0 이상에서만 지원되므로 건너뜁니다.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: 애플리케이션을 단일 파일에 게시하려면 .NET Core 3.0 이상이 필요합니다.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: Kompilacja ReadyToRun zostanie pominięta, ponieważ jest obsługiwana tylko w przypadku platformy .NET Core 3.0 lub nowszej.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: Publikowanie aplikacji do pojedynczego pliku wymaga platformy .NET Core 3.0 lub nowszej.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: a compilação de ReadyToRun será ignorada porque ela é compatível apenas com o .NET Core 3.0 ou superior.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: a publicação de um aplicativo em um único arquivo exige o .NET Core 3.0 ou superior.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: компиляция ReadyToRun будет пропущена, так как она поддерживается только для .NET Core 3.0 или более поздних версий.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: для публикации приложения в один файл требуется .NET Core 3.0 или более поздняя версия.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: ReadyToRun derlemesi, yalnızca .NET Core 3.0 veya üzeri için desteklendiğinden atlanacak.</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: Bir uygulamayı tek bir dosyada yayımlamak için .NET Core 3.0 veya üzeri gerekir.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: 将跳过 ReadyToRun 编译,因为只有 .NET Core 3.0 或更高版本才支持该编译。</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: 将应用程序发布到单个文件需要 .NET Core 3.0 或更高版本。</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1122: 將跳過 ReadyToRun 編譯,原因是只有 .NET Core 3.0 或更高版本支援此作業。</target>
<note>{StrBegin="NETSDK1122: "}</note>
</trans-unit>
<trans-unit id="PublishSelfContainedMustBeBool">
<source>NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</source>
<target state="new">NETSDK1193: PublishSelfContained must be either true or false. The value given was '{0}'.</target>
<note>{StrBegin="NETSDK1193: "}</note>
</trans-unit>
<trans-unit id="PublishSingleFileRequiresVersion30">
<source>NETSDK1123: Publishing an application to a single-file requires .NET Core 3.0 or higher.</source>
<target state="translated">NETSDK1123: 將應用程式發行至單一檔案需使用 .NET Core 3.0 或更高版本。</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ Copyright (c) .NET Foundation. All rights reserved.
FormatArguments="PublishAot"/>

<!-- End of implicit RID resolver checks.-->

<NETSdkError Condition="'$(PublishSelfContained)' != 'true' and '$(PublishSelfContained)' != 'false' and '$(PublishSelfContained)' != ''"
ResourceName="PublishSelfContainedMustBeBool"
FormatArguments="$(PublishSelfContained)"/>

<NETSdkError Condition="'$(SelfContained)' == 'true' and '$(UseAppHost)' != 'true' and '$(_RuntimeIdentifierUsesAppHost)' == 'true'"
ResourceName="CannotUseSelfContainedWithoutAppHost" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,21 @@ public void PublishSelfContainedPropertyDoesOrDoesntOverrideSelfContainProperty(
publishedDirectory.Should().HaveFiles(expectedFiles);
}

[Fact]
public void ItFailsWith1193IfPublishSelfContainedHasInvalidValue()
{
var testAsset = _testAssetsManager
.CopyTestAsset("HelloWorld", identifier: "NET1193Failure")
.WithSource();

var publishCommand = new PublishCommand(testAsset);
publishCommand
.Execute("-p:PublishSelfContained=Invalid")
.Should()
.Fail()
.And.HaveStdOutContaining("NETSDK1193");
}

[Theory]
[InlineData("--sc=false")]
[InlineData("--self-contained=false")]
Expand Down

0 comments on commit 0f8d4a7

Please sign in to comment.