Skip to content

Commit

Permalink
fix: Adjust environment name
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Apr 4, 2024
1 parent aceddbf commit c8e22c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<CompilerVisibleProperty Include="DesignTimeBuild" />
<CompilerVisibleProperty Include="UnoUISourceGeneratorDebuggerBreak" />
<CompilerVisibleProperty Include="BuildingInsideVisualStudio" />
<CompilerVisibleProperty Include="UnoPlatformIDE" />
<CompilerVisibleProperty Include="IsHotReloadHost" />
<CompilerVisibleProperty Include="UnoForceHotReloadCodeGen" />
<CompilerVisibleProperty Include="UnoForceIncludeProjectConfiguration" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ private void TrackStartGeneration(XamlFileDefinition[] files)
("IsUiAutomationMappingEnabled", _isUiAutomationMappingEnabled.ToString()),
("DefaultLanguage", _defaultLanguage ?? "Unknown"),
("IsRunningCI", IsRunningCI.ToString()),
("BuildingInsideVisualStudio", _generatorContext.GetMSBuildPropertyValue("BuildingInsideVisualStudio")?.ToString()),
("BuildingInsideVisualStudio", _generatorContext.GetMSBuildPropertyValue("BuildingInsideVisualStudio")?.ToString().ToLowerInvariant()),
("IDE", BuildIDEName()),
},
new[] { ("FileCount", (double)files.Length) }
);
Expand All @@ -131,6 +132,22 @@ private void TrackStartGeneration(XamlFileDefinition[] files)
}
}

private string BuildIDEName()
{
if (bool.TryParse(_generatorContext.GetMSBuildPropertyValue("BuildingInsideVisualStudio")?.ToString(), out var insideVS) && insideVS)
{
return "vswin";
}
else if (_generatorContext.GetMSBuildPropertyValue("UnoPlatformIDE")?.ToString() is { } unoPlatformIDE)
{
return unoPlatformIDE;
}
else
{
return "unknown";
}
}

private string BuildUnoRuntimeValue()
{
var constants = _generatorContext.GetMSBuildPropertyValue("DefineConstantsProperty");
Expand Down

0 comments on commit c8e22c5

Please sign in to comment.