Skip to content

Commit fb04b6f

Browse files
committed
use real MSBuild for all test evaluations
1 parent e263fb7 commit fb04b6f

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

Microsoft.NET.Build.Containers/ParseContainerProperties.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,15 @@ public override bool Execute()
115115
else
116116
{
117117
validTags = Array.Empty<string>();
118-
Log.LogError(null, KnownStrings.ErrorCodes.CONTAINER004, "Container.InvalidTag", null, 0, 0, 0, 0, $"Invalid {nameof(ContainerImageTag)} provided: {{0}}. Image tags must be alphanumeric, underscore, hyphen, or period.", ContainerImageTag);
118+
Log.LogError(null, KnownStrings.ErrorCodes.CONTAINER004, "Container.InvalidTag", null, 0, 0, 0, 0, "Invalid {0} provided: {1}. Image tags must be alphanumeric, underscore, hyphen, or period.", nameof(ContainerImageTag), ContainerImageTag);
119119
}
120120
}
121121
else if (ContainerImageTags.Length != 0 && TryValidateTags(ContainerImageTags, out var valids, out var invalids))
122122
{
123123
validTags = valids;
124124
if (invalids.Any())
125125
{
126-
(string message, string args) = invalids switch
127-
{
128-
{ Length: 1 } => ($"Invalid {nameof(ContainerImageTags)} provided: {{0}}. {nameof(ContainerImageTags)} must be a semicolon-delimited list of valid image tags. Image tags must be alphanumeric, underscore, hyphen, or period.", invalids[0]),
129-
_ => ($"Invalid {nameof(ContainerImageTags)} provided: {{0}}. {nameof(ContainerImageTags)} must be a semicolon-delimited list of valid image tags. Image tags must be alphanumeric, underscore, hyphen, or period.", String.Join(", ", invalids))
130-
};
131-
Log.LogError(null, KnownStrings.ErrorCodes.CONTAINER004, "Container.InvalidTag", null, 0, 0, 0, 0, message, args);
126+
Log.LogError(null, KnownStrings.ErrorCodes.CONTAINER004, "Container.InvalidTag", null, 0, 0, 0, 0, "Invalid {0} provided: {1}. {0} must be a semicolon-delimited list of valid image tags. Image tags must be alphanumeric, underscore, hyphen, or period.", nameof(ContainerImageTags), String.Join(",", invalids));
132127
return !Log.HasLoggedErrors;
133128
}
134129
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace Test.Microsoft.NET.Build.Containers;
2+
3+
public static class KnownStrings {
4+
public static string ContainerBaseImage = nameof(ContainerBaseImage);
5+
public static string ContainerRegistry = nameof(ContainerRegistry);
6+
public static string ContainerImageName = nameof(ContainerImageName);
7+
public static string ContainerImageTag = nameof(ContainerImageTag);
8+
public static string ContainerImageTags = nameof(ContainerImageTags);
9+
public static string ContainerWorkingDirectory = nameof(ContainerWorkingDirectory);
10+
public static string ContainerEntrypoint = nameof(ContainerEntrypoint);
11+
public static string UseAppHost = nameof(UseAppHost);
12+
public static string ContainerLabel = nameof(ContainerLabel);
13+
public static string SelfContained = nameof(SelfContained);
14+
public static string ContainerPort = nameof(ContainerPort);
15+
public static string ContainerEnvironmentVariable = nameof(ContainerEnvironmentVariable);
16+
17+
public static string ComputeContainerConfig = nameof(ComputeContainerConfig);
18+
public static string AssemblyName = nameof(AssemblyName);
19+
public static string ContainerBaseRegistry = nameof(ContainerBaseRegistry);
20+
public static string ContainerBaseName = nameof(ContainerBaseName);
21+
public static string ContainerBaseTag = nameof(ContainerBaseTag);
22+
23+
public static class ErrorCodes {
24+
public static string CONTAINER001 = nameof(CONTAINER001);
25+
public static string CONTAINER004 = nameof(CONTAINER004);
26+
public static string CONTAINER005 = nameof(CONTAINER005);
27+
}
28+
}

0 commit comments

Comments
 (0)