Skip to content
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
14 changes: 10 additions & 4 deletions src/ResourcesGenerator/ResourceCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ namespace ResourcesGenerator
{
public class ResourceCreator
{
private static string[] msBuildDlls = new string[]
private static string[] dlls = new string[]
{
"MSBuild.exe",
"Microsoft.Build.dll",
"Microsoft.Build.Tasks.Core.dll",
"Microsoft.Build.Utilities.Core.dll"
"Microsoft.Build.Utilities.Core.dll",
"Roslyn\\Microsoft.CodeAnalysis.dll"
};

public static string[] ResourceNames = new[]
Expand Down Expand Up @@ -74,7 +75,12 @@ public class ResourceCreator
"ProjectImportSkippedExpressionEvaluatedToEmpty",
"SkipTargetBecauseOutputsUpToDate",
"MetaprojectGenerated",
"PickedUpSwitchesFromAutoResponse"
"PickedUpSwitchesFromAutoResponse",
"EvaluationStarted",
"EvaluationFinished",
"UninitializedPropertyRead",
"AnalyzerTotalExecutionTime",
"GeneratorTotalExecutionTime"
};

public static Dictionary<string, string> Cultures = new Dictionary<string, string>
Expand Down Expand Up @@ -105,7 +111,7 @@ public static void CreateResourceFile(string msbuildPath)
Dictionary<string, string> resourcesByCulture = new Dictionary<string, string>();
cultureResources.Add(culture.Value, resourcesByCulture);

foreach (string dll in msBuildDlls)
foreach (string dll in dlls)
{
var assembly = Assembly.LoadFrom(Path.Combine(msbuildPath, dll));
string[] manifestResourceNames = assembly.GetManifestResourceNames();
Expand Down
3 changes: 2 additions & 1 deletion src/ResourcesGenerator/ResourcesGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net48</TargetFramework>
Comment thread
KirillOsenkov marked this conversation as resolved.
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/StructuredLogger/Analyzers/CscTaskAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public static (Folder Analyzers, Folder Generators) Analyze(Task task)
foreach (var message in task.GetMessages().ToArray())
{
var text = message.Text;
if (text.StartsWith(Strings.TotalAnalyzerExecutionTime, StringComparison.Ordinal))
if (Strings.TotalAnalyzerExecutionTimeRegex.IsMatch(text))
{
analyzerReport = new Folder();
analyzerReport.Name = Strings.AnalyzerReport;
task.AddChild(analyzerReport);
parent = analyzerReport;
currentReport = analyzerReport;
}
else if (text.StartsWith(Strings.TotalGeneratorExecutionTime, StringComparison.Ordinal))
if (Strings.TotalGeneratorExecutionTimeRegex.IsMatch(text))
{
generatorReport = new Folder();
generatorReport.Name = Strings.GeneratorReport;
Expand Down
9 changes: 6 additions & 3 deletions src/StructuredLogger/Strings/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ private static void InitializeRegex()
RemovingPropertiesPrefix = GetString("General.UndefineProperties");
EvaluationStarted = GetString("EvaluationStarted");
EvaluationFinished = GetString("EvaluationFinished");

TotalAnalyzerExecutionTimeRegex = CreateRegex(GetString("AnalyzerTotalExecutionTime"), 1);
TotalGeneratorExecutionTimeRegex = CreateRegex(GetString("GeneratorTotalExecutionTime"), 1);
}

private static string GetEmptyConditionText()
Expand Down Expand Up @@ -440,6 +443,9 @@ public static Regex CreateRegex(string text, int replacePlaceholders = 0, RegexO
public static Regex TaskFoundRegex { get; set; }
public static Regex CouldNotResolveSdkRegex { get; set; }

public static Regex TotalAnalyzerExecutionTimeRegex { get; set; }
public static Regex TotalGeneratorExecutionTimeRegex { get; set; }

public static string TargetSkippedFalseCondition { get; set; }
public static string TargetAlreadyCompleteSuccess { get; set; }
public static string TargetAlreadyCompleteFailure { get; set; }
Expand Down Expand Up @@ -605,9 +611,6 @@ public static Match IsFoundConflicts(string text)
public static string To => "\" to \"";
public static string ToFile => "\" to file \"";

public static string TotalAnalyzerExecutionTime => "Total analyzer execution time:";
public static string TotalGeneratorExecutionTime => "Total generator execution time:";

/// <summary>
/// https://github.com/NuGet/Home/issues/10383
/// </summary>
Expand Down
Loading