Skip to content
New issue

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

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

Already on GitHub? # to your account

Always enable FixRoslynAnalyzerImportSettings in CLI #702

Merged
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
8 changes: 1 addition & 7 deletions src/NuGetForUnity.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,14 @@ public static int Main(string[] args)
}

/// <summary>
/// In Unity 2021 the errors that RoslynAnalyzer DLL's can't be imported because it has multiple files with the same name are blocking
/// In Unity the errors that RoslynAnalyzer DLL's can't be imported because it has multiple files with the same name are blocking
/// even before our AssetPostprocessor can change the import settings so Unity knows that the DLL is a RoslynAnalyzer.
/// To bypass this error we generate the .dll.meta files with the RoslynAnalyzer label and the disable for platform configuration.
/// A alternative could be to delete the duplicate .resources.dll files when restoring,
/// but this would require to decide which user language to keep.
/// </summary>
private static void FixRoslynAnalyzerImportSettings()
{
if (int.Parse(Application.unityVersion.Split('.').First()) > 2021)
{
// in unity 2022 our AssetPostprocessor is handled before we get the errors for the RoslynAnalyzer DLL's
return;
}

if (!Directory.Exists(ConfigurationManager.NugetConfigFile.RepositoryPath))
{
return;
Expand Down
Loading