Skip to content

Commit aecc325

Browse files
committed
Add special cases to the reporter for environment variable versions and setup the current maui android scenarios to use the non-special case.
1 parent 330d457 commit aecc325

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/scenarios/mauiandroid/pre.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636

3737
# Copy the MauiVersion to a file so we have it on the machine
3838
maui_version = GetVersionFromDll(rf".\{const.APPDIR}\obj\Release\{precommands.framework}\{precommands.runtime_identifier}\linked\Microsoft.Maui.dll")
39-
version_dict = { "maui_version": maui_version }
39+
version_dict = { "mauiVersion": maui_version }
4040
versionswritejson(version_dict, rf"{precommands.output}\versions.json")
4141
print(f"Versions: {version_dict}")

src/scenarios/mauiandroidpodcast/pre.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
RemoveAABFiles(precommands.output)
3131

3232
maui_version = GetVersionFromDll(f".\{const.APPDIR}\src\Mobile\obj\Release\{precommands.framework}\{precommands.runtime_identifier}\linked\Microsoft.Maui.dll")
33-
version_dict = { "maui_version": maui_version }
33+
version_dict = { "mauiVersion": maui_version }
3434
versionswritejson(version_dict, rf"{precommands.output}\versions.json")
3535
print(f"Versions: {version_dict}")

src/scenarios/mauiblazorandroid/pre.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@
7373

7474
# Copy the MauiVersion to a file so we have it on the machine
7575
maui_version = GetVersionFromDll(rf".\{const.APPDIR}\obj\Release\{precommands.framework}\{precommands.runtime_identifier}\linked\Microsoft.Maui.dll")
76-
version_dict = { "maui_version": maui_version }
76+
version_dict = { "mauiVersion": maui_version }
7777
versionswritejson(version_dict, rf"{precommands.output}\versions.json")
7878
print(f"Versions: {version_dict}")

src/tools/Reporting/Reporting/Reporter.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,14 @@ private void Init()
9393
foreach (DictionaryEntry entry in environment.GetEnvironmentVariables()){
9494
if (entry.Key.ToString().EndsWith("version", ignoreCase: true, culture: CultureInfo.InvariantCulture))
9595
{
96-
build.AdditionalData[entry.Key.ToString()] = entry.Value.ToString();
96+
// Special case the original two special cases, MAUI_VERSION is only needed because runtime based runs use MAUI_VERSION
97+
if(entry.Key.ToString().Equals("DOTNET_VERSION", StringComparison.InvariantCultureIgnoreCase)){
98+
build.AdditionalData["productVersion"] = entry.Value.ToString();
99+
} else if(entry.Key.ToString().Equals("MAUI_VERSION", StringComparison.InvariantCultureIgnoreCase)){
100+
build.AdditionalData["mauiVersion"] = entry.Value.ToString();
101+
} else {
102+
build.AdditionalData[entry.Key.ToString()] = entry.Value.ToString();
103+
}
97104
}
98105
}
99106
}

0 commit comments

Comments
 (0)