Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadApiCompatibilityLevel of NuGetForUnity.Cli/Fakes /Application.cs always returns apiCompatibilityLevel and never apiCompatibilityLevelPerPlatform #668

Open
Flauschelin opened this issue Sep 11, 2024 · 0 comments

Comments

@Flauschelin
Copy link

Flauschelin commented Sep 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant