Skip to content

Add support in .NET SDK for implicit versions of AspNetCore.App and .All #2533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "2.2.100-preview1-009263"
"version": "2.2.100-preview3-009413"
},
"msbuild-sdks": {
"RoslynTools.RepoToolset": "1.0.0-beta2-62912-01"
Expand Down
39 changes: 30 additions & 9 deletions src/Tasks/Common/MessageBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ namespace Microsoft.NET.Build.Tasks
/// </summary>
public abstract class MessageBase : TaskBase
{
/// <summary>
/// Formatted text for the message
/// </summary>
public string FormattedText { get; set; }

/// <summary>
/// The name of the resource in Strings.resx that contains the desired error message.
/// </summary>
[Required]
public string ResourceName { get; set; }

/// <summary>
Expand All @@ -31,17 +35,34 @@ internal MessageBase()

protected override void ExecuteCore()
{
if (FormatArguments == null || FormatArguments.Length == 0)
string message = null;
if (string.IsNullOrEmpty(FormattedText) && string.IsNullOrEmpty(ResourceName))
{
throw new ArgumentException($"Either {nameof(FormattedText)} or {nameof(ResourceName)} must be specified.");
}
else if (!string.IsNullOrEmpty(FormattedText) && !string.IsNullOrEmpty(ResourceName))
{
// We use a single-item array with one empty string in this case so that
// it is possible to interpret FormatArguments="$(EmptyVariable)" as a request
// to pass an empty string on to string.Format. Note if there are not placeholders
// in the string, then the empty string arg will be ignored.
FormatArguments = EmptyArguments;
throw new ArgumentException($"Only one of {nameof(FormattedText)} and {nameof(ResourceName)} can be specified.");
}
else if (!string.IsNullOrEmpty(ResourceName))
{
if (FormatArguments == null || FormatArguments.Length == 0)
{
// We use a single-item array with one empty string in this case so that
// it is possible to interpret FormatArguments="$(EmptyVariable)" as a request
// to pass an empty string on to string.Format. Note if there are not placeholders
// in the string, then the empty string arg will be ignored.
FormatArguments = EmptyArguments;
}

string format = Strings.ResourceManager.GetString(ResourceName, Strings.Culture);
string message = string.Format(CultureInfo.CurrentCulture, format, FormatArguments);
string format = Strings.ResourceManager.GetString(ResourceName, Strings.Culture);
message = string.Format(CultureInfo.CurrentCulture, format, FormatArguments);
}
else
{
message = FormattedText;
}


LogMessage(message);
}
Expand Down
4 changes: 1 addition & 3 deletions src/Tasks/Common/MetadataKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ internal static class MetadataKeys
public const string PackageVersion = "PackageVersion";
public const string IsImplicitlyDefined = "IsImplicitlyDefined";
public const string IsTopLevelDependency = "IsTopLevelDependency";
public const string AllowExplicitVersion = "AllowExplicitVersion";

// Target Metadata
public const string RuntimeIdentifier = "RuntimeIdentifier";
Expand Down Expand Up @@ -81,8 +82,5 @@ internal static class MetadataKeys
// Resource assemblies
public const string Culture = "Culture";
public const string DestinationSubDirectory = "DestinationSubDirectory";

// Expected platform packages
public const string ExpectedVersion = "ExpectedVersion";
}
}
5 changes: 4 additions & 1 deletion src/Tasks/Common/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,7 @@ The following are names of parameters or literal values and should not be transl
<value>NETSDK1070: The application configuration file must have root configuration element.</value>
<comment>{StrBegin="NETSDK1070: "}</comment>
</data>
</root>
<data name="PackageReferenceVersionNotRecommended" xml:space="preserve">
<value>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</value>
</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: Chybí metadata {0} o {1} položky {2}.</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: Nerozpoznaný token preprocesoru {0} v {1}.</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: Die Metadaten "{0}" für das Element "{2}" vom Typ "{1}" sind nicht vorhanden.</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: Unbekanntes Präprozessortoken "{0}" in "{1}".</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: Faltan los metadatos de "{0}" en el elemento de "{1}" "{2}".</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: Token de preprocesador no reconocido "{0}" en "{1}".</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: Métadonnées '{0}' manquantes sur l'élément '{1}' '{2}'.</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: Jeton de préprocesseur '{0}' non reconnu dans '{1}'.</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: mancano i metadati di '{0}' sull'elemento '{2}' di '{1}'.</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: token di preprocessore '{0}' non riconosciuto in '{1}'.</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: '{1}' 項目 '{2}' の '{0}' メタデータがありません。</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: 認識されないプリプロセッサ トークン '{0}' が '{1}' に存在します。</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: '{1}' 항목 '{2}'에 '{0}' 메타데이터가 없습니다.</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: '{1}'에서 전처리기 토큰 '{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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: Brak metadanych „{0}” w elemencie „{1}” „{2}”.</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: Nierozpoznany token preprocesora „{0}” w elemencie „{1}”.</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: Metadados '{0}' ausentes no item '{1}' '{2}'.</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: Token de pré-processador não reconhecido '{0}' em '{1}'.</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: отсутствуют метаданные "{0}" для элемента "{2}" в "{1}".</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: не распознан маркер препроцессора "{0}" в "{1}".</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: '{1}' öğesi '{2}' üzerinde '{0}' meta verileri eksik.</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: '{1}' içinde tanınmayan '{0}' ön işlemci belirteci.</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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: 在“{1}”项“{2}”上缺少“{0}”元数据。</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009:“{1}”中无法识别预处理器标记“{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 @@ -67,6 +67,11 @@
<target state="translated">NETSDK1008: '{1}' 項目 '{2}' 上遺漏 '{0}' 中繼資料。</target>
<note>{StrBegin="NETSDK1008: "}</note>
</trans-unit>
<trans-unit id="PackageReferenceVersionNotRecommended">
<source>NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</source>
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPreprocessorToken">
<source>NETSDK1009: Unrecognized preprocessor token '{0}' in '{1}'.</source>
<target state="translated">NETSDK1009: '{1}' 中的前置處理器語彙基元 '{0}' 無法辨識。</target>
Expand Down
Loading