You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReadApiCompatibilityLevel of NuGetForUnity.Cli/Fakes /Application.cs always returns apiCompatibilityLevel and never apiCompatibilityLevelPerPlatform
#668
Open
Flauschelin opened this issue
Sep 11, 2024
· 0 comments
The apiCompatibilityLevelPerPlatform is never returned when using CLI
NuGetForUnity Version: Master branch
Unity Version: 2020.3.48f1
Operating System: Windows
To me it looks like the Method ReadApiCompatibilityLevel(string projectPath) will returns as soon as it found the textline "apiCompatibilityLevel:" and was able to parse the integer value.
if (trimmedLine.StartsWith(apiCompatibilityLevelConfigName, StringComparison.OrdinalIgnoreCase))
{
var stringValue = trimmedLine[apiCompatibilityLevelConfigName.Length..].Trim();
if (int.TryParse(stringValue, out var value))
{
return value;
}
}
However, it finds and parse the "apiCompatibilityLevelPerPlatform:" entries as well, but at least my Unity always includes the general "apiCompatibilityLevel:" at the end of the ProjectSettings.asset file.
I would suggest not to return immediately, but instead keep the value and only use it in case no "PerPlatform" value has been found.
It would also be good if we could specify the platform.
What seems also strange is the decision which .NET version should be used: return perPlatformConfig.Values.Max();
.NET2.x has the integer value 6 and and .NET4.x has a integer of 3. So Max() would return .NET2.x
The text was updated successfully, but these errors were encountered:
The apiCompatibilityLevelPerPlatform is never returned when using CLI
To me it looks like the Method ReadApiCompatibilityLevel(string projectPath) will returns as soon as it found the textline "apiCompatibilityLevel:" and was able to parse the integer value.
However, it finds and parse the "apiCompatibilityLevelPerPlatform:" entries as well, but at least my Unity always includes the general "apiCompatibilityLevel:" at the end of the ProjectSettings.asset file.
I would suggest not to return immediately, but instead keep the value and only use it in case no "PerPlatform" value has been found.
It would also be good if we could specify the platform.
What seems also strange is the decision which .NET version should be used:
return perPlatformConfig.Values.Max();
.NET2.x has the integer value 6 and and .NET4.x has a integer of 3. So Max() would return .NET2.x
The text was updated successfully, but these errors were encountered: